diff options
author | Colin Kinloch <colin.kinloch@collabora.com> | 2022-09-19 20:06:44 +0300 |
---|---|---|
committer | GStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org> | 2022-11-11 09:45:48 +0300 |
commit | d7aba915187c230e75ebe423eccb1bf1e49a75b2 (patch) | |
tree | 39cd12959ab7172acc48ee1c9ca7add004eb734d | |
parent | d54e5972786cc4cbcdd4d632c1366737dd7fe777 (diff) |
videoflip: Use gst_video_orientation_from_tag to parse orientation
Signed-off-by: Colin Kinloch <colin.kinloch@collabora.com>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3053>
-rw-r--r-- | subprojects/gst-plugins-good/gst/videofilter/gstvideoflip.c | 23 |
1 files changed, 3 insertions, 20 deletions
diff --git a/subprojects/gst-plugins-good/gst/videofilter/gstvideoflip.c b/subprojects/gst-plugins-good/gst/videofilter/gstvideoflip.c index 69d9a5e43e..07db89969d 100644 --- a/subprojects/gst-plugins-good/gst/videofilter/gstvideoflip.c +++ b/subprojects/gst-plugins-good/gst/videofilter/gstvideoflip.c @@ -1777,7 +1777,7 @@ gst_video_flip_sink_event (GstBaseTransform * trans, GstEvent * event) { GstVideoFlip *vf = GST_VIDEO_FLIP (trans); GstTagList *taglist; - gchar *orientation; + GstVideoOrientationMethod method; gboolean ret; GST_DEBUG_OBJECT (vf, "handling %s event", GST_EVENT_TYPE_NAME (event)); @@ -1786,25 +1786,8 @@ gst_video_flip_sink_event (GstBaseTransform * trans, GstEvent * event) case GST_EVENT_TAG: gst_event_parse_tag (event, &taglist); - if (gst_tag_list_get_string (taglist, "image-orientation", &orientation)) { - if (!g_strcmp0 ("rotate-0", orientation)) - gst_video_flip_set_method (vf, GST_VIDEO_ORIENTATION_IDENTITY, TRUE); - else if (!g_strcmp0 ("rotate-90", orientation)) - gst_video_flip_set_method (vf, GST_VIDEO_ORIENTATION_90R, TRUE); - else if (!g_strcmp0 ("rotate-180", orientation)) - gst_video_flip_set_method (vf, GST_VIDEO_ORIENTATION_180, TRUE); - else if (!g_strcmp0 ("rotate-270", orientation)) - gst_video_flip_set_method (vf, GST_VIDEO_ORIENTATION_90L, TRUE); - else if (!g_strcmp0 ("flip-rotate-0", orientation)) - gst_video_flip_set_method (vf, GST_VIDEO_ORIENTATION_HORIZ, TRUE); - else if (!g_strcmp0 ("flip-rotate-90", orientation)) - gst_video_flip_set_method (vf, GST_VIDEO_ORIENTATION_UL_LR, TRUE); - else if (!g_strcmp0 ("flip-rotate-180", orientation)) - gst_video_flip_set_method (vf, GST_VIDEO_ORIENTATION_VERT, TRUE); - else if (!g_strcmp0 ("flip-rotate-270", orientation)) - gst_video_flip_set_method (vf, GST_VIDEO_ORIENTATION_UR_LL, TRUE); - - g_free (orientation); + if (gst_video_orientation_from_tag (taglist, &method)) { + gst_video_flip_set_method (vf, method, TRUE); } break; default: |