mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
image: allow updates from GstVaapiImageRaw.
This commit is contained in:
parent
9337fb9a74
commit
efcdec08fb
2 changed files with 44 additions and 0 deletions
|
@ -1175,3 +1175,40 @@ gst_vaapi_image_update_from_buffer(
|
||||||
|
|
||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gst_vaapi_image_update_from_raw:
|
||||||
|
* @image: a #GstVaapiImage
|
||||||
|
* @src_image: a #GstVaapiImageRaw
|
||||||
|
* @buffer: a #GstBuffer
|
||||||
|
* @rect: a #GstVaapiRectangle expressing a region, or %NULL for the
|
||||||
|
* whole image
|
||||||
|
*
|
||||||
|
* Transfers pixels data contained in the #GstVaapiImageRaw into the
|
||||||
|
* @image. Both image structures shall have the same format.
|
||||||
|
*
|
||||||
|
* Return value: %TRUE on success
|
||||||
|
*/
|
||||||
|
gboolean
|
||||||
|
gst_vaapi_image_update_from_raw(
|
||||||
|
GstVaapiImage *image,
|
||||||
|
GstVaapiImageRaw *src_image,
|
||||||
|
GstVaapiRectangle *rect
|
||||||
|
)
|
||||||
|
{
|
||||||
|
GstVaapiImageRaw dst_image;
|
||||||
|
gboolean success;
|
||||||
|
|
||||||
|
g_return_val_if_fail(GST_VAAPI_IS_IMAGE(image), FALSE);
|
||||||
|
g_return_val_if_fail(image->priv->is_constructed, FALSE);
|
||||||
|
|
||||||
|
if (!_gst_vaapi_image_map(image, &dst_image))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
success = copy_image(&dst_image, src_image, rect);
|
||||||
|
|
||||||
|
if (!_gst_vaapi_image_unmap(image))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
return success;
|
||||||
|
}
|
||||||
|
|
|
@ -182,6 +182,13 @@ gst_vaapi_image_update_from_buffer(
|
||||||
GstVaapiRectangle *rect
|
GstVaapiRectangle *rect
|
||||||
);
|
);
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
gst_vaapi_image_update_from_raw(
|
||||||
|
GstVaapiImage *image,
|
||||||
|
GstVaapiImageRaw *src_image,
|
||||||
|
GstVaapiRectangle *rect
|
||||||
|
);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
#endif /* GST_VAAPI_IMAGE_H */
|
#endif /* GST_VAAPI_IMAGE_H */
|
||||||
|
|
Loading…
Reference in a new issue