GStreamer: port to 1.0.
0.10 is still used by default. To enable GStreamer 1.0, pass GST_VERSION=1.0 to qmake for qtmultimedia.pro. Contributions from: Andrew den Exter <andrew.den.exter@qinetic.com.au> Ilya Smelykh <ilya@videoexpertsgroup.com> Jim Hodapp <jim.hodapp@canonical.com> Sergio Schvezov <sergio.schvezov@canonical.com> Change-Id: I72a46d1170a8794a149bdb5e20767afcc5b7587c Reviewed-by: Andrew den Exter <andrew.den.exter@qinetic.com.au>
This commit is contained in:
committed by
Andrew den Exter
parent
7e3d69668e
commit
108dda7a90
@@ -49,14 +49,32 @@
|
||||
#include <QtCore/qset.h>
|
||||
#include <QtCore/qvector.h>
|
||||
#include <gst/gst.h>
|
||||
#include <gst/video/video.h>
|
||||
#include <qaudioformat.h>
|
||||
#include <qcamera.h>
|
||||
#include <qabstractvideobuffer.h>
|
||||
#include <qvideoframe.h>
|
||||
#include <QDebug>
|
||||
|
||||
#if GST_CHECK_VERSION(1,0,0)
|
||||
# define QT_GSTREAMER_PLAYBIN_ELEMENT_NAME "playbin"
|
||||
# define QT_GSTREAMER_CAMERABIN_ELEMENT_NAME "camerabin"
|
||||
# define QT_GSTREAMER_COLORCONVERSION_ELEMENT_NAME "videoconvert"
|
||||
# define QT_GSTREAMER_RAW_AUDIO_MIME "audio/x-raw"
|
||||
#else
|
||||
# define QT_GSTREAMER_PLAYBIN_ELEMENT_NAME "playbin2"
|
||||
# define QT_GSTREAMER_CAMERABIN_ELEMENT_NAME "camerabin2"
|
||||
# define QT_GSTREAMER_COLORCONVERSION_ELEMENT_NAME "ffmpegcolorspace"
|
||||
# define QT_GSTREAMER_RAW_AUDIO_MIME "audio/x-raw-int"
|
||||
#endif
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class QSize;
|
||||
class QVariant;
|
||||
class QByteArray;
|
||||
class QImage;
|
||||
class QVideoSurfaceFormat;
|
||||
|
||||
namespace QGstUtils {
|
||||
struct CameraInfo
|
||||
@@ -73,8 +91,12 @@ namespace QGstUtils {
|
||||
QSize capsResolution(const GstCaps *caps);
|
||||
QSize capsCorrectedResolution(const GstCaps *caps);
|
||||
QAudioFormat audioFormatForCaps(const GstCaps *caps);
|
||||
#if GST_CHECK_VERSION(1,0,0)
|
||||
QAudioFormat audioFormatForSample(GstSample *sample);
|
||||
#else
|
||||
QAudioFormat audioFormatForBuffer(GstBuffer *buffer);
|
||||
GstCaps *capsForAudioFormat(QAudioFormat format);
|
||||
#endif
|
||||
GstCaps *capsForAudioFormat(const QAudioFormat &format);
|
||||
void initializeGst();
|
||||
QMultimedia::SupportEstimate hasSupport(const QString &mimeType,
|
||||
const QStringList &codecs,
|
||||
@@ -86,9 +108,40 @@ namespace QGstUtils {
|
||||
QCamera::Position cameraPosition(const QString &device, GstElementFactory * factory = 0);
|
||||
int cameraOrientation(const QString &device, GstElementFactory * factory = 0);
|
||||
QByteArray cameraDriver(const QString &device, GstElementFactory * factory = 0);
|
||||
|
||||
QSet<QString> supportedMimeTypes(bool (*isValidFactory)(GstElementFactory *factory));
|
||||
|
||||
#if GST_CHECK_VERSION(1,0,0)
|
||||
QImage bufferToImage(GstBuffer *buffer, const GstVideoInfo &info);
|
||||
QVideoSurfaceFormat formatForCaps(
|
||||
GstCaps *caps,
|
||||
GstVideoInfo *info,
|
||||
QAbstractVideoBuffer::HandleType handleType = QAbstractVideoBuffer::NoHandle);
|
||||
#else
|
||||
QImage bufferToImage(GstBuffer *buffer);
|
||||
QVideoSurfaceFormat formatForCaps(
|
||||
GstCaps *caps,
|
||||
int *bytesPerLine = 0,
|
||||
QAbstractVideoBuffer::HandleType handleType = QAbstractVideoBuffer::NoHandle);
|
||||
#endif
|
||||
|
||||
GstCaps *capsForFormats(const QList<QVideoFrame::PixelFormat> &formats);
|
||||
void setFrameTimeStamps(QVideoFrame *frame, GstBuffer *buffer);
|
||||
|
||||
void setMetaData(GstElement *element, const QMap<QByteArray, QVariant> &data);
|
||||
void setMetaData(GstBin *bin, const QMap<QByteArray, QVariant> &data);
|
||||
|
||||
GstCaps *videoFilterCaps();
|
||||
|
||||
}
|
||||
|
||||
void qt_gst_object_ref_sink(gpointer object);
|
||||
GstCaps *qt_gst_pad_get_current_caps(GstPad *pad);
|
||||
GstStructure *qt_gst_structure_new_empty(const char *name);
|
||||
gboolean qt_gst_element_query_position(GstElement *element, GstFormat format, gint64 *cur);
|
||||
gboolean qt_gst_element_query_duration(GstElement *element, GstFormat format, gint64 *cur);
|
||||
|
||||
QDebug operator <<(QDebug debug, GstCaps *caps);
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
|
||||
Reference in New Issue
Block a user