Mercurial > mplayer.hg
annotate libmpcodecs/vd_cinepak.c @ 5976:ff3e5901b2cc
small patch that fixes the purple window when the f key is pressed - by Attila Kinali <kinali@gmx.net>
author | arpi |
---|---|
date | Sat, 04 May 2002 22:52:56 +0000 |
parents | 3dcbf67c0de0 |
children | 28677d779205 |
rev | line source |
---|---|
4882 | 1 #include <stdio.h> |
2 #include <stdlib.h> | |
3 | |
4 #include "config.h" | |
5 #include "mp_msg.h" | |
6 | |
7 #include "vd_internal.h" | |
8 | |
9 static vd_info_t info = { | |
10 "Cinepak Video decoder", | |
11 "cinepak", | |
4900 | 12 VFM_CINEPAK, |
4882 | 13 "A'rpi", |
14 "Dr. Tim Ferguson, http://www.csse.monash.edu.au/~timf/videocodec.html", | |
15 "native codec" | |
16 }; | |
17 | |
18 LIBVD_EXTERN(cinepak) | |
19 | |
20 // to set/get/query special features/parameters | |
21 static int control(sh_video_t *sh,int cmd,void* arg,...){ | |
22 return CONTROL_UNKNOWN; | |
23 } | |
24 | |
25 void *decode_cinepak_init(void); | |
26 | |
27 // init driver | |
28 static int init(sh_video_t *sh){ | |
29 sh->context = decode_cinepak_init(); | |
5124 | 30 return mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,IMGFMT_YUY2); |
4882 | 31 } |
32 | |
33 // uninit driver | |
34 static void uninit(sh_video_t *sh){ | |
35 } | |
36 | |
37 //mp_image_t* mpcodecs_get_image(sh_video_t *sh, int mp_imgtype, int mp_imgflag, int w, int h); | |
38 | |
4946 | 39 //void decode_cinepak(void *context, unsigned char *buf, int size, unsigned char *frame, int width, int height, int bit_per_pixel, int stride_); |
40 void decode_cinepak(void *context, unsigned char *buf, int size, mp_image_t* mpi); | |
4882 | 41 |
42 // decode a frame | |
43 static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){ | |
44 mp_image_t* mpi; | |
45 if(len<=0) return NULL; // skipped frame | |
46 | |
4954
43fc27b873ca
order of #includes changed - shouldn't include local things before config.h
arpi
parents:
4946
diff
changeset
|
47 mpi=mpcodecs_get_image(sh, MP_IMGTYPE_STATIC, MP_IMGFLAG_PRESERVE | MP_IMGFLAG_ACCEPT_STRIDE, |
43fc27b873ca
order of #includes changed - shouldn't include local things before config.h
arpi
parents:
4946
diff
changeset
|
48 (sh->disp_w+3)&(~3), |
43fc27b873ca
order of #includes changed - shouldn't include local things before config.h
arpi
parents:
4946
diff
changeset
|
49 (sh->disp_h+3)&(~3)); |
4882 | 50 |
51 if(!mpi){ // temporary! | |
52 printf("couldn't allocate image for cinepak codec\n"); | |
53 return NULL; | |
54 } | |
4955 | 55 |
56 #if 0 | |
4954
43fc27b873ca
order of #includes changed - shouldn't include local things before config.h
arpi
parents:
4946
diff
changeset
|
57 printf("mpi: %p/%d %p/%d %p/%d (%d) (%d) \n", |
43fc27b873ca
order of #includes changed - shouldn't include local things before config.h
arpi
parents:
4946
diff
changeset
|
58 mpi->planes[0], mpi->stride[0], |
43fc27b873ca
order of #includes changed - shouldn't include local things before config.h
arpi
parents:
4946
diff
changeset
|
59 mpi->planes[1], mpi->stride[1], |
43fc27b873ca
order of #includes changed - shouldn't include local things before config.h
arpi
parents:
4946
diff
changeset
|
60 mpi->planes[2], mpi->stride[2], |
43fc27b873ca
order of #includes changed - shouldn't include local things before config.h
arpi
parents:
4946
diff
changeset
|
61 mpi->planes[1]-mpi->planes[0], |
43fc27b873ca
order of #includes changed - shouldn't include local things before config.h
arpi
parents:
4946
diff
changeset
|
62 mpi->planes[2]-mpi->planes[1]); |
4955 | 63 #endif |
64 | |
4946 | 65 // decode_cinepak(sh->context, data, len, mpi->planes[0], sh->disp_w, sh->disp_h, |
66 // (mpi->flags&MP_IMGFLAG_YUV)?16:(mpi->imgfmt&255), mpi->stride[0]); | |
67 | |
68 decode_cinepak(sh->context, data, len, mpi); | |
4882 | 69 |
70 return mpi; | |
71 } | |
72 |