summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-08-15 18:21:54 +0200
committerwm4 <wm4@nowhere>2013-08-15 23:40:02 +0200
commit006c2f66e109099d1956594234f54a5f3b5f0ec5 (patch)
tree81da41f627772ec9181e5132c5c410a901ecf78f /video
parentbe2f2ff033620b31fe04cf53f2b745ebfb2e0ffc (diff)
downloadmpv-006c2f66e109099d1956594234f54a5f3b5f0ec5.tar.bz2
mpv-006c2f66e109099d1956594234f54a5f3b5f0ec5.tar.xz
video/decode: change fix_image callback
This might make it slightly easier when trying to implement surface read-back for hardware decoding.
Diffstat (limited to 'video')
-rw-r--r--video/decode/lavc.h3
-rw-r--r--video/decode/vd_lavc.c4
-rw-r--r--video/decode/vdpau_old.c5
3 files changed, 7 insertions, 5 deletions
diff --git a/video/decode/lavc.h b/video/decode/lavc.h
index f2ac5691d2..769d20b0df 100644
--- a/video/decode/lavc.h
+++ b/video/decode/lavc.h
@@ -63,7 +63,8 @@ struct vd_lavc_hwdec {
void (*uninit)(struct lavc_ctx *ctx);
struct mp_image *(*allocate_image)(struct lavc_ctx *ctx, int fmt,
int w, int h);
- void (*fix_image)(struct lavc_ctx *ctx, struct mp_image *img);
+ // Process the image returned by the libavcodec decoder.
+ struct mp_image *(*process_image)(struct lavc_ctx *ctx, struct mp_image *img);
};
enum {
diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c
index ba9b81d98e..b77e540168 100644
--- a/video/decode/vd_lavc.c
+++ b/video/decode/vd_lavc.c
@@ -747,8 +747,8 @@ static int decode(struct sh_video *sh, struct demux_packet *packet,
struct mp_image *mpi = image_from_decoder(sh);
assert(mpi->planes[0]);
- if (ctx->hwdec && ctx->hwdec->fix_image)
- ctx->hwdec->fix_image(ctx, mpi);
+ if (ctx->hwdec && ctx->hwdec->process_image)
+ ctx->hwdec->process_image(ctx, mpi);
mpi->colorspace = ctx->image_params.colorspace;
mpi->levels = ctx->image_params.colorlevels;
diff --git a/video/decode/vdpau_old.c b/video/decode/vdpau_old.c
index b5674dcec0..8490caedeb 100644
--- a/video/decode/vdpau_old.c
+++ b/video/decode/vdpau_old.c
@@ -247,12 +247,13 @@ static int probe(struct vd_lavc_hwdec *hwdec, struct mp_hwdec_info *info,
return 0;
}
-static void fix_image(struct lavc_ctx *ctx, struct mp_image *img)
+static struct mp_image *process_image(struct lavc_ctx *ctx, struct mp_image *img)
{
// Make it follow the convention of the "new" vdpau decoder
struct vdpau_render_state *rndr = (void *)img->planes[0];
img->planes[0] = (void *)"dummy"; // must be non-NULL, otherwise arbitrary
img->planes[3] = (void *)(intptr_t)rndr->surface;
+ return img;
}
const struct vd_lavc_hwdec mp_vd_lavc_vdpau_old = {
@@ -275,5 +276,5 @@ const struct vd_lavc_hwdec mp_vd_lavc_vdpau_old = {
.init = init,
.uninit = uninit,
.allocate_image = allocate_image,
- .fix_image = fix_image,
+ .process_image = process_image,
};