From b4ca5f386a7d9ea1ab1522228490830503c77bb8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Olivier=20Cr=C3=AAte?= Date: Tue, 4 May 2021 15:51:36 -0400 Subject: [PATCH] glvideoflip: Use the API to parse the image orientation This will reduce the code duplication a little. Part-of: --- .../gst-plugins-base/ext/gl/gstglvideoflip.c | 29 +++------------------- 1 file changed, 3 insertions(+), 26 deletions(-) diff --git a/subprojects/gst-plugins-base/ext/gl/gstglvideoflip.c b/subprojects/gst-plugins-base/ext/gl/gstglvideoflip.c index 5ace518..252a847 100644 --- a/subprojects/gst-plugins-base/ext/gl/gstglvideoflip.c +++ b/subprojects/gst-plugins-base/ext/gl/gstglvideoflip.c @@ -433,35 +433,12 @@ _input_sink_probe (GstPad * pad, GstPadProbeInfo * info, gpointer user_data) switch (GST_EVENT_TYPE (event)) { case GST_EVENT_TAG:{ GstTagList *taglist; - gchar *orientation; + GstVideoOrientationMethod method; gst_event_parse_tag (event, &taglist); - if (gst_tag_list_get_string (taglist, "image-orientation", - &orientation)) { - if (!g_strcmp0 ("rotate-0", orientation)) - gst_gl_video_flip_set_method (vf, GST_VIDEO_ORIENTATION_IDENTITY, - TRUE); - else if (!g_strcmp0 ("rotate-90", orientation)) - gst_gl_video_flip_set_method (vf, GST_VIDEO_ORIENTATION_90R, TRUE); - else if (!g_strcmp0 ("rotate-180", orientation)) - gst_gl_video_flip_set_method (vf, GST_VIDEO_ORIENTATION_180, TRUE); - else if (!g_strcmp0 ("rotate-270", orientation)) - gst_gl_video_flip_set_method (vf, GST_VIDEO_ORIENTATION_90L, TRUE); - else if (!g_strcmp0 ("flip-rotate-0", orientation)) - gst_gl_video_flip_set_method (vf, - GST_VIDEO_ORIENTATION_HORIZ, TRUE); - else if (!g_strcmp0 ("flip-rotate-90", orientation)) - gst_gl_video_flip_set_method (vf, - GST_VIDEO_ORIENTATION_UR_LL, TRUE); - else if (!g_strcmp0 ("flip-rotate-180", orientation)) - gst_gl_video_flip_set_method (vf, GST_VIDEO_ORIENTATION_VERT, TRUE); - else if (!g_strcmp0 ("flip-rotate-270", orientation)) - gst_gl_video_flip_set_method (vf, - GST_VIDEO_ORIENTATION_UL_LR, TRUE); - - g_free (orientation); - } + if (gst_video_orientation_from_tag (taglist, &method)) + gst_gl_video_flip_set_method (vf, method, TRUE); break; } case GST_EVENT_CAPS:{ -- 2.7.4