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:
Wind Yuan 2013-02-28 15:26:36 +08:00 committed by Gwenole Beauchesne
parent 22f4d8b768
commit a89a8cf1e3
4 changed files with 22 additions and 0 deletions

View file

@ -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;

View file

@ -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;

View file

@ -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)
{

View file

@ -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);