summaryrefslogtreecommitdiffstats
path: root/video/vdpau.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-03-17 18:21:11 +0100
committerwm4 <wm4@nowhere>2014-03-17 18:21:11 +0100
commit638950731451cbef616015bd81d411e7cdbb9ff0 (patch)
treefe19c24135e89048df777b163474936afe8b2902 /video/vdpau.c
parent4e70335c2fa3eaea6f8f2d11fb7981f55a582fa5 (diff)
downloadmpv-638950731451cbef616015bd81d411e7cdbb9ff0.tar.bz2
mpv-638950731451cbef616015bd81d411e7cdbb9ff0.tar.xz
vdpau: remove legacy pixel formats
They were used by ancient libavcodec versions. This also removes the need to distinguish vdpau image formats at all (since there is only one), and some code can be simplified.
Diffstat (limited to 'video/vdpau.c')
-rw-r--r--video/vdpau.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/video/vdpau.c b/video/vdpau.c
index e543a2553c..cd6af07cb9 100644
--- a/video/vdpau.c
+++ b/video/vdpau.c
@@ -140,26 +140,24 @@ static struct mp_image *create_ref(struct surface_entry *e)
struct mp_image *res =
mp_image_new_custom_ref(&(struct mp_image){0}, &e->in_use,
release_decoder_surface);
- mp_image_setfmt(res, e->fmt);
+ mp_image_setfmt(res, IMGFMT_VDPAU);
mp_image_set_size(res, e->w, e->h);
res->planes[0] = (void *)"dummy"; // must be non-NULL, otherwise arbitrary
res->planes[3] = (void *)(intptr_t)e->surface;
return res;
}
-struct mp_image *mp_vdpau_get_video_surface(struct mp_vdpau_ctx *ctx, int fmt,
+struct mp_image *mp_vdpau_get_video_surface(struct mp_vdpau_ctx *ctx,
VdpChromaType chroma, int w, int h)
{
struct vdp_functions *vdp = ctx->vdp;
VdpStatus vdp_st;
- assert(IMGFMT_IS_VDPAU(fmt));
-
// Destroy all unused surfaces that don't have matching parameters
for (int n = 0; n < MAX_VIDEO_SURFACES; n++) {
struct surface_entry *e = &ctx->video_surfaces[n];
if (!e->in_use && e->surface != VDP_INVALID_HANDLE) {
- if (e->fmt != fmt || e->chroma != chroma || e->w != w || e->h != h) {
+ if (e->chroma != chroma || e->w != w || e->h != h) {
vdp_st = vdp->video_surface_destroy(e->surface);
CHECK_VDP_WARNING(ctx, "Error when calling vdp_video_surface_destroy");
e->surface = VDP_INVALID_HANDLE;
@@ -172,7 +170,7 @@ struct mp_image *mp_vdpau_get_video_surface(struct mp_vdpau_ctx *ctx, int fmt,
struct surface_entry *e = &ctx->video_surfaces[n];
if (!e->in_use && e->surface != VDP_INVALID_HANDLE) {
assert(e->w == w && e->h == h);
- assert(e->fmt == fmt && e->chroma == chroma);
+ assert(e->chroma == chroma);
return create_ref(e);
}
}
@@ -182,7 +180,6 @@ struct mp_image *mp_vdpau_get_video_surface(struct mp_vdpau_ctx *ctx, int fmt,
struct surface_entry *e = &ctx->video_surfaces[n];
if (!e->in_use) {
assert(e->surface == VDP_INVALID_HANDLE);
- e->fmt = fmt;
e->chroma = chroma;
e->w = w;
e->h = h;
@@ -265,12 +262,6 @@ bool mp_vdpau_get_format(int imgfmt, VdpChromaType *out_chroma_type,
ycbcr = VDP_YCBCR_FORMAT_UYVY;
chroma = VDP_CHROMA_TYPE_422;
break;
- case IMGFMT_VDPAU_MPEG1:
- case IMGFMT_VDPAU_MPEG2:
- case IMGFMT_VDPAU_H264:
- case IMGFMT_VDPAU_WMV3:
- case IMGFMT_VDPAU_VC1:
- case IMGFMT_VDPAU_MPEG4:
case IMGFMT_VDPAU:
break;
default: