55 |
55 |
56 class QGstreamerMessage; |
56 class QGstreamerMessage; |
57 class QGstreamerBusHelper; |
57 class QGstreamerBusHelper; |
58 class QGstreamerAudioEncode; |
58 class QGstreamerAudioEncode; |
59 class QGstreamerVideoEncode; |
59 class QGstreamerVideoEncode; |
60 class QGstreamerImageEncode; |
|
61 class QGstreamerRecorderControl; |
60 class QGstreamerRecorderControl; |
62 class QGstreamerMediaContainerControl; |
61 class QGstreamerMediaContainerControl; |
63 |
62 |
64 class QGstreamerElementFactory |
63 class QGstreamerElementFactory |
65 { |
64 { |
93 QUrl outputLocation() const; |
92 QUrl outputLocation() const; |
94 bool setOutputLocation(const QUrl& sink); |
93 bool setOutputLocation(const QUrl& sink); |
95 |
94 |
96 QGstreamerAudioEncode *audioEncodeControl() const { return m_audioEncodeControl; } |
95 QGstreamerAudioEncode *audioEncodeControl() const { return m_audioEncodeControl; } |
97 QGstreamerVideoEncode *videoEncodeControl() const { return m_videoEncodeControl; } |
96 QGstreamerVideoEncode *videoEncodeControl() const { return m_videoEncodeControl; } |
98 QGstreamerImageEncode *imageEncodeControl() const { return m_imageEncodeControl; } |
|
99 |
97 |
100 QGstreamerRecorderControl *recorderControl() const { return m_recorderControl; } |
98 QGstreamerRecorderControl *recorderControl() const { return m_recorderControl; } |
101 QGstreamerMediaContainerControl *mediaContainerControl() const { return m_mediaContainerControl; } |
99 QGstreamerMediaContainerControl *mediaContainerControl() const { return m_mediaContainerControl; } |
102 |
100 |
103 QGstreamerElementFactory *audioInput() const { return m_audioInputFactory; } |
101 QGstreamerElementFactory *audioInput() const { return m_audioInputFactory; } |
110 void setVideoInput(QGstreamerVideoInput *videoInput); |
108 void setVideoInput(QGstreamerVideoInput *videoInput); |
111 |
109 |
112 QGstreamerElementFactory *videoPreview() const { return m_videoPreviewFactory; } |
110 QGstreamerElementFactory *videoPreview() const { return m_videoPreviewFactory; } |
113 void setVideoPreview(QGstreamerElementFactory *videoPreview); |
111 void setVideoPreview(QGstreamerElementFactory *videoPreview); |
114 |
112 |
115 void captureImage(const QString &fileName); |
|
116 |
|
117 State state() const; |
113 State state() const; |
118 qint64 duration() const; |
114 qint64 duration() const; |
119 |
115 |
120 bool processSyncMessage(const QGstreamerMessage &message); |
116 bool processSyncMessage(const QGstreamerMessage &message); |
121 |
117 |
122 signals: |
118 signals: |
123 void stateChanged(QGstreamerCaptureSession::State state); |
119 void stateChanged(QGstreamerCaptureSession::State state); |
124 void durationChanged(qint64 duration); |
120 void durationChanged(qint64 duration); |
125 void error(int error, const QString &errorString); |
121 void error(int error, const QString &errorString); |
126 void imageCaptured(const QString &fileName, const QImage &img); |
|
127 |
122 |
128 public slots: |
123 public slots: |
129 void setState(QGstreamerCaptureSession::State); |
124 void setState(QGstreamerCaptureSession::State); |
130 void setCaptureDevice(const QString &deviceName); |
125 void setCaptureDevice(const QString &deviceName); |
131 |
126 |
142 GstElement *buildEncodeBin(); |
137 GstElement *buildEncodeBin(); |
143 GstElement *buildAudioSrc(); |
138 GstElement *buildAudioSrc(); |
144 GstElement *buildAudioPreview(); |
139 GstElement *buildAudioPreview(); |
145 GstElement *buildVideoSrc(); |
140 GstElement *buildVideoSrc(); |
146 GstElement *buildVideoPreview(); |
141 GstElement *buildVideoPreview(); |
147 GstElement *buildImageCapture(); |
|
148 |
142 |
149 void waitForStopped(); |
143 void waitForStopped(); |
150 bool rebuildGraph(QGstreamerCaptureSession::PipelineMode newMode); |
144 bool rebuildGraph(QGstreamerCaptureSession::PipelineMode newMode); |
151 |
145 |
152 QUrl m_sink; |
146 QUrl m_sink; |
153 QString m_captureDevice; |
147 QString m_captureDevice; |
154 State m_state; |
148 State m_state; |
155 State m_pendingState; |
149 State m_pendingState; |
|
150 bool m_waitingForEos; |
156 PipelineMode m_pipelineMode; |
151 PipelineMode m_pipelineMode; |
157 QGstreamerCaptureSession::CaptureMode m_captureMode; |
152 QGstreamerCaptureSession::CaptureMode m_captureMode; |
158 QMap<QByteArray, QVariant> m_metaData; |
153 QMap<QByteArray, QVariant> m_metaData; |
159 |
154 |
160 QGstreamerElementFactory *m_audioInputFactory; |
155 QGstreamerElementFactory *m_audioInputFactory; |
162 QGstreamerVideoInput *m_videoInputFactory; |
157 QGstreamerVideoInput *m_videoInputFactory; |
163 QGstreamerElementFactory *m_videoPreviewFactory; |
158 QGstreamerElementFactory *m_videoPreviewFactory; |
164 |
159 |
165 QGstreamerAudioEncode *m_audioEncodeControl; |
160 QGstreamerAudioEncode *m_audioEncodeControl; |
166 QGstreamerVideoEncode *m_videoEncodeControl; |
161 QGstreamerVideoEncode *m_videoEncodeControl; |
167 QGstreamerImageEncode *m_imageEncodeControl; |
|
168 QGstreamerRecorderControl *m_recorderControl; |
162 QGstreamerRecorderControl *m_recorderControl; |
169 QGstreamerMediaContainerControl *m_mediaContainerControl; |
163 QGstreamerMediaContainerControl *m_mediaContainerControl; |
170 |
164 |
171 QGstreamerBusHelper *m_busHelper; |
165 QGstreamerBusHelper *m_busHelper; |
172 GstBus* m_bus; |
166 GstBus* m_bus; |