Skip to content

Instantly share code, notes, and snippets.

@DuBistKomisch
Created December 6, 2017 09:25
Show Gist options
  • Save DuBistKomisch/0427e88b1ec9eddbd264ec52eace2f84 to your computer and use it in GitHub Desktop.
Save DuBistKomisch/0427e88b1ec9eddbd264ec52eace2f84 to your computer and use it in GitHub Desktop.
patch to make imx subtitles work with playbin
diff --git a/gst/playback/Makefile.am b/gst/playback/Makefile.am
index 9603dab..d339785 100644
--- a/gst/playback/Makefile.am
+++ b/gst/playback/Makefile.am
@@ -1,6 +1,6 @@
plugin_LTLIBRARIES = libgstplayback.la
-csp_cflags = -DCOLORSPACE=\"videoconvert\"
+csp_cflags = -DCOLORSPACE=\"imxipuvideotransform\"
libgstplayback_la_SOURCES = \
gstdecodebin2.c \
diff --git a/gst/playback/gstplaysink.c b/gst/playback/gstplaysink.c
index ead2e68..29307d4 100644
--- a/gst/playback/gstplaysink.c
+++ b/gst/playback/gstplaysink.c
@@ -1849,12 +1849,12 @@ gen_video_chain (GstPlaySink * playsink, gboolean raw, gboolean async)
} else {
GST_DEBUG_OBJECT (playsink, "adding video filter");
chain->filter_conv =
- gst_element_factory_make ("videoconvert", "filter-convert");
+ gst_element_factory_make (COLORSPACE, "filter-convert");
if (!chain->filter_conv) {
- post_missing_element_message (playsink, "videoconvert");
+ post_missing_element_message (playsink, COLORSPACE);
GST_ELEMENT_WARNING (playsink, CORE, MISSING_PLUGIN,
(_("Missing element '%s' - check your GStreamer installation."),
- "videoconvert"),
+ COLORSPACE),
("video playback and visualizations might not work"));
} else {
gst_bin_add (bin, chain->filter_conv);
@@ -1924,9 +1924,7 @@ gen_video_chain (GstPlaySink * playsink, gboolean raw, gboolean async)
&& (playsink->flags & GST_PLAY_FLAG_SOFT_COLORBALANCE);
GST_DEBUG_OBJECT (playsink, "creating videoconverter");
- chain->conv =
- g_object_new (GST_TYPE_PLAY_SINK_VIDEO_CONVERT, "name", "vconv",
- "use-converters", use_converters, "use-balance", use_balance, NULL);
+ chain->conv = gst_element_factory_make(COLORSPACE, "vconv");
GST_OBJECT_LOCK (playsink);
if (use_balance && GST_PLAY_SINK_VIDEO_CONVERT (chain->conv)->balance) {
diff --git a/gst/playback/gstsubtitleoverlay.c b/gst/playback/gstsubtitleoverlay.c
index 6134330..3da6c0a 100644
--- a/gst/playback/gstsubtitleoverlay.c
+++ b/gst/playback/gstsubtitleoverlay.c
@@ -211,7 +211,7 @@ _is_renderer (GstElementFactory * factory)
if (strstr (klass, "Overlay/Subtitle") != NULL ||
strstr (klass, "Overlay/SubPicture") != NULL)
return TRUE;
- if (strcmp (name, "textoverlay") == 0)
+ if (strcmp (name, "imxg2dtextoverlay") == 0)
return TRUE;
}
return FALSE;
@@ -329,10 +329,10 @@ _factory_filter (GstPluginFeature * feature, GstCaps ** subcaps)
factory = GST_ELEMENT_FACTORY_CAST (feature);
- /* only select elements with autoplugging rank or textoverlay */
+ /* only select elements with autoplugging rank or imxg2dtextoverlay */
name = gst_plugin_feature_get_name (feature);
rank = gst_plugin_feature_get_rank (feature);
- if (strcmp ("textoverlay", name) != 0 && rank < GST_RANK_MARGINAL)
+ if (strcmp ("imxg2dtextoverlay", name) != 0 && rank < GST_RANK_MARGINAL)
return FALSE;
/* Check if it's a renderer or a parser */
@@ -793,8 +793,8 @@ _setup_renderer (GstSubtitleOverlay * self, GstElement * renderer)
const gchar *name =
gst_plugin_feature_get_name (GST_PLUGIN_FEATURE_CAST (factory));
- if (strcmp (name, "textoverlay") == 0) {
- /* Set some textoverlay specific properties */
+ if (strcmp (name, "imxg2dtextoverlay") == 0) {
+ /* Set some imxg2dtextoverlay specific properties */
gst_util_set_object_arg (G_OBJECT (renderer), "halignment", "center");
gst_util_set_object_arg (G_OBJECT (renderer), "valignment", "bottom");
g_object_set (G_OBJECT (renderer), "wait-text", FALSE, NULL);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment