mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
playback: Add define for colorspace element
Single point of change if you want to switch from ffmpegcolorspace to colorspace.
This commit is contained in:
parent
08ac05a06c
commit
924f743981
5 changed files with 38 additions and 36 deletions
|
@ -8,6 +8,8 @@ built_headers = gstplay-marshal.h
|
|||
|
||||
plugin_LTLIBRARIES = libgstplaybin.la libgstdecodebin.la libgstdecodebin2.la
|
||||
|
||||
csp_cflags = -DCOLORSPACE=\"ffmpegcolorspace\"
|
||||
|
||||
libgstplaybin_la_SOURCES = \
|
||||
gstplayback.c \
|
||||
gstplaybin.c \
|
||||
|
@ -23,7 +25,7 @@ libgstplaybin_la_SOURCES = \
|
|||
gststreamsynchronizer.c
|
||||
|
||||
nodist_libgstplaybin_la_SOURCES = $(built_sources)
|
||||
libgstplaybin_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_CFLAGS)
|
||||
libgstplaybin_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_CFLAGS) $(csp_cflags)
|
||||
libgstplaybin_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
|
||||
libgstplaybin_la_LIBADD = \
|
||||
$(top_builddir)/gst-libs/gst/pbutils/libgstpbutils-@GST_MAJORMINOR@.la \
|
||||
|
@ -34,7 +36,7 @@ libgstplaybin_la_LIBTOOLFLAGS = --tag=disable-static
|
|||
|
||||
libgstdecodebin_la_SOURCES = gstdecodebin.c
|
||||
nodist_libgstdecodebin_la_SOURCES = $(built_sources)
|
||||
libgstdecodebin_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_CFLAGS)
|
||||
libgstdecodebin_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_CFLAGS) $(csp_cflags)
|
||||
libgstdecodebin_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
|
||||
libgstdecodebin_la_LIBADD = \
|
||||
$(top_builddir)/gst-libs/gst/pbutils/libgstpbutils-@GST_MAJORMINOR@.la \
|
||||
|
@ -43,7 +45,7 @@ libgstdecodebin_la_LIBTOOLFLAGS = --tag=disable-static
|
|||
|
||||
libgstdecodebin2_la_SOURCES = gstdecodebin2.c gsturidecodebin.c gstplay-enum.c
|
||||
nodist_libgstdecodebin2_la_SOURCES = $(built_sources)
|
||||
libgstdecodebin2_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_CFLAGS)
|
||||
libgstdecodebin2_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_CFLAGS) $(csp_cflags)
|
||||
libgstdecodebin2_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
|
||||
libgstdecodebin2_la_LIBADD = \
|
||||
$(top_builddir)/gst-libs/gst/pbutils/libgstpbutils-@GST_MAJORMINOR@.la \
|
||||
|
@ -78,7 +80,7 @@ Android.mk: Makefile.am $(BUILT_SOURCES)
|
|||
-:REL_TOP $(top_srcdir) -:ABS_TOP $(abs_top_srcdir) \
|
||||
-:SOURCES $(libgstdecodebin_la_SOURCES) \
|
||||
$(nodist_libgstdecodebin_la_SOURCES) \
|
||||
-:CFLAGS $(DEFS) $(DEFAULT_INCLUDES) $(libgstdecodebin_la_CFLAGS) \
|
||||
-:CFLAGS $(DEFS) $(DEFAULT_INCLUDES) $(libgstdecodebin_la_CFLAGS) $(csp_cflags) \
|
||||
-:LDFLAGS $(libgstdecodebin_la_LDFLAGS) \
|
||||
$(libgstdecodebin_la_LIBADD) \
|
||||
-ldl \
|
||||
|
@ -90,7 +92,7 @@ Android.mk: Makefile.am $(BUILT_SOURCES)
|
|||
-:REL_TOP $(top_srcdir) -:ABS_TOP $(abs_top_srcdir) \
|
||||
-:SOURCES $(libgstdecodebin2_la_SOURCES) \
|
||||
$(nodist_libgstdecodebin2_la_SOURCES) \
|
||||
-:CFLAGS $(DEFS) $(DEFAULT_INCLUDES) $(libgstdecodebin2_la_CFLAGS) \
|
||||
-:CFLAGS $(DEFS) $(DEFAULT_INCLUDES) $(libgstdecodebin2_la_CFLAGS) $(csp_cflags) \
|
||||
-:LDFLAGS $(libgstdecodebin2_la_LDFLAGS) \
|
||||
$(libgstdecodebin2_la_LIBADD) \
|
||||
-ldl \
|
||||
|
@ -102,7 +104,7 @@ Android.mk: Makefile.am $(BUILT_SOURCES)
|
|||
-:REL_TOP $(top_srcdir) -:ABS_TOP $(abs_top_srcdir) \
|
||||
-:SOURCES $(libgstplaybin_la_SOURCES) \
|
||||
$(nodist_libgstplaybin_la_SOURCES) \
|
||||
-:CFLAGS $(DEFS) $(DEFAULT_INCLUDES) $(libgstplaybin_la_CFLAGS) \
|
||||
-:CFLAGS $(DEFS) $(DEFAULT_INCLUDES) $(libgstplaybin_la_CFLAGS) $(csp_cflags) \
|
||||
-:LDFLAGS $(libgstplaybin_la_LDFLAGS) \
|
||||
$(libgstplaybin_la_LIBADD) \
|
||||
-ldl \
|
||||
|
|
|
@ -859,7 +859,7 @@ gen_video_element (GstPlayBin * play_bin)
|
|||
element = gst_bin_new ("vbin");
|
||||
gst_bin_add (GST_BIN_CAST (element), sink);
|
||||
|
||||
conv = gst_element_factory_make ("ffmpegcolorspace", "vconv");
|
||||
conv = gst_element_factory_make (COLORSPACE, "vconv");
|
||||
if (conv == NULL)
|
||||
goto no_colorspace;
|
||||
gst_bin_add (GST_BIN_CAST (element), conv);
|
||||
|
@ -905,10 +905,10 @@ no_sinks:
|
|||
}
|
||||
no_colorspace:
|
||||
{
|
||||
post_missing_element_message (play_bin, "ffmpegcolorspace");
|
||||
post_missing_element_message (play_bin, COLORSPACE);
|
||||
GST_ELEMENT_ERROR (play_bin, CORE, MISSING_PLUGIN,
|
||||
(_("Missing element '%s' - check your GStreamer installation."),
|
||||
"ffmpegcolorspace"), (NULL));
|
||||
COLORSPACE), (NULL));
|
||||
gst_object_unref (element);
|
||||
return NULL;
|
||||
}
|
||||
|
@ -972,7 +972,7 @@ add_text_element (GstPlayBin * play_bin, GstElement * vbin)
|
|||
play_bin->textoverlay_element = GST_ELEMENT_CAST (gst_object_ref (overlay));
|
||||
|
||||
/* we know this will succeed, as the video bin already created one before */
|
||||
csp = gst_element_factory_make ("ffmpegcolorspace", "subtitlecsp");
|
||||
csp = gst_element_factory_make (COLORSPACE, "subtitlecsp");
|
||||
|
||||
/* Add our elements */
|
||||
gst_bin_add_many (GST_BIN_CAST (element), csp, overlay, vbin, NULL);
|
||||
|
@ -1046,7 +1046,7 @@ add_spu_element (GstPlayBin * play_bin, GstElement * vbin)
|
|||
play_bin->spu_element = GST_ELEMENT_CAST (gst_object_ref (overlay));
|
||||
|
||||
/* we know this will succeed, as the video bin already created one before */
|
||||
csp = gst_element_factory_make ("ffmpegcolorspace", "spucsp");
|
||||
csp = gst_element_factory_make (COLORSPACE, "spucsp");
|
||||
|
||||
/* Add our elements */
|
||||
gst_bin_add_many (GST_BIN_CAST (element), csp, overlay, vbin, NULL);
|
||||
|
|
|
@ -1133,13 +1133,13 @@ gen_video_deinterlace_chain (GstPlaySink * playsink)
|
|||
bin = GST_BIN_CAST (chain->chain.bin);
|
||||
gst_object_ref_sink (bin);
|
||||
|
||||
GST_DEBUG_OBJECT (playsink, "creating ffmpegcolorspace");
|
||||
chain->conv = gst_element_factory_make ("ffmpegcolorspace", "vdconv");
|
||||
GST_DEBUG_OBJECT (playsink, "creating " COLORSPACE);
|
||||
chain->conv = gst_element_factory_make (COLORSPACE, "vdconv");
|
||||
if (chain->conv == NULL) {
|
||||
post_missing_element_message (playsink, "ffmpegcolorspace");
|
||||
post_missing_element_message (playsink, COLORSPACE);
|
||||
GST_ELEMENT_WARNING (playsink, CORE, MISSING_PLUGIN,
|
||||
(_("Missing element '%s' - check your GStreamer installation."),
|
||||
"ffmpegcolorspace"), ("video rendering might fail"));
|
||||
COLORSPACE), ("video rendering might fail"));
|
||||
} else {
|
||||
gst_bin_add (bin, chain->conv);
|
||||
head = chain->conv;
|
||||
|
|
|
@ -132,12 +132,12 @@ pad_blocked_cb (GstPad * pad, gboolean blocked, GstPlaySinkVideoConvert * self)
|
|||
gst_ghost_pad_set_target (GST_GHOST_PAD_CAST (self->sinkpad), NULL);
|
||||
gst_ghost_pad_set_target (GST_GHOST_PAD_CAST (self->srcpad), NULL);
|
||||
|
||||
self->conv = gst_element_factory_make ("ffmpegcolorspace", "conv");
|
||||
self->conv = gst_element_factory_make (COLORSPACE, "conv");
|
||||
if (self->conv == NULL) {
|
||||
post_missing_element_message (self, "ffmpegcolorspace");
|
||||
post_missing_element_message (self, COLORSPACE);
|
||||
GST_ELEMENT_WARNING (self, CORE, MISSING_PLUGIN,
|
||||
(_("Missing element '%s' - check your GStreamer installation."),
|
||||
"ffmpegcolorspace"), ("video rendering might fail"));
|
||||
COLORSPACE), ("video rendering might fail"));
|
||||
} else {
|
||||
gst_bin_add (bin, self->conv);
|
||||
gst_element_sync_state_with_parent (self->conv);
|
||||
|
|
|
@ -919,7 +919,7 @@ _pad_blocked_cb (GstPad * pad, gboolean blocked, gpointer user_data)
|
|||
gst_object_unref (src);
|
||||
|
||||
if (G_UNLIKELY (!_create_element (self, &self->post_colorspace,
|
||||
"ffmpegcolorspace", NULL, "post-colorspace", FALSE))) {
|
||||
COLORSPACE, NULL, "post-colorspace", FALSE))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -931,13 +931,13 @@ _pad_blocked_cb (GstPad * pad, gboolean blocked, gpointer user_data)
|
|||
|
||||
sink = gst_element_get_static_pad (self->post_colorspace, "sink");
|
||||
if (G_UNLIKELY (!sink)) {
|
||||
GST_WARNING_OBJECT (self, "Can't get sink pad from ffmpegcolorspace");
|
||||
GST_WARNING_OBJECT (self, "Can't get sink pad from " COLORSPACE);
|
||||
gst_object_unref (src);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (G_UNLIKELY (gst_pad_link (src, sink) != GST_PAD_LINK_OK)) {
|
||||
GST_WARNING_OBJECT (self, "Can't link overlay with ffmpegcolorspace");
|
||||
GST_WARNING_OBJECT (self, "Can't link overlay with " COLORSPACE);
|
||||
gst_object_unref (src);
|
||||
gst_object_unref (sink);
|
||||
continue;
|
||||
|
@ -946,7 +946,7 @@ _pad_blocked_cb (GstPad * pad, gboolean blocked, gpointer user_data)
|
|||
gst_object_unref (sink);
|
||||
|
||||
if (G_UNLIKELY (!_create_element (self, &self->pre_colorspace,
|
||||
"ffmpegcolorspace", NULL, "pre-colorspace", FALSE))) {
|
||||
COLORSPACE, NULL, "pre-colorspace", FALSE))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -958,13 +958,13 @@ _pad_blocked_cb (GstPad * pad, gboolean blocked, gpointer user_data)
|
|||
|
||||
src = gst_element_get_static_pad (self->pre_colorspace, "src");
|
||||
if (G_UNLIKELY (!src)) {
|
||||
GST_WARNING_OBJECT (self, "Can't get srcpad from ffmpegcolorspace");
|
||||
GST_WARNING_OBJECT (self, "Can't get srcpad from " COLORSPACE);
|
||||
gst_object_unref (sink);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (G_UNLIKELY (gst_pad_link (src, sink) != GST_PAD_LINK_OK)) {
|
||||
GST_WARNING_OBJECT (self, "Can't link ffmpegcolorspace to textoverlay");
|
||||
GST_WARNING_OBJECT (self, "Can't link " COLORSPACE " to textoverlay");
|
||||
gst_object_unref (src);
|
||||
gst_object_unref (sink);
|
||||
continue;
|
||||
|
@ -975,7 +975,7 @@ _pad_blocked_cb (GstPad * pad, gboolean blocked, gpointer user_data)
|
|||
/* Set src ghostpad target */
|
||||
src = gst_element_get_static_pad (self->post_colorspace, "src");
|
||||
if (G_UNLIKELY (!src)) {
|
||||
GST_WARNING_OBJECT (self, "Can't get src pad from ffmpegcolorspace");
|
||||
GST_WARNING_OBJECT (self, "Can't get src pad from " COLORSPACE);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -994,7 +994,7 @@ _pad_blocked_cb (GstPad * pad, gboolean blocked, gpointer user_data)
|
|||
|
||||
sink = gst_element_get_static_pad (self->pre_colorspace, "sink");
|
||||
if (G_UNLIKELY (!sink)) {
|
||||
GST_WARNING_OBJECT (self, "Can't get sink pad from ffmpegcolorspace");
|
||||
GST_WARNING_OBJECT (self, "Can't get sink pad from " COLORSPACE);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -1038,7 +1038,7 @@ _pad_blocked_cb (GstPad * pad, gboolean blocked, gpointer user_data)
|
|||
/* Set the sink ghostpad targets */
|
||||
sink = gst_element_get_static_pad (self->pre_colorspace, "sink");
|
||||
if (G_UNLIKELY (!sink)) {
|
||||
GST_WARNING_OBJECT (self, "Can't get sink pad from ffmpegcolorspace");
|
||||
GST_WARNING_OBJECT (self, "Can't get sink pad from " COLORSPACE);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -1088,7 +1088,7 @@ _pad_blocked_cb (GstPad * pad, gboolean blocked, gpointer user_data)
|
|||
|
||||
/* First link everything internally */
|
||||
if (G_UNLIKELY (!_create_element (self, &self->post_colorspace,
|
||||
"ffmpegcolorspace", NULL, "post-colorspace", FALSE))) {
|
||||
COLORSPACE, NULL, "post-colorspace", FALSE))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -1100,13 +1100,13 @@ _pad_blocked_cb (GstPad * pad, gboolean blocked, gpointer user_data)
|
|||
|
||||
sink = gst_element_get_static_pad (self->post_colorspace, "sink");
|
||||
if (G_UNLIKELY (!sink)) {
|
||||
GST_WARNING_OBJECT (self, "Can't get sink pad from ffmpegcolorspace");
|
||||
GST_WARNING_OBJECT (self, "Can't get sink pad from " COLORSPACE);
|
||||
gst_object_unref (src);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (G_UNLIKELY (gst_pad_link (src, sink) != GST_PAD_LINK_OK)) {
|
||||
GST_WARNING_OBJECT (self, "Can't link renderer with ffmpegcolorspace");
|
||||
GST_WARNING_OBJECT (self, "Can't link renderer with " COLORSPACE);
|
||||
gst_object_unref (src);
|
||||
gst_object_unref (sink);
|
||||
continue;
|
||||
|
@ -1115,7 +1115,7 @@ _pad_blocked_cb (GstPad * pad, gboolean blocked, gpointer user_data)
|
|||
gst_object_unref (sink);
|
||||
|
||||
if (G_UNLIKELY (!_create_element (self, &self->pre_colorspace,
|
||||
"ffmpegcolorspace", NULL, "pre-colorspace", FALSE))) {
|
||||
COLORSPACE, NULL, "pre-colorspace", FALSE))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -1127,13 +1127,13 @@ _pad_blocked_cb (GstPad * pad, gboolean blocked, gpointer user_data)
|
|||
|
||||
src = gst_element_get_static_pad (self->pre_colorspace, "src");
|
||||
if (G_UNLIKELY (!src)) {
|
||||
GST_WARNING_OBJECT (self, "Can't get srcpad from ffmpegcolorspace");
|
||||
GST_WARNING_OBJECT (self, "Can't get srcpad from " COLORSPACE);
|
||||
gst_object_unref (sink);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (G_UNLIKELY (gst_pad_link (src, sink) != GST_PAD_LINK_OK)) {
|
||||
GST_WARNING_OBJECT (self, "Can't link ffmpegcolorspace to renderer");
|
||||
GST_WARNING_OBJECT (self, "Can't link " COLORSPACE " to renderer");
|
||||
gst_object_unref (src);
|
||||
gst_object_unref (sink);
|
||||
continue;
|
||||
|
@ -1144,7 +1144,7 @@ _pad_blocked_cb (GstPad * pad, gboolean blocked, gpointer user_data)
|
|||
/* Set src ghostpad target */
|
||||
src = gst_element_get_static_pad (self->post_colorspace, "src");
|
||||
if (G_UNLIKELY (!src)) {
|
||||
GST_WARNING_OBJECT (self, "Can't get src pad from ffmpegcolorspace");
|
||||
GST_WARNING_OBJECT (self, "Can't get src pad from " COLORSPACE);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -1163,7 +1163,7 @@ _pad_blocked_cb (GstPad * pad, gboolean blocked, gpointer user_data)
|
|||
|
||||
sink = gst_element_get_static_pad (self->pre_colorspace, "sink");
|
||||
if (G_UNLIKELY (!sink)) {
|
||||
GST_WARNING_OBJECT (self, "Can't get sink pad from ffmpegcolorspace");
|
||||
GST_WARNING_OBJECT (self, "Can't get sink pad from " COLORSPACE);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -1205,7 +1205,7 @@ _pad_blocked_cb (GstPad * pad, gboolean blocked, gpointer user_data)
|
|||
/* Set the sink ghostpad targets */
|
||||
sink = gst_element_get_static_pad (self->pre_colorspace, "sink");
|
||||
if (G_UNLIKELY (!sink)) {
|
||||
GST_WARNING_OBJECT (self, "Can't get sink pad from ffmpegcolorspace");
|
||||
GST_WARNING_OBJECT (self, "Can't get sink pad from " COLORSPACE);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue