changeset 37055:6cc356239d4b

Update XvMC implementation to the changes in FFmpeg. Use the common AV_PIX_FMT_XVMC. Remove usage of avctx->xvmc_acceleration and CODEC_CAP_HWACCEL. Return error instead of exiting.
author iive
date Tue, 15 Apr 2014 12:10:59 +0000
parents df3d5a18318d
children d6bbecdf03bf
files fmt-conversion.c libmpcodecs/vd_ffmpeg.c
diffstat 2 files changed, 2 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/fmt-conversion.c	Sat Apr 12 23:45:58 2014 +0000
+++ b/fmt-conversion.c	Tue Apr 15 12:10:59 2014 +0000
@@ -134,9 +134,7 @@
     { IMGFMT_422P,       AV_PIX_FMT_YUVJ422P },
     { IMGFMT_444P,       AV_PIX_FMT_YUVJ444P },
     { IMGFMT_440P,       AV_PIX_FMT_YUVJ440P },
-
-    { IMGFMT_XVMC_MOCO_MPEG2, AV_PIX_FMT_XVMC_MPEG2_MC },
-    { IMGFMT_XVMC_IDCT_MPEG2, AV_PIX_FMT_XVMC_MPEG2_IDCT },
+    { IMGFMT_XVMC_IDCT_MPEG2, AV_PIX_FMT_XVMC },
     { IMGFMT_VDPAU_MPEG1,     AV_PIX_FMT_VDPAU_MPEG1 },
     { IMGFMT_VDPAU_MPEG2,     AV_PIX_FMT_VDPAU_MPEG2 },
     { IMGFMT_VDPAU_H264,      AV_PIX_FMT_VDPAU_H264 },
--- a/libmpcodecs/vd_ffmpeg.c	Sat Apr 12 23:45:58 2014 +0000
+++ b/libmpcodecs/vd_ffmpeg.c	Tue Apr 15 12:10:59 2014 +0000
@@ -477,9 +477,6 @@
         avctx->bits_per_coded_sample= sh->bih->biBitCount;
 
     set_dr_slice_settings(avctx, lavc_codec);
-    if(lavc_codec->capabilities & CODEC_CAP_HWACCEL)
-        // HACK around badly placed checks in mpeg_mc_decode_init
-        set_format_params(avctx, PIX_FMT_XVMC_MPEG2_IDCT);
     avctx->thread_count = lavc_param_threads;
     avctx->thread_type = FF_THREAD_FRAME | FF_THREAD_SLICE;
     avctx->refcounted_frames = 1;
@@ -751,17 +748,10 @@
 #if CONFIG_XVMC
     if(IMGFMT_IS_XVMC(mpi->imgfmt)) {
         struct xvmc_pix_fmt *render = mpi->priv; //same as data[2]
-        if(!avctx->xvmc_acceleration) {
-            mp_msg(MSGT_DECVIDEO, MSGL_INFO, MSGTR_MPCODECS_McGetBufferShouldWorkOnlyWithXVMC);
-            assert(0);
-            exit(1);
-//            return -1;//!!fixme check error conditions in ffmpeg
-        }
         if(!(mpi->flags & MP_IMGFLAG_DIRECT)) {
             mp_msg(MSGT_DECVIDEO, MSGL_ERR, MSGTR_MPCODECS_OnlyBuffersAllocatedByVoXvmcAllowed);
             assert(0);
-            exit(1);
-//            return -1;//!!fixme check error conditions in ffmpeg
+            return -1;//!!fixme check error conditions in ffmpeg
         }
         if(mp_msg_test(MSGT_DECVIDEO, MSGL_DBG5))
             mp_msg(MSGT_DECVIDEO, MSGL_DBG5, "vd_ffmpeg::get_buffer (xvmc render=%p)\n", render);