gloverlay: Fix various issues in allocation handling
* A copy-paste error was getting the information from the wrong query * The 'allocation_meta' GstStructure was being leaked * No check was done on whether the query existed (to try to set the resulting allocation meta on) CID: 1439872 CID: 1439873 CID: 1439874 CID: 1439875 CID: 1439876 CID: 1439877
This commit is contained in:
parent
51253830f3
commit
0200175d97
@ -188,7 +188,7 @@ gst_gl_overlay_compositor_element_propose_allocation (GstBaseTransform * trans,
|
|||||||
decide_query, query))
|
decide_query, query))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if ((width == 0 || height == 0) && decide_query) {
|
if (decide_query) {
|
||||||
GstCaps *decide_caps;
|
GstCaps *decide_caps;
|
||||||
gst_query_parse_allocation (decide_query, &decide_caps, NULL);
|
gst_query_parse_allocation (decide_query, &decide_caps, NULL);
|
||||||
|
|
||||||
@ -204,7 +204,7 @@ gst_gl_overlay_compositor_element_propose_allocation (GstBaseTransform * trans,
|
|||||||
|
|
||||||
if ((width == 0 || height == 0) && query) {
|
if ((width == 0 || height == 0) && query) {
|
||||||
GstCaps *caps;
|
GstCaps *caps;
|
||||||
gst_query_parse_allocation (decide_query, &caps, NULL);
|
gst_query_parse_allocation (query, &caps, NULL);
|
||||||
|
|
||||||
if (caps) {
|
if (caps) {
|
||||||
GstVideoInfo vinfo;
|
GstVideoInfo vinfo;
|
||||||
@ -224,9 +224,12 @@ gst_gl_overlay_compositor_element_propose_allocation (GstBaseTransform * trans,
|
|||||||
|
|
||||||
GST_DEBUG_OBJECT (trans, "Adding overlay composition meta with size %ux%u",
|
GST_DEBUG_OBJECT (trans, "Adding overlay composition meta with size %ux%u",
|
||||||
width, height);
|
width, height);
|
||||||
|
if (allocation_meta) {
|
||||||
|
if (query)
|
||||||
gst_query_add_allocation_meta (query,
|
gst_query_add_allocation_meta (query,
|
||||||
GST_VIDEO_OVERLAY_COMPOSITION_META_API_TYPE, allocation_meta);
|
GST_VIDEO_OVERLAY_COMPOSITION_META_API_TYPE, allocation_meta);
|
||||||
|
gst_structure_free (allocation_meta);
|
||||||
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user