mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-31 20:48:56 +00:00
glimagesink: Use the API to parse the image orientation
This will reduce the code duplication a little. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1088>
This commit is contained in:
parent
c898ffceeb
commit
d191e27aca
1 changed files with 3 additions and 28 deletions
|
@ -1114,7 +1114,7 @@ gst_glimage_sink_event (GstBaseSink * sink, GstEvent * event)
|
|||
{
|
||||
GstGLImageSink *gl_sink = GST_GLIMAGE_SINK (sink);
|
||||
GstTagList *taglist;
|
||||
gchar *orientation;
|
||||
GstVideoOrientationMethod method;
|
||||
gboolean ret;
|
||||
|
||||
GST_DEBUG_OBJECT (gl_sink, "handling %s event", GST_EVENT_TYPE_NAME (event));
|
||||
|
@ -1123,34 +1123,9 @@ gst_glimage_sink_event (GstBaseSink * sink, 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_glimage_sink_set_rotate_method (gl_sink,
|
||||
GST_VIDEO_ORIENTATION_IDENTITY, TRUE);
|
||||
else if (!g_strcmp0 ("rotate-90", orientation))
|
||||
gst_glimage_sink_set_rotate_method (gl_sink,
|
||||
GST_VIDEO_ORIENTATION_90R, TRUE);
|
||||
else if (!g_strcmp0 ("rotate-180", orientation))
|
||||
gst_glimage_sink_set_rotate_method (gl_sink,
|
||||
GST_VIDEO_ORIENTATION_180, TRUE);
|
||||
else if (!g_strcmp0 ("rotate-270", orientation))
|
||||
gst_glimage_sink_set_rotate_method (gl_sink,
|
||||
GST_VIDEO_ORIENTATION_90L, TRUE);
|
||||
else if (!g_strcmp0 ("flip-rotate-0", orientation))
|
||||
gst_glimage_sink_set_rotate_method (gl_sink,
|
||||
GST_VIDEO_ORIENTATION_HORIZ, TRUE);
|
||||
else if (!g_strcmp0 ("flip-rotate-90", orientation))
|
||||
gst_glimage_sink_set_rotate_method (gl_sink,
|
||||
GST_VIDEO_ORIENTATION_UR_LL, TRUE);
|
||||
else if (!g_strcmp0 ("flip-rotate-180", orientation))
|
||||
gst_glimage_sink_set_rotate_method (gl_sink,
|
||||
GST_VIDEO_ORIENTATION_VERT, TRUE);
|
||||
else if (!g_strcmp0 ("flip-rotate-270", orientation))
|
||||
gst_glimage_sink_set_rotate_method (gl_sink,
|
||||
GST_VIDEO_ORIENTATION_UL_LR, TRUE);
|
||||
if (gst_video_orientation_from_tag (taglist, &method))
|
||||
gst_glimage_sink_set_rotate_method (gl_sink, method, TRUE);
|
||||
|
||||
g_free (orientation);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue