[MPlayer-cvslog] r32575 - in trunk/libmpcodecs: img_format.h mp_image.c vd_ffmpeg.c vf_vo.c
reimar
subversion at mplayerhq.hu
Wed Nov 3 17:39:53 CET 2010
Author: reimar
Date: Wed Nov 3 17:39:52 2010
New Revision: 32575
Log:
Add and use a IMGFMT_IS_HWACCEL define.
Modified:
trunk/libmpcodecs/img_format.h
trunk/libmpcodecs/mp_image.c
trunk/libmpcodecs/vd_ffmpeg.c
trunk/libmpcodecs/vf_vo.c
Modified: trunk/libmpcodecs/img_format.h
==============================================================================
--- trunk/libmpcodecs/img_format.h Wed Nov 3 09:15:19 2010 (r32574)
+++ trunk/libmpcodecs/img_format.h Wed Nov 3 17:39:52 2010 (r32575)
@@ -193,6 +193,8 @@
#define IMGFMT_VDPAU_VC1 (IMGFMT_VDPAU|0x05)
#define IMGFMT_VDPAU_MPEG4 (IMGFMT_VDPAU|0x06)
+#define IMGFMT_IS_HWACCEL(fmt) (IMGFMT_IS_VDPAU(fmt) || IMGFMT_IS_XVMC(fmt))
+
typedef struct {
void* data;
int size;
Modified: trunk/libmpcodecs/mp_image.c
==============================================================================
--- trunk/libmpcodecs/mp_image.c Wed Nov 3 09:15:19 2010 (r32574)
+++ trunk/libmpcodecs/mp_image.c Wed Nov 3 17:39:52 2010 (r32575)
@@ -101,7 +101,7 @@ void mp_image_setfmt(mp_image_t* mpi,uns
// compressed formats
if(out_fmt == IMGFMT_MPEGPES ||
out_fmt == IMGFMT_ZRMJPEGNI || out_fmt == IMGFMT_ZRMJPEGIT || out_fmt == IMGFMT_ZRMJPEGIB ||
- IMGFMT_IS_VDPAU(out_fmt) || IMGFMT_IS_XVMC(out_fmt)){
+ IMGFMT_IS_HWACCEL(out_fmt)){
mpi->bpp=0;
return;
}
Modified: trunk/libmpcodecs/vd_ffmpeg.c
==============================================================================
--- trunk/libmpcodecs/vd_ffmpeg.c Wed Nov 3 09:15:19 2010 (r32574)
+++ trunk/libmpcodecs/vd_ffmpeg.c Wed Nov 3 17:39:52 2010 (r32575)
@@ -233,7 +233,7 @@ static void set_format_params(struct AVC
if (fmt == PIX_FMT_NONE)
return;
imgfmt = pixfmt2imgfmt(fmt);
- if (IMGFMT_IS_XVMC(imgfmt) || IMGFMT_IS_VDPAU(imgfmt)) {
+ if (IMGFMT_IS_HWACCEL(imgfmt)) {
sh_video_t *sh = avctx->opaque;
vd_ffmpeg_ctx *ctx = sh->context;
ctx->do_dr1 = 1;
@@ -624,7 +624,7 @@ static int get_buffer(AVCodecContext *av
return avctx->get_buffer(avctx, pic);
}
- if (IMGFMT_IS_XVMC(ctx->best_csp) || IMGFMT_IS_VDPAU(ctx->best_csp)) {
+ if (IMGFMT_IS_HWACCEL(ctx->best_csp)) {
type = MP_IMGTYPE_NUMBERED | (0xffff << 16);
} else
if (!pic->buffer_hints) {
@@ -656,13 +656,12 @@ static int get_buffer(AVCodecContext *av
avctx->draw_horiz_band= draw_slice;
} else
avctx->draw_horiz_band= NULL;
- if(IMGFMT_IS_VDPAU(mpi->imgfmt)) {
+ if(IMGFMT_IS_HWACCEL(mpi->imgfmt)) {
avctx->draw_horiz_band= draw_slice;
}
#if CONFIG_XVMC
if(IMGFMT_IS_XVMC(mpi->imgfmt)) {
struct xvmc_pix_fmt *render = mpi->priv; //same as data[2]
- avctx->draw_horiz_band= draw_slice;
if(!avctx->xvmc_acceleration) {
mp_msg(MSGT_DECVIDEO, MSGL_INFO, MSGTR_MPCODECS_McGetBufferShouldWorkOnlyWithXVMC);
assert(0);
@@ -983,7 +982,7 @@ static enum PixelFormat get_format(struc
for(i=0;fmt[i]!=PIX_FMT_NONE;i++){
imgfmt = pixfmt2imgfmt(fmt[i]);
- if(!IMGFMT_IS_XVMC(imgfmt) && !IMGFMT_IS_VDPAU(imgfmt)) continue;
+ if(!IMGFMT_IS_HWACCEL(imgfmt)) continue;
mp_msg(MSGT_DECVIDEO, MSGL_INFO, MSGTR_MPCODECS_TryingPixfmt, i);
if(init_vo(sh, fmt[i]) >= 0) {
break;
Modified: trunk/libmpcodecs/vf_vo.c
==============================================================================
--- trunk/libmpcodecs/vf_vo.c Wed Nov 3 09:15:19 2010 (r32574)
+++ trunk/libmpcodecs/vf_vo.c Wed Nov 3 17:39:52 2010 (r32575)
@@ -157,7 +157,7 @@ static void get_image(struct vf_instance
if(!vo_config_count) return;
// GET_IMAGE is required for hardware-accelerated formats
if(vo_directrendering ||
- IMGFMT_IS_XVMC(mpi->imgfmt) || IMGFMT_IS_VDPAU(mpi->imgfmt))
+ IMGFMT_IS_HWACCEL(mpi->imgfmt))
video_out->control(VOCTRL_GET_IMAGE,mpi);
}
More information about the MPlayer-cvslog
mailing list