Mercurial > mplayer.hg
comparison libmpcodecs/vd_ffmpeg.c @ 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 | a31e7824ef36 |
children | 08bbd1e9036d |
comparison
equal
deleted
inserted
replaced
37054:df3d5a18318d | 37055:6cc356239d4b |
---|---|
475 | 475 |
476 if(sh->bih) | 476 if(sh->bih) |
477 avctx->bits_per_coded_sample= sh->bih->biBitCount; | 477 avctx->bits_per_coded_sample= sh->bih->biBitCount; |
478 | 478 |
479 set_dr_slice_settings(avctx, lavc_codec); | 479 set_dr_slice_settings(avctx, lavc_codec); |
480 if(lavc_codec->capabilities & CODEC_CAP_HWACCEL) | |
481 // HACK around badly placed checks in mpeg_mc_decode_init | |
482 set_format_params(avctx, PIX_FMT_XVMC_MPEG2_IDCT); | |
483 avctx->thread_count = lavc_param_threads; | 480 avctx->thread_count = lavc_param_threads; |
484 avctx->thread_type = FF_THREAD_FRAME | FF_THREAD_SLICE; | 481 avctx->thread_type = FF_THREAD_FRAME | FF_THREAD_SLICE; |
485 avctx->refcounted_frames = 1; | 482 avctx->refcounted_frames = 1; |
486 | 483 |
487 /* open it */ | 484 /* open it */ |
749 } | 746 } |
750 #endif | 747 #endif |
751 #if CONFIG_XVMC | 748 #if CONFIG_XVMC |
752 if(IMGFMT_IS_XVMC(mpi->imgfmt)) { | 749 if(IMGFMT_IS_XVMC(mpi->imgfmt)) { |
753 struct xvmc_pix_fmt *render = mpi->priv; //same as data[2] | 750 struct xvmc_pix_fmt *render = mpi->priv; //same as data[2] |
754 if(!avctx->xvmc_acceleration) { | |
755 mp_msg(MSGT_DECVIDEO, MSGL_INFO, MSGTR_MPCODECS_McGetBufferShouldWorkOnlyWithXVMC); | |
756 assert(0); | |
757 exit(1); | |
758 // return -1;//!!fixme check error conditions in ffmpeg | |
759 } | |
760 if(!(mpi->flags & MP_IMGFLAG_DIRECT)) { | 751 if(!(mpi->flags & MP_IMGFLAG_DIRECT)) { |
761 mp_msg(MSGT_DECVIDEO, MSGL_ERR, MSGTR_MPCODECS_OnlyBuffersAllocatedByVoXvmcAllowed); | 752 mp_msg(MSGT_DECVIDEO, MSGL_ERR, MSGTR_MPCODECS_OnlyBuffersAllocatedByVoXvmcAllowed); |
762 assert(0); | 753 assert(0); |
763 exit(1); | 754 return -1;//!!fixme check error conditions in ffmpeg |
764 // return -1;//!!fixme check error conditions in ffmpeg | |
765 } | 755 } |
766 if(mp_msg_test(MSGT_DECVIDEO, MSGL_DBG5)) | 756 if(mp_msg_test(MSGT_DECVIDEO, MSGL_DBG5)) |
767 mp_msg(MSGT_DECVIDEO, MSGL_DBG5, "vd_ffmpeg::get_buffer (xvmc render=%p)\n", render); | 757 mp_msg(MSGT_DECVIDEO, MSGL_DBG5, "vd_ffmpeg::get_buffer (xvmc render=%p)\n", render); |
768 assert(render != 0); | 758 assert(render != 0); |
769 assert(render->xvmc_id == AV_XVMC_ID); | 759 assert(render->xvmc_id == AV_XVMC_ID); |