-
Notifications
You must be signed in to change notification settings - Fork 11
/
gphotomediaservice.cpp
58 lines (45 loc) · 1.93 KB
/
gphotomediaservice.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#include "gphotocameracapturedestinationcontrol.h"
#include "gphotocameracontrol.h"
#include "gphotocamerafocuscontrol.h"
#include "gphotocameraimagecapturecontrol.h"
#include "gphotocameralockcontrol.h"
#include "gphotocamerasession.h"
#include "gphotoexposurecontrol.h"
#include "gphotomediaservice.h"
#include "gphotovideoinputdevicecontrol.h"
#include "gphotovideoprobecontrol.h"
#include "gphotovideorenderercontrol.h"
GPhotoMediaService::GPhotoMediaService(std::weak_ptr<GPhotoController> controller, QObject *parent)
: QMediaService(parent)
, m_session(new GPhotoCameraSession(std::move(controller)))
{
}
GPhotoMediaService::~GPhotoMediaService()
{
}
QMediaControl *GPhotoMediaService::requestControl(const char *name)
{
if (qstrcmp(name, QCameraCaptureDestinationControl_iid) == 0)
return new GPhotoCameraCaptureDestinationControl(m_session.get(), this);
if (qstrcmp(name, QCameraControl_iid) == 0)
return new GPhotoCameraControl(m_session.get(), this);
if (qstrcmp(name, QCameraFocusControl_iid) == 0)
return m_session->cameraFocusControl();
if (qstrcmp(name, QCameraExposureControl_iid) == 0)
return new GPhotoExposureControl(m_session.get(), this);
if (qstrcmp(name, QCameraImageCaptureControl_iid) == 0)
return new GPhotoCameraImageCaptureControl(m_session.get(), this);
if (qstrcmp(name, QCameraLocksControl_iid) == 0)
return new GPhotoCameraLockControl(m_session.get(), this);
if (qstrcmp(name, QMediaVideoProbeControl_iid) == 0)
return new GPhotoVideoProbeControl(m_session.get(), this);
if (qstrcmp(name, QVideoDeviceSelectorControl_iid) == 0)
return new GPhotoVideoInputDeviceControl(m_session.get(), this);
if (qstrcmp(name, QVideoRendererControl_iid) == 0)
return new GPhotoVideoRendererControl(m_session.get(), this);
return nullptr;
}
void GPhotoMediaService::releaseControl(QMediaControl *control)
{
delete control;
}