mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-29 15:22:11 +02:00
plugin: Add helper to get the actual width and height for a specific rotation
Signed-off-by: Eugenio Paolantonio (g7) <me@medesimo.eu>
This commit is contained in:
@@ -140,3 +140,23 @@ gst_video_frame_into_gdk_texture (GstVideoFrame *frame)
|
||||
|
||||
return texture;
|
||||
}
|
||||
|
||||
void
|
||||
gst_gtk_get_width_height_for_rotation (gint width, gint height,
|
||||
gint *out_width, gint *out_height,
|
||||
GstVideoOrientationMethod rotation)
|
||||
{
|
||||
switch (rotation) {
|
||||
case GST_VIDEO_ORIENTATION_90R:
|
||||
case GST_VIDEO_ORIENTATION_90L:
|
||||
case GST_VIDEO_ORIENTATION_UL_LR:
|
||||
case GST_VIDEO_ORIENTATION_UR_LL:
|
||||
*out_width = height;
|
||||
*out_height = width;
|
||||
break;
|
||||
default:
|
||||
*out_width = width;
|
||||
*out_height = height;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@@ -32,4 +32,8 @@ gpointer gst_gtk_invoke_on_main (GThreadFunc func, gpointe
|
||||
|
||||
GdkTexture * gst_video_frame_into_gdk_texture (GstVideoFrame *frame);
|
||||
|
||||
void gst_gtk_get_width_height_for_rotation (gint width, gint height,
|
||||
gint *out_width, gint *out_height,
|
||||
GstVideoOrientationMethod rotation);
|
||||
|
||||
G_END_DECLS
|
||||
|
Reference in New Issue
Block a user