Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qgstreamermediacapture_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QGSTREAMERCAPTURESERVICE_H
5#define QGSTREAMERCAPTURESERVICE_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <private/qplatformmediacapture_p.h>
19#include <private/qplatformmediaintegration_p.h>
20
21#include <common/qgst_p.h>
23
24#include <qtimer.h>
25
27
35
37{
39
40public:
41 static QMaybe<QPlatformMediaCaptureSession *> create();
43
44 QPlatformCamera *camera() override;
45 void setCamera(QPlatformCamera *camera) override;
46
49
52
54 QGstreamerAudioInput *audioInput() { return gstAudioInput; }
55
56 void setVideoPreview(QVideoSink *sink) override;
58
59 void linkEncoder(QGstPad audioSink, QGstPad videoSink);
60 void unlinkEncoder();
61
62 const QGstPipeline &pipeline() const { return capturePipeline; }
63
65
66 void *nativePipeline() override;
67
68private:
69 void setCameraActive(bool activate);
70
71 explicit QGstreamerMediaCapture(QGstreamerVideoOutput *videoOutput);
72
74 // Gst elements
75 QGstPipeline capturePipeline;
76
77 QGstreamerAudioInput *gstAudioInput = nullptr;
78 QGstreamerCamera *gstCamera = nullptr;
79 QMetaObject::Connection gstCameraActiveConnection;
80
81 QGstElement gstAudioTee;
82 QGstElement gstVideoTee;
83 QGstElement encoderVideoCapsFilter;
84 QGstElement encoderAudioCapsFilter;
85
86 QGstPad encoderAudioSink;
87 QGstPad encoderVideoSink;
88 QGstPad imageCaptureSink;
89
90 QGstreamerAudioOutput *gstAudioOutput = nullptr;
91 QGstreamerVideoOutput *gstVideoOutput = nullptr;
92
93 QGstreamerMediaEncoder *m_mediaEncoder = nullptr;
94 QGstreamerImageCapture *m_imageCapture = nullptr;
95};
96
98
99#endif // QGSTREAMERCAPTURESERVICE_H
static QMaybe< QPlatformMediaCaptureSession * > create()
void setImageCapture(QPlatformImageCapture *imageCapture) override
const QGstPipeline & pipeline() const
QGstreamerVideoSink * gstreamerVideoSink() const
void setAudioOutput(QPlatformAudioOutput *output) override
void setCamera(QPlatformCamera *camera) override
void setAudioInput(QPlatformAudioInput *input) override
QPlatformCamera * camera() override
QPlatformMediaRecorder * mediaRecorder() override
QGstreamerAudioInput * audioInput()
void setVideoPreview(QVideoSink *sink) override
void setMediaRecorder(QPlatformMediaRecorder *recorder) override
QPlatformImageCapture * imageCapture() override
void linkEncoder(QGstPad audioSink, QGstPad videoSink)
\inmodule QtCore Represents a handle to a signal-slot (or signal-functor) connection.
The QVideoSink class represents a generic sink for video data.
Definition qvideosink.h:22
QMediaRecorder * recorder
Definition camera.cpp:20
Combined button and popup list for selecting options.
GLsizei GLenum GLboolean sink
GLenum GLenum GLenum input
#define Q_OBJECT
QT_BEGIN_NAMESPACE typedef uchar * output