gl: add convenience function for the start of a video frame
Get's the start of the video frame based on a GstVideoInfo and GstVideoAlignment.
This commit is contained in:
parent
3591c6bfa0
commit
51636b451c
@ -904,6 +904,25 @@ gst_gl_get_plane_data_size (GstVideoInfo * info, GstVideoAlignment * align,
|
|||||||
return plane_size;
|
return plane_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* find the difference between the start of the plane and where the video
|
||||||
|
* data starts in the plane */
|
||||||
|
gsize
|
||||||
|
gst_gl_get_plane_start (GstVideoInfo * info, GstVideoAlignment * valign,
|
||||||
|
guint plane)
|
||||||
|
{
|
||||||
|
gsize plane_start;
|
||||||
|
gint i;
|
||||||
|
|
||||||
|
/* find the start of the plane data including padding */
|
||||||
|
plane_start = 0;
|
||||||
|
for (i = 0; i < plane; i++) {
|
||||||
|
plane_start += gst_gl_get_plane_data_size (info, valign, i);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* offset between the plane data start and where the video frame starts */
|
||||||
|
return (GST_VIDEO_INFO_PLANE_OFFSET (info, plane)) - plane_start;
|
||||||
|
}
|
||||||
|
|
||||||
GstCaps *
|
GstCaps *
|
||||||
gst_gl_caps_replace_all_caps_features (const GstCaps * caps,
|
gst_gl_caps_replace_all_caps_features (const GstCaps * caps,
|
||||||
const gchar * feature_name)
|
const gchar * feature_name)
|
||||||
|
@ -106,6 +106,8 @@ gboolean gst_gl_run_query (GstElement * element,
|
|||||||
GstQuery * query, GstPadDirection direction);
|
GstQuery * query, GstPadDirection direction);
|
||||||
gsize gst_gl_get_plane_data_size (GstVideoInfo * info, GstVideoAlignment * align,
|
gsize gst_gl_get_plane_data_size (GstVideoInfo * info, GstVideoAlignment * align,
|
||||||
guint plane);
|
guint plane);
|
||||||
|
gsize gst_gl_get_plane_start (GstVideoInfo * info, GstVideoAlignment * valign,
|
||||||
|
guint plane);
|
||||||
GstCaps * gst_gl_caps_replace_all_caps_features (const GstCaps * caps,
|
GstCaps * gst_gl_caps_replace_all_caps_features (const GstCaps * caps,
|
||||||
const gchar * feature_name);
|
const gchar * feature_name);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user