mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
decoder: allocate proxy surface earlier.
This simplifies gst_vaapi_picture_output() to only update the presentation timestamp and submit the proxy to the decoder for output.
This commit is contained in:
parent
399875ee86
commit
fe791efc28
1 changed files with 9 additions and 11 deletions
|
@ -99,6 +99,11 @@ gst_vaapi_picture_create(
|
||||||
return FALSE;
|
return FALSE;
|
||||||
picture->surface_id = gst_vaapi_surface_get_id(picture->surface);
|
picture->surface_id = gst_vaapi_surface_get_id(picture->surface);
|
||||||
|
|
||||||
|
picture->proxy =
|
||||||
|
gst_vaapi_surface_proxy_new(GET_CONTEXT(picture), picture->surface);
|
||||||
|
if (!picture->proxy)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
success = vaapi_create_buffer(
|
success = vaapi_create_buffer(
|
||||||
GET_VA_DISPLAY(picture),
|
GET_VA_DISPLAY(picture),
|
||||||
GET_VA_CONTEXT(picture),
|
GET_VA_CONTEXT(picture),
|
||||||
|
@ -240,19 +245,12 @@ gst_vaapi_picture_output(GstVaapiPicture *picture)
|
||||||
|
|
||||||
g_return_val_if_fail(GST_VAAPI_IS_PICTURE(picture), FALSE);
|
g_return_val_if_fail(GST_VAAPI_IS_PICTURE(picture), FALSE);
|
||||||
|
|
||||||
proxy = picture->proxy;
|
if (!picture->proxy)
|
||||||
if (!proxy) {
|
return FALSE;
|
||||||
proxy = gst_vaapi_surface_proxy_new(
|
|
||||||
GET_CONTEXT(picture),
|
|
||||||
picture->surface
|
|
||||||
);
|
|
||||||
if (!proxy)
|
|
||||||
return FALSE;
|
|
||||||
picture->proxy = proxy;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
proxy = g_object_ref(picture->proxy);
|
||||||
gst_vaapi_surface_proxy_set_timestamp(proxy, picture->pts);
|
gst_vaapi_surface_proxy_set_timestamp(proxy, picture->pts);
|
||||||
gst_vaapi_decoder_push_surface_proxy(GET_DECODER(picture), g_object_ref(proxy));
|
gst_vaapi_decoder_push_surface_proxy(GET_DECODER(picture), proxy);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue