mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 09:10:36 +00:00
decoder: add utility function to clone picture objects.
https://bugzilla.gnome.org/show_bug.cgi?id=703921 Signed-off-by: Wind Yuan <feng.yuan@intel.com> [added cosmetic changes, fixed propagation of "one-field" flag to children, fixed per-codec clone modes (h264)] Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
This commit is contained in:
parent
22f4d8b768
commit
a89a8cf1e3
4 changed files with 22 additions and 0 deletions
|
@ -238,6 +238,7 @@ gst_vaapi_picture_h264_create(
|
|||
if (!gst_vaapi_picture_create(GST_VAAPI_PICTURE(picture), args))
|
||||
return FALSE;
|
||||
|
||||
picture->structure = picture->base.structure;
|
||||
picture->field_poc[0] = G_MAXINT32;
|
||||
picture->field_poc[1] = G_MAXINT32;
|
||||
picture->output_needed = FALSE;
|
||||
|
|
|
@ -244,6 +244,7 @@ gst_vaapi_picture_h265_create (GstVaapiPictureH265 * picture,
|
|||
if (!gst_vaapi_picture_create (GST_VAAPI_PICTURE (picture), args))
|
||||
return FALSE;
|
||||
|
||||
picture->structure = picture->base.structure;
|
||||
picture->poc = G_MAXINT32;
|
||||
picture->output_needed = FALSE;
|
||||
return TRUE;
|
||||
|
|
|
@ -114,6 +114,7 @@ gst_vaapi_picture_create (GstVaapiPicture * picture,
|
|||
GST_VAAPI_PICTURE_FLAG_REFERENCE |
|
||||
GST_VAAPI_PICTURE_FLAG_INTERLACED |
|
||||
GST_VAAPI_PICTURE_FLAG_FF | GST_VAAPI_PICTURE_FLAG_TFF |
|
||||
GST_VAAPI_PICTURE_FLAG_ONEFIELD |
|
||||
GST_VAAPI_PICTURE_FLAG_RFF | GST_VAAPI_PICTURE_FLAG_MVC));
|
||||
|
||||
picture->structure = parent_picture->structure;
|
||||
|
@ -196,6 +197,21 @@ gst_vaapi_picture_new_field (GstVaapiPicture * picture)
|
|||
return GST_VAAPI_PICTURE_CAST (object);
|
||||
}
|
||||
|
||||
GstVaapiPicture *
|
||||
gst_vaapi_picture_new_clone (GstVaapiPicture * picture)
|
||||
{
|
||||
GstVaapiDecoder *const decoder = GET_DECODER (picture);
|
||||
GstVaapiCodecObject *object;
|
||||
|
||||
object = gst_vaapi_codec_object_new (gst_vaapi_codec_object_get_class
|
||||
(&picture->parent_instance), GST_VAAPI_CODEC_BASE (decoder), NULL,
|
||||
picture->param_size, picture, 0,
|
||||
GST_VAAPI_CREATE_PICTURE_FLAG_CLONE);
|
||||
if (!object)
|
||||
return NULL;
|
||||
return GST_VAAPI_PICTURE_CAST (object);
|
||||
}
|
||||
|
||||
void
|
||||
gst_vaapi_picture_add_slice (GstVaapiPicture * picture, GstVaapiSlice * slice)
|
||||
{
|
||||
|
|
|
@ -178,6 +178,10 @@ G_GNUC_INTERNAL
|
|||
GstVaapiPicture *
|
||||
gst_vaapi_picture_new_field (GstVaapiPicture * picture);
|
||||
|
||||
G_GNUC_INTERNAL
|
||||
GstVaapiPicture *
|
||||
gst_vaapi_picture_new_clone (GstVaapiPicture * picture);
|
||||
|
||||
G_GNUC_INTERNAL
|
||||
void
|
||||
gst_vaapi_picture_add_slice (GstVaapiPicture * picture, GstVaapiSlice * slice);
|
||||
|
|
Loading…
Reference in a new issue