Mercurial > mplayer.hg
comparison libmpcodecs/vd_cinepak.c @ 4882:2ebd5bed2ce4
cinepak decoder - untested
author | arpi |
---|---|
date | Thu, 28 Feb 2002 01:26:45 +0000 |
parents | |
children | 260edd600949 |
comparison
equal
deleted
inserted
replaced
4881:f5f854541977 | 4882:2ebd5bed2ce4 |
---|---|
1 #include <stdio.h> | |
2 #include <stdlib.h> | |
3 | |
4 #include "codec-cfg.h" | |
5 | |
6 #include "config.h" | |
7 #include "mp_msg.h" | |
8 | |
9 #include "../libvo/img_format.h" | |
10 | |
11 #include "stream.h" | |
12 #include "demuxer.h" | |
13 #include "stheader.h" | |
14 | |
15 #include "vd.h" | |
16 #include "vd_internal.h" | |
17 | |
18 static vd_info_t info = { | |
19 "Cinepak Video decoder", | |
20 "cinepak", | |
21 0, | |
22 "A'rpi", | |
23 "Dr. Tim Ferguson, http://www.csse.monash.edu.au/~timf/videocodec.html", | |
24 "native codec" | |
25 }; | |
26 | |
27 LIBVD_EXTERN(cinepak) | |
28 | |
29 // to set/get/query special features/parameters | |
30 static int control(sh_video_t *sh,int cmd,void* arg,...){ | |
31 return CONTROL_UNKNOWN; | |
32 } | |
33 | |
34 //int mpcodecs_config_vo(sh_video_t *sh, int w, int h, unsigned int preferred_outfmt); | |
35 void *decode_cinepak_init(void); | |
36 | |
37 // init driver | |
38 static int init(sh_video_t *sh){ | |
39 sh->context = decode_cinepak_init(); | |
40 mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,IMGFMT_YUY2); | |
41 return 1; | |
42 } | |
43 | |
44 // uninit driver | |
45 static void uninit(sh_video_t *sh){ | |
46 } | |
47 | |
48 //mp_image_t* mpcodecs_get_image(sh_video_t *sh, int mp_imgtype, int mp_imgflag, int w, int h); | |
49 | |
50 void decode_cinepak(void *context, unsigned char *buf, int size, unsigned char *frame, int width, int height, int bit_per_pixel, int stride_); | |
51 | |
52 // decode a frame | |
53 static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){ | |
54 mp_image_t* mpi; | |
55 if(len<=0) return NULL; // skipped frame | |
56 | |
57 mpi=mpcodecs_get_image(sh, MP_IMGTYPE_STATIC, MP_IMGFLAG_PRESERVE | MP_IMGFLAG_ACCEPT_STRIDE, sh->disp_w, sh->disp_h); | |
58 | |
59 if(!mpi){ // temporary! | |
60 printf("couldn't allocate image for cinepak codec\n"); | |
61 return NULL; | |
62 } | |
63 | |
64 decode_cinepak(sh->context, data, len, mpi->planes[0], sh->disp_w, sh->disp_h, | |
65 (mpi->flags&MP_IMGFLAG_YUV)?16:(mpi->imgfmt&255), mpi->stride[0]); | |
66 | |
67 return mpi; | |
68 } | |
69 |