Mercurial > mplayer.hg
comparison libmpcodecs/vd_vfw.c @ 7175:f8b147aab1a5
vfwex separated from vfw, to work with new vfm system and dlopen
author | arpi |
---|---|
date | Fri, 30 Aug 2002 20:47:18 +0000 |
parents | e69615f1c309 |
children | 42222161de9b |
comparison
equal
deleted
inserted
replaced
7174:7672615cc811 | 7175:f8b147aab1a5 |
---|---|
18 "A'rpi", | 18 "A'rpi", |
19 "based on http://avifile.sf.net", | 19 "based on http://avifile.sf.net", |
20 "win32 codecs" | 20 "win32 codecs" |
21 }; | 21 }; |
22 | 22 |
23 static vd_info_t info_vfwex = { | |
24 "Win32/VfWex video codecs", | |
25 "vfwex", | |
26 VFM_VFWEX, | |
27 "A'rpi", | |
28 "based on http://avifile.sf.net", | |
29 "win32 codecs" | |
30 }; | |
31 | |
32 #define info info_vfw | |
33 LIBVD_EXTERN(vfw) | 23 LIBVD_EXTERN(vfw) |
34 #undef info | |
35 | |
36 #define info info_vfwex | |
37 LIBVD_EXTERN(vfwex) | |
38 #undef info | |
39 | 24 |
40 // to set/get/query special features/parameters | 25 // to set/get/query special features/parameters |
41 static int control(sh_video_t *sh,int cmd,void* arg,...){ | 26 static int control(sh_video_t *sh,int cmd,void* arg,...){ |
42 switch(cmd){ | 27 switch(cmd){ |
43 case VDCTRL_QUERY_MAX_PP_LEVEL: | 28 case VDCTRL_QUERY_MAX_PP_LEVEL: |
50 } | 35 } |
51 | 36 |
52 // init driver | 37 // init driver |
53 static int init(sh_video_t *sh){ | 38 static int init(sh_video_t *sh){ |
54 if(!mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,IMGFMT_YUY2)) return 0; | 39 if(!mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,IMGFMT_YUY2)) return 0; |
55 if(!init_vfw_video_codec(sh,(sh->codec->driver==VFM_VFWEX))) return 0; | 40 if(!init_vfw_video_codec(sh,0)) return 0; |
56 mp_msg(MSGT_DECVIDEO,MSGL_V,"INFO: Win32 video codec init OK!\n"); | 41 mp_msg(MSGT_DECVIDEO,MSGL_V,"INFO: Win32 video codec init OK!\n"); |
57 return 1; | 42 return 1; |
58 } | 43 } |
59 | 44 |
60 // uninit driver | 45 // uninit driver |
61 static void uninit(sh_video_t *sh){ | 46 static void uninit(sh_video_t *sh){ |
62 vfw_close_video_codec(sh, (sh->codec->driver==VFM_VFWEX)); | 47 vfw_close_video_codec(sh, 0); |
63 } | 48 } |
64 | |
65 //mp_image_t* mpcodecs_get_image(sh_video_t *sh, int mp_imgtype, int mp_imgflag, int w, int h); | |
66 | 49 |
67 // decode a frame | 50 // decode a frame |
68 static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){ | 51 static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){ |
69 mp_image_t* mpi; | 52 mp_image_t* mpi; |
70 int ret; | 53 int ret; |
84 | 67 |
85 // set stride: (trick discovered by Andreas Ackermann - thanx!) | 68 // set stride: (trick discovered by Andreas Ackermann - thanx!) |
86 sh->bih->biWidth=mpi->width; //mpi->stride[0]/(mpi->bpp/8); | 69 sh->bih->biWidth=mpi->width; //mpi->stride[0]/(mpi->bpp/8); |
87 sh->o_bih.biWidth=mpi->width; //mpi->stride[0]/(mpi->bpp/8); | 70 sh->o_bih.biWidth=mpi->width; //mpi->stride[0]/(mpi->bpp/8); |
88 | 71 |
89 if((ret=vfw_decode_video(sh,data,len,flags&3,(sh->codec->driver==VFM_VFWEX) ))){ | 72 if((ret=vfw_decode_video(sh,data,len,flags&3,0))){ |
90 mp_msg(MSGT_DECVIDEO,MSGL_WARN,"Error decompressing frame, err=%d\n",ret); | 73 mp_msg(MSGT_DECVIDEO,MSGL_WARN,"Error decompressing frame, err=%d\n",ret); |
91 return NULL; | 74 return NULL; |
92 } | 75 } |
93 | 76 |
94 if(mpi->imgfmt==IMGFMT_RGB8 || mpi->imgfmt==IMGFMT_BGR8){ | 77 if(mpi->imgfmt==IMGFMT_RGB8 || mpi->imgfmt==IMGFMT_BGR8){ |