comparison libmpcodecs/vd_ffmpeg.c @ 33043:04203ae3000c

Always use get_format, reduces usage of CODEC_CAP_HWACCEL* conditions.
author reimar
date Sun, 27 Mar 2011 14:02:32 +0000
parents 5c9771fc80cd
children d2b6fbd11f20
comparison
equal deleted inserted replaced
33042:5c9771fc80cd 33043:04203ae3000c
301 avctx = ctx->avctx; 301 avctx = ctx->avctx;
302 avctx->opaque = sh; 302 avctx->opaque = sh;
303 avctx->codec_type = AVMEDIA_TYPE_VIDEO; 303 avctx->codec_type = AVMEDIA_TYPE_VIDEO;
304 avctx->codec_id = lavc_codec->id; 304 avctx->codec_id = lavc_codec->id;
305 305
306 #if CONFIG_VDPAU || CONFIG_XVMC 306 avctx->get_format = get_format;
307 if(lavc_codec->capabilities & (CODEC_CAP_HWACCEL_VDPAU | CODEC_CAP_HWACCEL))
308 avctx->get_format = get_format;
309 #endif /* CONFIG_VDPAU */
310 if(ctx->do_dr1){ 307 if(ctx->do_dr1){
311 avctx->flags|= CODEC_FLAG_EMU_EDGE; 308 avctx->flags|= CODEC_FLAG_EMU_EDGE;
312 avctx->get_buffer= get_buffer; 309 avctx->get_buffer= get_buffer;
313 avctx->release_buffer= release_buffer; 310 avctx->release_buffer= release_buffer;
314 avctx->reget_buffer= get_buffer; 311 avctx->reget_buffer= get_buffer;
973 if(pic->repeat_pict == 1) mpi->fields |= MP_IMGFIELD_REPEAT_FIRST; 970 if(pic->repeat_pict == 1) mpi->fields |= MP_IMGFIELD_REPEAT_FIRST;
974 971
975 return mpi; 972 return mpi;
976 } 973 }
977 974
978 #if CONFIG_XVMC || CONFIG_VDPAU
979 static enum PixelFormat get_format(struct AVCodecContext *avctx, 975 static enum PixelFormat get_format(struct AVCodecContext *avctx,
980 const enum PixelFormat *fmt){ 976 const enum PixelFormat *fmt){
981 enum PixelFormat selected_format; 977 enum PixelFormat selected_format;
982 int imgfmt; 978 int imgfmt;
983 sh_video_t *sh = avctx->opaque; 979 sh_video_t *sh = avctx->opaque;
990 if(init_vo(sh, fmt[i]) >= 0) { 986 if(init_vo(sh, fmt[i]) >= 0) {
991 break; 987 break;
992 } 988 }
993 } 989 }
994 selected_format = fmt[i]; 990 selected_format = fmt[i];
991 if (selected_format == PIX_FMT_NONE)
992 selected_format = avcodec_default_get_format(avctx, fmt);
995 set_format_params(avctx, selected_format); 993 set_format_params(avctx, selected_format);
996 return selected_format; 994 return selected_format;
997 } 995 }
998 #endif /* CONFIG_XVMC || CONFIG_VDPAU */