diff options
author | Colin Kinloch <colin.kinloch@collabora.com> | 2022-09-19 20:05:28 +0300 |
---|---|---|
committer | GStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org> | 2022-11-11 09:45:48 +0300 |
commit | d54e5972786cc4cbcdd4d632c1366737dd7fe777 (patch) | |
tree | 205302ae85bf527845b9bca96614825f262b273d | |
parent | ef4fc111937f6bb253919c376eae1dd2f522e44b (diff) |
va: 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-bad/sys/va/gstvavpp.c | 30 |
1 files changed, 6 insertions, 24 deletions
diff --git a/subprojects/gst-plugins-bad/sys/va/gstvavpp.c b/subprojects/gst-plugins-bad/sys/va/gstvavpp.c index 767ea4aa27..a081c03498 100644 --- a/subprojects/gst-plugins-bad/sys/va/gstvavpp.c +++ b/subprojects/gst-plugins-bad/sys/va/gstvavpp.c @@ -1954,11 +1954,11 @@ gst_va_vpp_src_event (GstBaseTransform * trans, GstEvent * event) new_x = GST_VIDEO_INFO_HEIGHT (in_info) - 1 - y; new_y = x; break; - case GST_VIDEO_ORIENTATION_UR_LL: + case GST_VIDEO_ORIENTATION_UL_LR: new_x = GST_VIDEO_INFO_HEIGHT (in_info) - 1 - y; new_y = GST_VIDEO_INFO_WIDTH (in_info) - 1 - x; break; - case GST_VIDEO_ORIENTATION_UL_LR: + case GST_VIDEO_ORIENTATION_UR_LL: new_x = y; new_y = x; break; @@ -2006,38 +2006,20 @@ gst_va_vpp_sink_event (GstBaseTransform * trans, GstEvent * event) { GstVaVpp *self = GST_VA_VPP (trans); GstTagList *taglist; - gchar *orientation; + GstVideoOrientationMethod method; switch (GST_EVENT_TYPE (event)) { case GST_EVENT_TAG: gst_event_parse_tag (event, &taglist); - if (!gst_tag_list_get_string (taglist, "image-orientation", &orientation)) - break; - if (self->direction != GST_VIDEO_ORIENTATION_AUTO) break; - GST_DEBUG_OBJECT (self, "tag orientation %s", orientation); + if (!gst_video_orientation_from_tag (taglist, &method)) + break; GST_OBJECT_LOCK (self); - if (!g_strcmp0 ("rotate-0", orientation)) - self->tag_direction = GST_VIDEO_ORIENTATION_IDENTITY; - else if (!g_strcmp0 ("rotate-90", orientation)) - self->tag_direction = GST_VIDEO_ORIENTATION_90R; - else if (!g_strcmp0 ("rotate-180", orientation)) - self->tag_direction = GST_VIDEO_ORIENTATION_180; - else if (!g_strcmp0 ("rotate-270", orientation)) - self->tag_direction = GST_VIDEO_ORIENTATION_90L; - else if (!g_strcmp0 ("flip-rotate-0", orientation)) - self->tag_direction = GST_VIDEO_ORIENTATION_HORIZ; - else if (!g_strcmp0 ("flip-rotate-90", orientation)) - self->tag_direction = GST_VIDEO_ORIENTATION_UL_LR; - else if (!g_strcmp0 ("flip-rotate-180", orientation)) - self->tag_direction = GST_VIDEO_ORIENTATION_VERT; - else if (!g_strcmp0 ("flip-rotate-270", orientation)) - self->tag_direction = GST_VIDEO_ORIENTATION_UR_LL; - + self->tag_direction = method; _update_properties_unlocked (self); GST_OBJECT_UNLOCK (self); |