Mercurial > mplayer.hg
comparison libmpcodecs/vd_ffmpeg.c @ 28412:5e5e9962a96d
Convert CONFIG_XVMC into a 0/1 definition.
author | zuxy |
---|---|
date | Mon, 02 Feb 2009 07:26:05 +0000 |
parents | 8baa89b228c5 |
children | b9da026ee222 |
comparison
equal
deleted
inserted
replaced
28411:e705056e492e | 28412:5e5e9962a96d |
---|---|
24 | 24 |
25 LIBVD_EXTERN(ffmpeg) | 25 LIBVD_EXTERN(ffmpeg) |
26 | 26 |
27 #include "libavcodec/avcodec.h" | 27 #include "libavcodec/avcodec.h" |
28 | 28 |
29 #ifdef CONFIG_XVMC | 29 #if CONFIG_XVMC |
30 #include "xvmc_render.h" | 30 #include "xvmc_render.h" |
31 #endif | 31 #endif |
32 | 32 |
33 int avcodec_initialized=0; | 33 int avcodec_initialized=0; |
34 | 34 |
57 #include "m_option.h" | 57 #include "m_option.h" |
58 | 58 |
59 static int get_buffer(AVCodecContext *avctx, AVFrame *pic); | 59 static int get_buffer(AVCodecContext *avctx, AVFrame *pic); |
60 static void release_buffer(AVCodecContext *avctx, AVFrame *pic); | 60 static void release_buffer(AVCodecContext *avctx, AVFrame *pic); |
61 | 61 |
62 #ifdef CONFIG_XVMC | 62 #if CONFIG_XVMC |
63 static enum PixelFormat get_format(struct AVCodecContext * avctx, | 63 static enum PixelFormat get_format(struct AVCodecContext * avctx, |
64 const enum PixelFormat * pix_fmt); | 64 const enum PixelFormat * pix_fmt); |
65 static int mc_get_buffer(AVCodecContext *avctx, AVFrame *pic); | 65 static int mc_get_buffer(AVCodecContext *avctx, AVFrame *pic); |
66 static void mc_release_buffer(AVCodecContext *avctx, AVFrame *pic); | 66 static void mc_release_buffer(AVCodecContext *avctx, AVFrame *pic); |
67 static void mc_render_slice(struct AVCodecContext *s, | 67 static void mc_render_slice(struct AVCodecContext *s, |
141 case IMGFMT_I420: | 141 case IMGFMT_I420: |
142 // "converted" using pointer/stride modification | 142 // "converted" using pointer/stride modification |
143 if(avctx->pix_fmt==PIX_FMT_YUV420P) return CONTROL_TRUE;// u/v swap | 143 if(avctx->pix_fmt==PIX_FMT_YUV420P) return CONTROL_TRUE;// u/v swap |
144 if(avctx->pix_fmt==PIX_FMT_YUV422P && !ctx->do_dr1) return CONTROL_TRUE;// half stride | 144 if(avctx->pix_fmt==PIX_FMT_YUV422P && !ctx->do_dr1) return CONTROL_TRUE;// half stride |
145 break; | 145 break; |
146 #ifdef CONFIG_XVMC | 146 #if CONFIG_XVMC |
147 case IMGFMT_XVMC_IDCT_MPEG2: | 147 case IMGFMT_XVMC_IDCT_MPEG2: |
148 case IMGFMT_XVMC_MOCO_MPEG2: | 148 case IMGFMT_XVMC_MOCO_MPEG2: |
149 if(avctx->pix_fmt==PIX_FMT_XVMC_MPEG2_IDCT) return CONTROL_TRUE; | 149 if(avctx->pix_fmt==PIX_FMT_XVMC_MPEG2_IDCT) return CONTROL_TRUE; |
150 #endif | 150 #endif |
151 } | 151 } |
248 | 248 |
249 ctx->pic = avcodec_alloc_frame(); | 249 ctx->pic = avcodec_alloc_frame(); |
250 ctx->avctx = avcodec_alloc_context(); | 250 ctx->avctx = avcodec_alloc_context(); |
251 avctx = ctx->avctx; | 251 avctx = ctx->avctx; |
252 | 252 |
253 #ifdef CONFIG_XVMC | 253 #if CONFIG_XVMC |
254 | 254 |
255 #ifdef CODEC_CAP_HWACCEL | 255 #ifdef CODEC_CAP_HWACCEL |
256 if(lavc_codec->capabilities & CODEC_CAP_HWACCEL){ | 256 if(lavc_codec->capabilities & CODEC_CAP_HWACCEL){ |
257 #else | 257 #else |
258 if(lavc_codec->id == CODEC_ID_MPEG2VIDEO_XVMC){ | 258 if(lavc_codec->id == CODEC_ID_MPEG2VIDEO_XVMC){ |
531 case PIX_FMT_BGR24 : ctx->best_csp=IMGFMT_BGR24;break; //8bps | 531 case PIX_FMT_BGR24 : ctx->best_csp=IMGFMT_BGR24;break; //8bps |
532 case PIX_FMT_RGB555: ctx->best_csp=IMGFMT_BGR15;break; //rpza,cram | 532 case PIX_FMT_RGB555: ctx->best_csp=IMGFMT_BGR15;break; //rpza,cram |
533 case PIX_FMT_RGB565: ctx->best_csp=IMGFMT_BGR16;break; //4xm | 533 case PIX_FMT_RGB565: ctx->best_csp=IMGFMT_BGR16;break; //4xm |
534 case PIX_FMT_GRAY8: ctx->best_csp=IMGFMT_Y800;break; // gray jpeg | 534 case PIX_FMT_GRAY8: ctx->best_csp=IMGFMT_Y800;break; // gray jpeg |
535 case PIX_FMT_PAL8: ctx->best_csp=IMGFMT_BGR8;break; //8bps,mrle,cram | 535 case PIX_FMT_PAL8: ctx->best_csp=IMGFMT_BGR8;break; //8bps,mrle,cram |
536 #ifdef CONFIG_XVMC | 536 #if CONFIG_XVMC |
537 case PIX_FMT_XVMC_MPEG2_MC:ctx->best_csp=IMGFMT_XVMC_MOCO_MPEG2;break; | 537 case PIX_FMT_XVMC_MPEG2_MC:ctx->best_csp=IMGFMT_XVMC_MOCO_MPEG2;break; |
538 case PIX_FMT_XVMC_MPEG2_IDCT:ctx->best_csp=IMGFMT_XVMC_IDCT_MPEG2;break; | 538 case PIX_FMT_XVMC_MPEG2_IDCT:ctx->best_csp=IMGFMT_XVMC_IDCT_MPEG2;break; |
539 #endif | 539 #endif |
540 default: | 540 default: |
541 ctx->best_csp=0; | 541 ctx->best_csp=0; |
908 if(pic->repeat_pict == 1) mpi->fields |= MP_IMGFIELD_REPEAT_FIRST; | 908 if(pic->repeat_pict == 1) mpi->fields |= MP_IMGFIELD_REPEAT_FIRST; |
909 | 909 |
910 return mpi; | 910 return mpi; |
911 } | 911 } |
912 | 912 |
913 #ifdef CONFIG_XVMC | 913 #if CONFIG_XVMC |
914 static enum PixelFormat get_format(struct AVCodecContext * avctx, | 914 static enum PixelFormat get_format(struct AVCodecContext * avctx, |
915 const enum PixelFormat * fmt){ | 915 const enum PixelFormat * fmt){ |
916 sh_video_t * sh = avctx->opaque; | 916 sh_video_t * sh = avctx->opaque; |
917 int i; | 917 int i; |
918 | 918 |