GstCaps *allowed_caps;
TransformSizeCache transform_size_cache[2];
GstVaapiVideoPool *images;
- GstVaapiImageFormat image_format;
+ GstVideoFormat image_format;
guint image_width;
guint image_height;
unsigned int images_reset : 1;
download->allowed_caps = NULL;
download->images = NULL;
download->images_reset = FALSE;
- download->image_format = (GstVaapiImageFormat)0;
+ download->image_format = GST_VIDEO_FORMAT_UNKNOWN;
download->image_width = 0;
download->image_height = 0;
return TRUE;
}
-static GstVaapiImageFormat
+static GstVideoFormat
get_surface_format(GstVaapiSurface *surface)
{
GstVaapiImage *image;
- GstVaapiImageFormat format = GST_VAAPI_IMAGE_NV12;
+ GstVideoFormat format = GST_VIDEO_FORMAT_NV12;
/* XXX: NV12 is assumed by default */
image = gst_vaapi_surface_derive_image(surface);
{
GstVaapiVideoMeta *meta;
GstVaapiSurface *surface;
- GstVaapiImageFormat format;
+ GstVideoFormat format;
GstPad *srcpad;
GstCaps *in_caps, *out_caps;
return FALSE;
}
- out_caps = gst_vaapi_image_format_get_caps(format);
+ out_caps = gst_video_format_to_caps(format);
if (!out_caps) {
GST_WARNING("failed to create caps from format %" GST_FOURCC_FORMAT,
GST_FOURCC_ARGS(format));
gst_vaapidownload_ensure_image_pool(GstVaapiDownload *download, GstCaps *caps)
{
GstStructure * const structure = gst_caps_get_structure(caps, 0);
- GstVaapiImageFormat format;
+ GstVideoFormat format;
gint width, height;
- format = gst_vaapi_image_format_from_caps(caps);
+ format = gst_video_format_from_caps(caps);
gst_structure_get_int(structure, "width", &width);
gst_structure_get_int(structure, "height", &height);
for (i = 0; i < n_structures; i++) {
GstStructure * const structure = gst_caps_get_structure(image_caps, i);
GstVaapiImage *image;
- GstVaapiImageFormat format;
+ GstVideoFormat format;
- format = gst_vaapi_image_format_from_structure(structure);
- if (!format)
+ format = gst_video_format_from_structure(structure);
+ if (format == GST_VIDEO_FORMAT_UNKNOWN)
continue;
image = gst_vaapi_image_new(priv->display, format, WIDTH, HEIGHT);
if (!image)
{
GstVaapiUploaderPrivate *priv;
GstVaapiImage *image;
- GstVaapiImageFormat vaformat;
+ GstVideoFormat format;
GstVideoInfo vi;
g_return_val_if_fail(GST_VAAPI_IS_UPLOADER(uploader), FALSE);
priv = uploader->priv;
priv->direct_rendering = 0;
- /* Translate from Gst video format to VA image format */
+ /* Strip out non-YUV formats */
if (!gst_video_info_from_caps(&vi, src_caps))
return FALSE;
if (!GST_VIDEO_INFO_IS_YUV(&vi))
return FALSE;
- vaformat = gst_vaapi_image_format_from_video(GST_VIDEO_INFO_FORMAT(&vi));
- if (!vaformat)
- return FALSE;
+ format = GST_VIDEO_INFO_FORMAT(&vi);
/* Check if we can alias source and output buffers (same data_size) */
image = gst_vaapi_video_pool_get_object(priv->images);
if (image) {
- if (gst_vaapi_image_get_format(image) == vaformat &&
+ if (gst_vaapi_image_get_format(image) == format &&
gst_vaapi_image_is_linear(image) &&
gst_vaapi_image_get_data_size(image) == GST_VIDEO_INFO_SIZE(&vi))
priv->direct_rendering = 1;
static GstVaapiImage *
new_image(GstVaapiDisplay *display, const GstVideoInfo *vip)
{
- GstVaapiImageFormat format;
-
- format = gst_vaapi_image_format_from_video(GST_VIDEO_INFO_FORMAT(vip));
- if (!format)
- return NULL;
-
- return gst_vaapi_image_new(display, format,
+ return gst_vaapi_image_new(display, GST_VIDEO_INFO_FORMAT(vip),
GST_VIDEO_INFO_WIDTH(vip), GST_VIDEO_INFO_HEIGHT(vip));
}