videoflip: update orientation tag in auto mode
authorGuillaume Desmottes <guillaume.desmottes@onestream.live>
Tue, 6 Jun 2023 09:34:03 +0000 (11:34 +0200)
committerGuillaume Desmottes <guillaume.desmottes@onestream.live>
Thu, 22 Jun 2023 12:06:33 +0000 (14:06 +0200)
The frames are flipped according to the tag orientation so it's no longer accurate.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4796>

subprojects/gst-plugins-good/gst/videofilter/gstvideoflip.c

index 688fe67..003a79e 100644 (file)
@@ -1788,6 +1788,12 @@ gst_video_flip_sink_event (GstBaseTransform * trans, GstEvent * event)
 
       if (gst_video_orientation_from_tag (taglist, &method)) {
         gst_video_flip_set_method (vf, method, TRUE);
+
+        if (vf->method == GST_VIDEO_ORIENTATION_AUTO) {
+          /* update the orientation tag as we rotate the video accordingly */
+          gst_tag_list_add (taglist, GST_TAG_MERGE_REPLACE, "image-orientation",
+              "rotate-0", NULL);
+        }
       }
       break;
     default: