Mercurial > mplayer.hg
annotate libmpcodecs/vd_cinepak.c @ 5119:636b20788503
szrii, tuu, van, fajor
author | gabucino |
---|---|
date | Fri, 15 Mar 2002 23:17:50 +0000 |
parents | eb57973314ae |
children | 3dcbf67c0de0 |
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 //int mpcodecs_config_vo(sh_video_t *sh, int w, int h, unsigned int preferred_outfmt); | |
26 void *decode_cinepak_init(void); | |
27 | |
28 // init driver | |
29 static int init(sh_video_t *sh){ | |
30 sh->context = decode_cinepak_init(); | |
31 mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,IMGFMT_YUY2); | |
32 return 1; | |
33 } | |
34 | |
35 // uninit driver | |
36 static void uninit(sh_video_t *sh){ | |
37 } | |
38 | |
39 //mp_image_t* mpcodecs_get_image(sh_video_t *sh, int mp_imgtype, int mp_imgflag, int w, int h); | |
40 | |
4946 | 41 //void decode_cinepak(void *context, unsigned char *buf, int size, unsigned char *frame, int width, int height, int bit_per_pixel, int stride_); |
42 void decode_cinepak(void *context, unsigned char *buf, int size, mp_image_t* mpi); | |
4882 | 43 |
44 // decode a frame | |
45 static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){ | |
46 mp_image_t* mpi; | |
47 if(len<=0) return NULL; // skipped frame | |
48 | |
4954
43fc27b873ca
order of #includes changed - shouldn't include local things before config.h
arpi
parents:
4946
diff
changeset
|
49 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
|
50 (sh->disp_w+3)&(~3), |
43fc27b873ca
order of #includes changed - shouldn't include local things before config.h
arpi
parents:
4946
diff
changeset
|
51 (sh->disp_h+3)&(~3)); |
4882 | 52 |
53 if(!mpi){ // temporary! | |
54 printf("couldn't allocate image for cinepak codec\n"); | |
55 return NULL; | |
56 } | |
4955 | 57 |
58 #if 0 | |
4954
43fc27b873ca
order of #includes changed - shouldn't include local things before config.h
arpi
parents:
4946
diff
changeset
|
59 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
|
60 mpi->planes[0], mpi->stride[0], |
43fc27b873ca
order of #includes changed - shouldn't include local things before config.h
arpi
parents:
4946
diff
changeset
|
61 mpi->planes[1], mpi->stride[1], |
43fc27b873ca
order of #includes changed - shouldn't include local things before config.h
arpi
parents:
4946
diff
changeset
|
62 mpi->planes[2], mpi->stride[2], |
43fc27b873ca
order of #includes changed - shouldn't include local things before config.h
arpi
parents:
4946
diff
changeset
|
63 mpi->planes[1]-mpi->planes[0], |
43fc27b873ca
order of #includes changed - shouldn't include local things before config.h
arpi
parents:
4946
diff
changeset
|
64 mpi->planes[2]-mpi->planes[1]); |
4955 | 65 #endif |
66 | |
4946 | 67 // decode_cinepak(sh->context, data, len, mpi->planes[0], sh->disp_w, sh->disp_h, |
68 // (mpi->flags&MP_IMGFLAG_YUV)?16:(mpi->imgfmt&255), mpi->stride[0]); | |
69 | |
70 decode_cinepak(sh->context, data, len, mpi); | |
4882 | 71 |
72 return mpi; | |
73 } | |
74 |