GStreamer: fix compilation with version < 0.10.31.
Qt 5.4 and earlier required GStreamer 0.10.24 as minimum version. Qt 5.5 added code that requires 0.10.31, this code is now ifdef'd and we now support again 0.10.24. Task-number: QTBUG-48353 Change-Id: Ie708a33c0515874b003ce26a3400475075d316ca Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
This commit is contained in:
@@ -148,9 +148,7 @@ GstElement *QGstreamerVideoOverlay::findBestVideoSink() const
|
|||||||
|
|
||||||
// If none of the known video sinks are available, try to find one that implements the
|
// If none of the known video sinks are available, try to find one that implements the
|
||||||
// GstVideoOverlay interface and has autoplugging rank.
|
// GstVideoOverlay interface and has autoplugging rank.
|
||||||
GList *list = gst_element_factory_list_get_elements(GST_ELEMENT_FACTORY_TYPE_SINK | GST_ELEMENT_FACTORY_TYPE_MEDIA_VIDEO,
|
GList *list = qt_gst_video_sinks();
|
||||||
GST_RANK_MARGINAL);
|
|
||||||
|
|
||||||
for (GList *item = list; item != NULL; item = item->next) {
|
for (GList *item = list; item != NULL; item = item->next) {
|
||||||
GstElementFactory *f = GST_ELEMENT_FACTORY(item->data);
|
GstElementFactory *f = GST_ELEMENT_FACTORY(item->data);
|
||||||
|
|
||||||
@@ -242,12 +240,17 @@ void QGstreamerVideoOverlay::setRenderRectangle(const QRect &rect)
|
|||||||
h = rect.height();
|
h = rect.height();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !GST_CHECK_VERSION(1,0,0)
|
#if GST_CHECK_VERSION(1,0,0)
|
||||||
|
if (m_videoSink && GST_IS_VIDEO_OVERLAY(m_videoSink))
|
||||||
|
gst_video_overlay_set_render_rectangle(GST_VIDEO_OVERLAY(m_videoSink), x, y, w, h);
|
||||||
|
#elif GST_CHECK_VERSION(0, 10, 29)
|
||||||
if (m_videoSink && GST_IS_X_OVERLAY(m_videoSink))
|
if (m_videoSink && GST_IS_X_OVERLAY(m_videoSink))
|
||||||
gst_x_overlay_set_render_rectangle(GST_X_OVERLAY(m_videoSink), x, y , w , h);
|
gst_x_overlay_set_render_rectangle(GST_X_OVERLAY(m_videoSink), x, y , w , h);
|
||||||
#else
|
#else
|
||||||
if (m_videoSink && GST_IS_VIDEO_OVERLAY(m_videoSink))
|
Q_UNUSED(x)
|
||||||
gst_video_overlay_set_render_rectangle(GST_VIDEO_OVERLAY(m_videoSink), x, y, w, h);
|
Q_UNUSED(y)
|
||||||
|
Q_UNUSED(w)
|
||||||
|
Q_UNUSED(h)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -774,6 +774,7 @@ QSet<QString> QGstUtils::supportedMimeTypes(bool (*isValidFactory)(GstElementFac
|
|||||||
return supportedMimeTypes;
|
return supportedMimeTypes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if GST_CHECK_VERSION(1, 0, 0)
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
struct ColorFormat { QImage::Format imageFormat; GstVideoFormat gstFormat; };
|
struct ColorFormat { QImage::Format imageFormat; GstVideoFormat gstFormat; };
|
||||||
@@ -786,6 +787,7 @@ static const ColorFormat qt_colorLookup[] =
|
|||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#if GST_CHECK_VERSION(1,0,0)
|
#if GST_CHECK_VERSION(1,0,0)
|
||||||
QImage QGstUtils::bufferToImage(GstBuffer *buffer, const GstVideoInfo &videoInfo)
|
QImage QGstUtils::bufferToImage(GstBuffer *buffer, const GstVideoInfo &videoInfo)
|
||||||
@@ -1212,6 +1214,7 @@ void QGstUtils::setMetaData(GstElement *element, const QMap<QByteArray, QVariant
|
|||||||
tagValue.toDouble(),
|
tagValue.toDouble(),
|
||||||
NULL);
|
NULL);
|
||||||
break;
|
break;
|
||||||
|
#if GST_CHECK_VERSION(0, 10, 31)
|
||||||
case QVariant::DateTime: {
|
case QVariant::DateTime: {
|
||||||
QDateTime date = tagValue.toDateTime().toLocalTime();
|
QDateTime date = tagValue.toDateTime().toLocalTime();
|
||||||
gst_tag_setter_add_tags(GST_TAG_SETTER(element),
|
gst_tag_setter_add_tags(GST_TAG_SETTER(element),
|
||||||
@@ -1223,6 +1226,7 @@ void QGstUtils::setMetaData(GstElement *element, const QMap<QByteArray, QVariant
|
|||||||
NULL);
|
NULL);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -1408,8 +1412,10 @@ GstCaps *qt_gst_pad_get_caps(GstPad *pad)
|
|||||||
{
|
{
|
||||||
#if GST_CHECK_VERSION(1,0,0)
|
#if GST_CHECK_VERSION(1,0,0)
|
||||||
return gst_pad_query_caps(pad, NULL);
|
return gst_pad_query_caps(pad, NULL);
|
||||||
#else
|
#elif GST_CHECK_VERSION(0, 10, 26)
|
||||||
return gst_pad_get_caps_reffed(pad);
|
return gst_pad_get_caps_reffed(pad);
|
||||||
|
#else
|
||||||
|
return gst_pad_get_caps(pad);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1464,6 +1470,67 @@ const gchar *qt_gst_element_get_factory_name(GstElement *element)
|
|||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gboolean qt_gst_caps_can_intersect(const GstCaps * caps1, const GstCaps * caps2)
|
||||||
|
{
|
||||||
|
#if GST_CHECK_VERSION(0, 10, 25)
|
||||||
|
return gst_caps_can_intersect(caps1, caps2);
|
||||||
|
#else
|
||||||
|
GstCaps *intersection = gst_caps_intersect(caps1, caps2);
|
||||||
|
gboolean res = !gst_caps_is_empty(intersection);
|
||||||
|
gst_caps_unref(intersection);
|
||||||
|
return res;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
#if !GST_CHECK_VERSION(0, 10, 31)
|
||||||
|
static gboolean qt_gst_videosink_factory_filter(GstPluginFeature *feature, gpointer)
|
||||||
|
{
|
||||||
|
guint rank;
|
||||||
|
const gchar *klass;
|
||||||
|
|
||||||
|
if (!GST_IS_ELEMENT_FACTORY(feature))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
klass = gst_element_factory_get_klass(GST_ELEMENT_FACTORY(feature));
|
||||||
|
if (!(strstr(klass, "Sink") && strstr(klass, "Video")))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
rank = gst_plugin_feature_get_rank(feature);
|
||||||
|
if (rank < GST_RANK_MARGINAL)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
static gint qt_gst_compare_ranks(GstPluginFeature *f1, GstPluginFeature *f2)
|
||||||
|
{
|
||||||
|
gint diff;
|
||||||
|
|
||||||
|
diff = gst_plugin_feature_get_rank(f2) - gst_plugin_feature_get_rank(f1);
|
||||||
|
if (diff != 0)
|
||||||
|
return diff;
|
||||||
|
|
||||||
|
return strcmp(gst_plugin_feature_get_name(f2), gst_plugin_feature_get_name (f1));
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
GList *qt_gst_video_sinks()
|
||||||
|
{
|
||||||
|
GList *list = NULL;
|
||||||
|
|
||||||
|
#if GST_CHECK_VERSION(0, 10, 31)
|
||||||
|
list = gst_element_factory_list_get_elements(GST_ELEMENT_FACTORY_TYPE_SINK | GST_ELEMENT_FACTORY_TYPE_MEDIA_VIDEO,
|
||||||
|
GST_RANK_MARGINAL);
|
||||||
|
#else
|
||||||
|
list = gst_registry_feature_filter(gst_registry_get_default(),
|
||||||
|
(GstPluginFeatureFilter)qt_gst_videosink_factory_filter,
|
||||||
|
FALSE, NULL);
|
||||||
|
list = g_list_sort(list, (GCompareFunc)qt_gst_compare_ranks);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
QDebug operator <<(QDebug debug, GstCaps *caps)
|
QDebug operator <<(QDebug debug, GstCaps *caps)
|
||||||
{
|
{
|
||||||
if (caps) {
|
if (caps) {
|
||||||
|
|||||||
@@ -376,9 +376,6 @@ void QVideoSurfaceGstSink::class_init(gpointer g_class, gpointer class_data)
|
|||||||
|
|
||||||
sink_parent_class = reinterpret_cast<GstVideoSinkClass *>(g_type_class_peek_parent(g_class));
|
sink_parent_class = reinterpret_cast<GstVideoSinkClass *>(g_type_class_peek_parent(g_class));
|
||||||
|
|
||||||
GstVideoSinkClass *video_sink_class = reinterpret_cast<GstVideoSinkClass *>(g_class);
|
|
||||||
video_sink_class->show_frame = QVideoSurfaceGstSink::show_frame;
|
|
||||||
|
|
||||||
GstBaseSinkClass *base_sink_class = reinterpret_cast<GstBaseSinkClass *>(g_class);
|
GstBaseSinkClass *base_sink_class = reinterpret_cast<GstBaseSinkClass *>(g_class);
|
||||||
base_sink_class->get_caps = QVideoSurfaceGstSink::get_caps;
|
base_sink_class->get_caps = QVideoSurfaceGstSink::get_caps;
|
||||||
base_sink_class->set_caps = QVideoSurfaceGstSink::set_caps;
|
base_sink_class->set_caps = QVideoSurfaceGstSink::set_caps;
|
||||||
@@ -387,6 +384,14 @@ void QVideoSurfaceGstSink::class_init(gpointer g_class, gpointer class_data)
|
|||||||
base_sink_class->stop = QVideoSurfaceGstSink::stop;
|
base_sink_class->stop = QVideoSurfaceGstSink::stop;
|
||||||
base_sink_class->unlock = QVideoSurfaceGstSink::unlock;
|
base_sink_class->unlock = QVideoSurfaceGstSink::unlock;
|
||||||
|
|
||||||
|
#if GST_CHECK_VERSION(0, 10, 25)
|
||||||
|
GstVideoSinkClass *video_sink_class = reinterpret_cast<GstVideoSinkClass *>(g_class);
|
||||||
|
video_sink_class->show_frame = QVideoSurfaceGstSink::show_frame;
|
||||||
|
#else
|
||||||
|
base_sink_class->preroll = QVideoSurfaceGstSink::preroll;
|
||||||
|
base_sink_class->render = QVideoSurfaceGstSink::render;
|
||||||
|
#endif
|
||||||
|
|
||||||
GstElementClass *element_class = reinterpret_cast<GstElementClass *>(g_class);
|
GstElementClass *element_class = reinterpret_cast<GstElementClass *>(g_class);
|
||||||
element_class->change_state = QVideoSurfaceGstSink::change_state;
|
element_class->change_state = QVideoSurfaceGstSink::change_state;
|
||||||
|
|
||||||
@@ -674,10 +679,30 @@ gboolean QVideoSurfaceGstSink::unlock(GstBaseSink *base)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if GST_CHECK_VERSION(0, 10, 25)
|
||||||
GstFlowReturn QVideoSurfaceGstSink::show_frame(GstVideoSink *base, GstBuffer *buffer)
|
GstFlowReturn QVideoSurfaceGstSink::show_frame(GstVideoSink *base, GstBuffer *buffer)
|
||||||
{
|
{
|
||||||
VO_SINK(base);
|
VO_SINK(base);
|
||||||
return sink->delegate->render(buffer);
|
return sink->delegate->render(buffer);
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
GstFlowReturn QVideoSurfaceGstSink::preroll(GstBaseSink *base, GstBuffer *buffer)
|
||||||
|
{
|
||||||
|
VO_SINK(base);
|
||||||
|
gboolean showPrerollFrame = true;
|
||||||
|
g_object_get(G_OBJECT(sink), "show-preroll-frame", &showPrerollFrame, NULL);
|
||||||
|
|
||||||
|
if (showPrerollFrame)
|
||||||
|
return sink->delegate->render(buffer);
|
||||||
|
|
||||||
|
return GST_FLOW_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
GstFlowReturn QVideoSurfaceGstSink::render(GstBaseSink *base, GstBuffer *buffer)
|
||||||
|
{
|
||||||
|
VO_SINK(base);
|
||||||
|
return sink->delegate->render(buffer);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|||||||
@@ -150,6 +150,8 @@ gboolean qt_gst_element_query_position(GstElement *element, GstFormat format, gi
|
|||||||
gboolean qt_gst_element_query_duration(GstElement *element, GstFormat format, gint64 *cur);
|
gboolean qt_gst_element_query_duration(GstElement *element, GstFormat format, gint64 *cur);
|
||||||
GstCaps *qt_gst_caps_normalize(GstCaps *caps);
|
GstCaps *qt_gst_caps_normalize(GstCaps *caps);
|
||||||
const gchar *qt_gst_element_get_factory_name(GstElement *element);
|
const gchar *qt_gst_element_get_factory_name(GstElement *element);
|
||||||
|
gboolean qt_gst_caps_can_intersect(const GstCaps * caps1, const GstCaps * caps2);
|
||||||
|
GList *qt_gst_video_sinks();
|
||||||
|
|
||||||
QDebug operator <<(QDebug debug, GstCaps *caps);
|
QDebug operator <<(QDebug debug, GstCaps *caps);
|
||||||
|
|
||||||
|
|||||||
@@ -157,7 +157,12 @@ private:
|
|||||||
|
|
||||||
static gboolean unlock(GstBaseSink *sink);
|
static gboolean unlock(GstBaseSink *sink);
|
||||||
|
|
||||||
|
#if GST_CHECK_VERSION(0, 10, 25)
|
||||||
static GstFlowReturn show_frame(GstVideoSink *sink, GstBuffer *buffer);
|
static GstFlowReturn show_frame(GstVideoSink *sink, GstBuffer *buffer);
|
||||||
|
#else
|
||||||
|
static GstFlowReturn preroll(GstBaseSink *sink, GstBuffer *buffer);
|
||||||
|
static GstFlowReturn render(GstBaseSink *sink, GstBuffer *buffer);
|
||||||
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QVideoSurfaceGstDelegate *delegate;
|
QVideoSurfaceGstDelegate *delegate;
|
||||||
|
|||||||
@@ -70,9 +70,15 @@ QMultimedia::SupportEstimate QGstreamerAudioDecoderServicePlugin::hasSupport(con
|
|||||||
|
|
||||||
static bool isDecoderOrDemuxer(GstElementFactory *factory)
|
static bool isDecoderOrDemuxer(GstElementFactory *factory)
|
||||||
{
|
{
|
||||||
|
#if GST_CHECK_VERSION(0, 10, 31)
|
||||||
return gst_element_factory_list_is_type(factory, GST_ELEMENT_FACTORY_TYPE_DEMUXER)
|
return gst_element_factory_list_is_type(factory, GST_ELEMENT_FACTORY_TYPE_DEMUXER)
|
||||||
|| gst_element_factory_list_is_type(factory, GST_ELEMENT_FACTORY_TYPE_DECODER
|
|| gst_element_factory_list_is_type(factory, GST_ELEMENT_FACTORY_TYPE_DECODER
|
||||||
| GST_ELEMENT_FACTORY_TYPE_MEDIA_AUDIO);
|
| GST_ELEMENT_FACTORY_TYPE_MEDIA_AUDIO);
|
||||||
|
#else
|
||||||
|
return (factory
|
||||||
|
&& (qstrcmp(factory->details.klass, "Codec/Decoder/Audio") == 0
|
||||||
|
|| qstrcmp(factory->details.klass, "Codec/Demux") == 0));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void QGstreamerAudioDecoderServicePlugin::updateSupportedMimeTypes() const
|
void QGstreamerAudioDecoderServicePlugin::updateSupportedMimeTypes() const
|
||||||
|
|||||||
@@ -77,9 +77,7 @@ static const QGstreamerMetaDataKeyLookup *qt_gstreamerMetaDataKeys()
|
|||||||
metadataKeys->insert(QMediaMetaData::AlbumTitle, GST_TAG_ALBUM);
|
metadataKeys->insert(QMediaMetaData::AlbumTitle, GST_TAG_ALBUM);
|
||||||
metadataKeys->insert(QMediaMetaData::AlbumArtist, GST_TAG_ARTIST);
|
metadataKeys->insert(QMediaMetaData::AlbumArtist, GST_TAG_ARTIST);
|
||||||
metadataKeys->insert(QMediaMetaData::ContributingArtist, GST_TAG_PERFORMER);
|
metadataKeys->insert(QMediaMetaData::ContributingArtist, GST_TAG_PERFORMER);
|
||||||
#if (GST_VERSION_MAJOR >= 0) && (GST_VERSION_MINOR >= 10) && (GST_VERSION_MICRO >= 19)
|
|
||||||
metadataKeys->insert(QMediaMetaData::Composer, GST_TAG_COMPOSER);
|
metadataKeys->insert(QMediaMetaData::Composer, GST_TAG_COMPOSER);
|
||||||
#endif
|
|
||||||
//metadataKeys->insert(QMediaMetaData::Conductor, 0);
|
//metadataKeys->insert(QMediaMetaData::Conductor, 0);
|
||||||
//metadataKeys->insert(QMediaMetaData::Lyrics, 0);
|
//metadataKeys->insert(QMediaMetaData::Lyrics, 0);
|
||||||
//metadataKeys->insert(QMediaMetaData::Mood, 0);
|
//metadataKeys->insert(QMediaMetaData::Mood, 0);
|
||||||
|
|||||||
@@ -113,8 +113,15 @@ QMultimedia::SupportEstimate QGstreamerCaptureServicePlugin::hasSupport(const QS
|
|||||||
|
|
||||||
static bool isEncoderOrMuxer(GstElementFactory *factory)
|
static bool isEncoderOrMuxer(GstElementFactory *factory)
|
||||||
{
|
{
|
||||||
|
#if GST_CHECK_VERSION(0, 10, 31)
|
||||||
return gst_element_factory_list_is_type(factory, GST_ELEMENT_FACTORY_TYPE_MUXER)
|
return gst_element_factory_list_is_type(factory, GST_ELEMENT_FACTORY_TYPE_MUXER)
|
||||||
|| gst_element_factory_list_is_type(factory, GST_ELEMENT_FACTORY_TYPE_ENCODER);
|
|| gst_element_factory_list_is_type(factory, GST_ELEMENT_FACTORY_TYPE_ENCODER);
|
||||||
|
#else
|
||||||
|
return (factory
|
||||||
|
&& (qstrcmp(factory->details.klass, "Codec/Encoder/Audio") == 0
|
||||||
|
|| qstrcmp(factory->details.klass, "Codec/Encoder/Video") == 0
|
||||||
|
|| qstrcmp(factory->details.klass, "Codec/Muxer") == 0 ));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void QGstreamerCaptureServicePlugin::updateSupportedMimeTypes() const
|
void QGstreamerCaptureServicePlugin::updateSupportedMimeTypes() const
|
||||||
|
|||||||
@@ -628,12 +628,12 @@ bool QGstreamerCaptureSession::rebuildGraph(QGstreamerCaptureSession::PipelineMo
|
|||||||
}
|
}
|
||||||
|
|
||||||
dumpGraph( QString("rebuild_graph_%1_%2").arg(m_pipelineMode).arg(newMode) );
|
dumpGraph( QString("rebuild_graph_%1_%2").arg(m_pipelineMode).arg(newMode) );
|
||||||
|
#ifdef QT_GST_CAPTURE_DEBUG
|
||||||
if (m_encodeBin) {
|
if (m_encodeBin) {
|
||||||
QString fileName = QString("rebuild_graph_encode_%1_%2").arg(m_pipelineMode).arg(newMode);
|
QString fileName = QString("rebuild_graph_encode_%1_%2").arg(m_pipelineMode).arg(newMode);
|
||||||
#if !(GST_DISABLE_GST_DEBUG) && (GST_VERSION_MAJOR >= 0) && (GST_VERSION_MINOR >= 10) && (GST_VERSION_MICRO >= 19)
|
GST_DEBUG_BIN_TO_DOT_FILE(GST_BIN(m_encodeBin), GST_DEBUG_GRAPH_SHOW_ALL, fileName.toLatin1());
|
||||||
_gst_debug_bin_to_dot_file(GST_BIN(m_encodeBin), GST_DEBUG_GRAPH_SHOW_ALL, fileName.toLatin1());
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (ok) {
|
if (ok) {
|
||||||
addAudioBufferProbe();
|
addAudioBufferProbe();
|
||||||
@@ -657,12 +657,12 @@ bool QGstreamerCaptureSession::rebuildGraph(QGstreamerCaptureSession::PipelineMo
|
|||||||
|
|
||||||
void QGstreamerCaptureSession::dumpGraph(const QString &fileName)
|
void QGstreamerCaptureSession::dumpGraph(const QString &fileName)
|
||||||
{
|
{
|
||||||
#if !(GST_DISABLE_GST_DEBUG) && (GST_VERSION_MAJOR >= 0) && (GST_VERSION_MINOR >= 10) && (GST_VERSION_MICRO >= 19)
|
#ifdef QT_GST_CAPTURE_DEBUG
|
||||||
_gst_debug_bin_to_dot_file(GST_BIN(m_pipeline),
|
GST_DEBUG_BIN_TO_DOT_FILE(GST_BIN(m_pipeline),
|
||||||
GstDebugGraphDetails(/*GST_DEBUG_GRAPH_SHOW_ALL |*/ GST_DEBUG_GRAPH_SHOW_MEDIA_TYPE | GST_DEBUG_GRAPH_SHOW_NON_DEFAULT_PARAMS | GST_DEBUG_GRAPH_SHOW_STATES),
|
GstDebugGraphDetails(/*GST_DEBUG_GRAPH_SHOW_ALL |*/ GST_DEBUG_GRAPH_SHOW_MEDIA_TYPE | GST_DEBUG_GRAPH_SHOW_NON_DEFAULT_PARAMS | GST_DEBUG_GRAPH_SHOW_STATES),
|
||||||
fileName.toLatin1());
|
fileName.toLatin1());
|
||||||
#else
|
#else
|
||||||
Q_UNUSED(fileName);
|
Q_UNUSED(fileName)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -76,13 +76,10 @@ static const QGstreamerMetaDataKeyLookup *qt_gstreamerMetaDataKeys()
|
|||||||
|
|
||||||
// Music
|
// Music
|
||||||
metadataKeys->insert(GST_TAG_ALBUM, QMediaMetaData::AlbumTitle);
|
metadataKeys->insert(GST_TAG_ALBUM, QMediaMetaData::AlbumTitle);
|
||||||
#if (GST_VERSION_MAJOR >= 0) && (GST_VERSION_MINOR >= 10) && (GST_VERSION_MICRO >= 25)
|
#if GST_CHECK_VERSION(0, 10, 25)
|
||||||
metadataKeys->insert(GST_TAG_ALBUM_ARTIST, QMediaMetaData::AlbumArtist);
|
metadataKeys->insert(GST_TAG_ALBUM_ARTIST, QMediaMetaData::AlbumArtist);
|
||||||
#endif
|
#endif
|
||||||
metadataKeys->insert(GST_TAG_ARTIST, QMediaMetaData::ContributingArtist);
|
metadataKeys->insert(GST_TAG_ARTIST, QMediaMetaData::ContributingArtist);
|
||||||
#if (GST_VERSION_MAJOR >= 0) && (GST_VERSION_MINOR >= 10) && (GST_VERSION_MICRO >= 19)
|
|
||||||
metadataKeys->insert(GST_TAG_COMPOSER, QMediaMetaData::Composer);
|
|
||||||
#endif
|
|
||||||
//metadataKeys->insert(0, QMediaMetaData::Conductor);
|
//metadataKeys->insert(0, QMediaMetaData::Conductor);
|
||||||
//metadataKeys->insert(0, QMediaMetaData::Lyrics);
|
//metadataKeys->insert(0, QMediaMetaData::Lyrics);
|
||||||
//metadataKeys->insert(0, QMediaMetaData::Mood);
|
//metadataKeys->insert(0, QMediaMetaData::Mood);
|
||||||
|
|||||||
@@ -83,8 +83,15 @@ QMultimedia::SupportEstimate QGstreamerPlayerServicePlugin::hasSupport(const QSt
|
|||||||
|
|
||||||
static bool isDecoderOrDemuxer(GstElementFactory *factory)
|
static bool isDecoderOrDemuxer(GstElementFactory *factory)
|
||||||
{
|
{
|
||||||
|
#if GST_CHECK_VERSION(0, 10 ,31)
|
||||||
return gst_element_factory_list_is_type(factory, GST_ELEMENT_FACTORY_TYPE_DEMUXER)
|
return gst_element_factory_list_is_type(factory, GST_ELEMENT_FACTORY_TYPE_DEMUXER)
|
||||||
|| gst_element_factory_list_is_type(factory, GST_ELEMENT_FACTORY_TYPE_DECODER);
|
|| gst_element_factory_list_is_type(factory, GST_ELEMENT_FACTORY_TYPE_DECODER);
|
||||||
|
#else
|
||||||
|
return (factory
|
||||||
|
&& (qstrcmp(factory->details.klass, "Codec/Decoder/Audio") == 0
|
||||||
|
|| qstrcmp(factory->details.klass, "Codec/Decoder/Video") == 0
|
||||||
|
|| qstrcmp(factory->details.klass, "Codec/Demux") == 0 ));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void QGstreamerPlayerServicePlugin::updateSupportedMimeTypes() const
|
void QGstreamerPlayerServicePlugin::updateSupportedMimeTypes() const
|
||||||
|
|||||||
@@ -388,7 +388,7 @@ QMediaTimeRange QGstreamerPlayerSession::availablePlaybackRanges() const
|
|||||||
if (duration() <= 0)
|
if (duration() <= 0)
|
||||||
return ranges;
|
return ranges;
|
||||||
|
|
||||||
#if (GST_VERSION_MAJOR >= 0) && (GST_VERSION_MINOR >= 10) && (GST_VERSION_MICRO >= 31)
|
#if GST_CHECK_VERSION(0, 10, 31)
|
||||||
//GST_FORMAT_TIME would be more appropriate, but unfortunately it's not supported.
|
//GST_FORMAT_TIME would be more appropriate, but unfortunately it's not supported.
|
||||||
//with GST_FORMAT_PERCENT media is treated as encoded with constant bitrate.
|
//with GST_FORMAT_PERCENT media is treated as encoded with constant bitrate.
|
||||||
GstQuery* query = gst_query_new_buffering(GST_FORMAT_PERCENT);
|
GstQuery* query = gst_query_new_buffering(GST_FORMAT_PERCENT);
|
||||||
@@ -1637,7 +1637,7 @@ void QGstreamerPlayerSession::updateMuted()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if (GST_VERSION_MAJOR == 0) && ((GST_VERSION_MINOR < 10) || (GST_VERSION_MICRO < 33))
|
#if !GST_CHECK_VERSION(0, 10, 33)
|
||||||
static gboolean factory_can_src_any_caps (GstElementFactory *factory, const GstCaps *caps)
|
static gboolean factory_can_src_any_caps (GstElementFactory *factory, const GstCaps *caps)
|
||||||
{
|
{
|
||||||
GList *templates;
|
GList *templates;
|
||||||
@@ -1653,7 +1653,7 @@ static gboolean factory_can_src_any_caps (GstElementFactory *factory, const GstC
|
|||||||
if (templ->direction == GST_PAD_SRC) {
|
if (templ->direction == GST_PAD_SRC) {
|
||||||
GstCaps *templcaps = gst_static_caps_get(&templ->static_caps);
|
GstCaps *templcaps = gst_static_caps_get(&templ->static_caps);
|
||||||
|
|
||||||
if (gst_caps_can_intersect(caps, templcaps)) {
|
if (qt_gst_caps_can_intersect(caps, templcaps)) {
|
||||||
gst_caps_unref(templcaps);
|
gst_caps_unref(templcaps);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@@ -1685,7 +1685,7 @@ GstAutoplugSelectResult QGstreamerPlayerSession::handleAutoplugSelect(GstBin *bi
|
|||||||
GstCaps *sinkCaps = gst_pad_get_caps(sinkPad);
|
GstCaps *sinkCaps = gst_pad_get_caps(sinkPad);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (GST_VERSION_MAJOR == 0) && ((GST_VERSION_MINOR < 10) || (GST_VERSION_MICRO < 33))
|
#if !GST_CHECK_VERSION(0, 10, 33)
|
||||||
if (!factory_can_src_any_caps(factory, sinkCaps))
|
if (!factory_can_src_any_caps(factory, sinkCaps))
|
||||||
#else
|
#else
|
||||||
if (!gst_element_factory_can_src_any_caps(factory, sinkCaps))
|
if (!gst_element_factory_can_src_any_caps(factory, sinkCaps))
|
||||||
|
|||||||
Reference in New Issue
Block a user