PIPE_VIDEO_ENTRYPOINT_UNKNOWN,
PIPE_VIDEO_CAP_PREFERED_FORMAT
);
- templ.chroma_format = PIPE_VIDEO_CHROMA_FORMAT_420;
templ.width = video_width;
templ.height = video_height;
templ.interlaced = true;
struct pipe_video_buffer *bufs[] = { prevprev, prev, cur, next };
for (i = 0; i < 4; i++) {
- if (bufs[i]->chroma_format != PIPE_VIDEO_CHROMA_FORMAT_420)
+ if (pipe_format_to_chroma_format(bufs[i]->buffer_format) != PIPE_VIDEO_CHROMA_FORMAT_420)
return false;
if (bufs[i]->width < filter->video_width ||
bufs[i]->height < filter->video_height)
nr_of_idct_render_targets = 1;
formats[0] = formats[1] = formats[2] = format_config->idct_source_format;
+ assert(pipe_format_to_chroma_format(formats[0]) == dec->base.chroma_format);
memset(&templat, 0, sizeof(templat));
templat.width = dec->base.width / 4;
templat.height = dec->base.height;
- templat.chroma_format = dec->base.chroma_format;
dec->idct_source = vl_video_buffer_create_ex
(
dec->context, &templat,
goto error_idct_source;
formats[0] = formats[1] = formats[2] = format_config->mc_source_format;
+ assert(pipe_format_to_chroma_format(formats[0]) == dec->base.chroma_format);
memset(&templat, 0, sizeof(templat));
templat.width = dec->base.width / nr_of_idct_render_targets;
templat.height = dec->base.height / 4;
- templat.chroma_format = dec->base.chroma_format;
dec->mc_source = vl_video_buffer_create_ex
(
dec->context, &templat,
struct pipe_video_buffer templat;
formats[0] = formats[1] = formats[2] = format_config->mc_source_format;
+ assert(pipe_format_to_chroma_format(formats[0]) == dec->base.chroma_format);
memset(&templat, 0, sizeof(templat));
templat.width = dec->base.width;
templat.height = dec->base.height;
- templat.chroma_format = dec->base.chroma_format;
dec->mc_source = vl_video_buffer_create_ex
(
dec->context, &templat,
templ->usage = usage;
vl_video_buffer_adjust_size(&templ->width0, &height, plane,
- tmpl->chroma_format, false);
+ pipe_format_to_chroma_format(tmpl->buffer_format), false);
templ->height0 = height;
}
screen->device->chipset < 0x40)
return vl_video_buffer_create(pipe, templat);
- assert(templat->chroma_format == PIPE_VIDEO_CHROMA_FORMAT_420);
+ assert(pipe_format_to_chroma_format(templat->buffer_format) == PIPE_VIDEO_CHROMA_FORMAT_420);
width = align(templat->width, 64);
height = align(templat->height, 64);
buffer->base.get_sampler_view_planes = nouveau_video_buffer_sampler_view_planes;
buffer->base.get_sampler_view_components = nouveau_video_buffer_sampler_view_components;
buffer->base.get_surfaces = nouveau_video_buffer_surfaces;
- buffer->base.chroma_format = templat->chroma_format;
buffer->base.buffer_format = templat->buffer_format;
buffer->base.width = width;
buffer->base.height = height;
return vl_video_buffer_create(pipe, templat);
assert(templat->interlaced);
- assert(templat->chroma_format == PIPE_VIDEO_CHROMA_FORMAT_420);
+ assert(pipe_format_to_chroma_format(templat->buffer_format) == PIPE_VIDEO_CHROMA_FORMAT_420);
buffer = CALLOC_STRUCT(nouveau_vp3_video_buffer);
if (!buffer)
buffer->base.buffer_format = templat->buffer_format;
buffer->base.context = pipe;
buffer->base.destroy = nouveau_vp3_video_buffer_destroy;
- buffer->base.chroma_format = templat->chroma_format;
buffer->base.width = templat->width;
buffer->base.height = templat->height;
buffer->base.get_sampler_view_planes = nouveau_vp3_video_buffer_sampler_view_planes;
debug_printf("Require interlaced video buffers\n");
return NULL;
}
- if (template->chroma_format != PIPE_VIDEO_CHROMA_FORMAT_420) {
+ if (pipe_format_to_chroma_format(template->buffer_format) != PIPE_VIDEO_CHROMA_FORMAT_420) {
debug_printf("Must use 4:2:0 format\n");
return NULL;
}
buffer->base.buffer_format = template->buffer_format;
buffer->base.context = pipe;
buffer->base.destroy = nv84_video_buffer_destroy;
- buffer->base.chroma_format = template->chroma_format;
buffer->base.width = template->width;
buffer->base.height = template->height;
buffer->base.get_sampler_view_planes = nv84_video_buffer_sampler_view_planes;
}
templat.buffer_format = PIPE_FORMAT_NV12;
- templat.chroma_format = PIPE_VIDEO_CHROMA_FORMAT_420;
templat.width = enc->base.width;
templat.height = enc->base.height;
templat.interlaced = false;
enc->si = &si;
templat.buffer_format = PIPE_FORMAT_NV12;
- templat.chroma_format = PIPE_VIDEO_CHROMA_FORMAT_420;
templat.width = enc->base.width;
templat.height = enc->base.height;
templat.interlaced = false;
}
templat.buffer_format = PIPE_FORMAT_NV12;
- templat.chroma_format = PIPE_VIDEO_CHROMA_FORMAT_420;
templat.width = enc->base.width;
templat.height = enc->base.height;
templat.interlaced = false;
enc->si = &si;
templat.buffer_format = PIPE_FORMAT_NV12;
- templat.chroma_format = PIPE_VIDEO_CHROMA_FORMAT_420;
templat.width = enc->base.width;
templat.height = enc->base.height;
templat.interlaced = false;
struct pipe_context *context;
enum pipe_format buffer_format;
- enum pipe_video_chroma_format chroma_format;
unsigned width;
unsigned height;
bool interlaced;
struct pipe_video_buffer templat = {};
templat.buffer_format = PIPE_FORMAT_NV12;
- templat.chroma_format = PIPE_VIDEO_CHROMA_FORMAT_420;
templat.width = priv->scale.xWidth;
templat.height = priv->scale.xHeight;
templat.interlaced = false;
if (!priv->target) {
memset(&templat, 0, sizeof(templat));
- templat.chroma_format = PIPE_VIDEO_CHROMA_FORMAT_420;
templat.width = priv->codec->width;
templat.height = priv->codec->height;
templat.buffer_format = pscreen->get_video_param(
if (!views[i]) continue;
width = def->nFrameWidth;
height = def->nFrameHeight;
- vl_video_buffer_adjust_size(&width, &height, i, buf->chroma_format, buf->interlaced);
+ vl_video_buffer_adjust_size(&width, &height, i,
+ pipe_format_to_chroma_format(buf->buffer_format),
+ buf->interlaced);
for (j = 0; j < views[i]->texture->array_size; ++j) {
struct pipe_box box = {0, 0, j, width, height, 1};
struct pipe_transfer *transfer;
port = tiz_krn_get_port(tiz_get_krn(handleOf (priv)), OMX_VID_DEC_AVC_INPUT_PORT_INDEX);
#endif
memset(&templat, 0, sizeof(templat));
- templat.chroma_format = PIPE_VIDEO_CHROMA_FORMAT_420;
#if ENABLE_ST_OMX_BELLAGIO
templat.width = port->sPortParam.format.video.nFrameWidth;
templat.height = port->sPortParam.format.video.nFrameHeight;
return NULL;
templat.buffer_format = PIPE_FORMAT_NV12;
- templat.chroma_format = PIPE_VIDEO_CHROMA_FORMAT_420;
templat.width = def->nFrameWidth;
templat.height = def->nFrameHeight;
templat.interlaced = false;
*height = p_surf->templat.height;
vl_video_buffer_adjust_size(width, height, component,
- p_surf->templat.chroma_format,
+ pipe_format_to_chroma_format(p_surf->templat.buffer_format),
p_surf->templat.interlaced);
}
unsigned box_y = y & ~1;
if (!views[i]) continue;
vl_video_buffer_adjust_size(&box_w, &box_h, i,
- surf->templat.chroma_format,
+ pipe_format_to_chroma_format(surf->templat.buffer_format),
surf->templat.interlaced);
vl_video_buffer_adjust_size(&box_x, &box_y, i,
- surf->templat.chroma_format,
+ pipe_format_to_chroma_format(surf->templat.buffer_format),
surf->templat.interlaced);
for (j = 0; j < views[i]->texture->array_size; ++j) {
struct pipe_box box = {box_x, box_y, j, box_w, box_h, 1};
width = region->width;
height = region->height;
- vl_video_buffer_adjust_size(&x, &y, plane, buf->chroma_format,
+ vl_video_buffer_adjust_size(&x, &y, plane,
+ pipe_format_to_chroma_format(buf->buffer_format),
buf->interlaced);
- vl_video_buffer_adjust_size(&width, &height, plane, buf->chroma_format,
+ vl_video_buffer_adjust_size(&width, &height, plane,
+ pipe_format_to_chroma_format(buf->buffer_format),
buf->interlaced);
box->x = region->x < 0 ? -x : x;
templat.buffer_format = expected_format;
}
- templat.chroma_format = ChromaToPipe(format);
-
templat.width = width;
templat.height = height;
if (vlsurf->device != vldecoder->device)
return VDP_STATUS_HANDLE_DEVICE_MISMATCH;
- if (vlsurf->video_buffer != NULL && vlsurf->video_buffer->chroma_format != dec->chroma_format)
+ if (vlsurf->video_buffer != NULL &&
+ pipe_format_to_chroma_format(vlsurf->video_buffer->buffer_format) != dec->chroma_format)
// TODO: Recreate decoder with correct chroma
return VDP_STATUS_INVALID_CHROMA_TYPE;
if (vmixer->video_width > video_buffer->width ||
vmixer->video_height > video_buffer->height ||
- vmixer->chroma_format != video_buffer->chroma_format)
+ vmixer->chroma_format != pipe_format_to_chroma_format(video_buffer->buffer_format))
return VDP_STATUS_INVALID_SIZE;
if (layer_count > vmixer->max_layers)
mtx_lock(&vlsurface->device->mutex);
memset(&vtmpl, 0, sizeof(vtmpl));
vtmpl.buffer_format = format;
- vtmpl.chroma_format = FormatYCBCRToPipeChroma(source_ycbcr_format);
if (destination_rect) {
vtmpl.width = abs(destination_rect->x0-destination_rect->x1);
PIPE_VIDEO_ENTRYPOINT_BITSTREAM,
PIPE_VIDEO_CAP_PREFERED_FORMAT
);
- p_surf->templat.chroma_format = ChromaToPipe(chroma_type);
+ assert(pipe_format_to_chroma_format(p_surf->templat.buffer_format) == ChromaToPipe(chroma_type));
p_surf->templat.width = width;
p_surf->templat.height = height;
p_surf->templat.interlaced = pipe->screen->get_video_param
if (p_surf->video_buffer) {
*width = p_surf->video_buffer->width;
*height = p_surf->video_buffer->height;
- *chroma_type = PipeToChroma(p_surf->video_buffer->chroma_format);
+ *chroma_type = PipeToChroma(pipe_format_to_chroma_format(p_surf->video_buffer->buffer_format));
} else {
*width = p_surf->templat.width;
*height = p_surf->templat.height;
- *chroma_type = PipeToChroma(p_surf->templat.chroma_format);
+ *chroma_type = PipeToChroma(pipe_format_to_chroma_format(p_surf->templat.buffer_format));
}
return VDP_STATUS_OK;
*height = p_surf->templat.height;
vl_video_buffer_adjust_size(width, height, component,
- p_surf->templat.chroma_format,
+ pipe_format_to_chroma_format(p_surf->templat.buffer_format),
p_surf->templat.interlaced);
}
context_priv->decoder->entrypoint,
PIPE_VIDEO_CAP_PREFERED_FORMAT
);
- tmpl.chroma_format = context_priv->decoder->chroma_format;
+ assert(pipe_format_to_chroma_format(tmpl.buffer_format) == context_priv->decoder->chroma_format);
tmpl.width = context_priv->decoder->width;
tmpl.height = context_priv->decoder->height;
tmpl.interlaced = pipe->screen->get_video_param