comparison libmpcodecs/vd_roqvideo.c @ 4989:11d8bf468334

cyuv, nuv, qtrle, qtsmc, roq added
author arpi
date Fri, 08 Mar 2002 07:14:34 +0000
parents
children 3dcbf67c0de0
comparison
equal deleted inserted replaced
4988:db591864d642 4989:11d8bf468334
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 "Id RoQ File Video decoder",
11 "roqvideo",
12 VFM_ROQVIDEO,
13 "A'rpi",
14 "Mike Melanson",
15 "native codec"
16 };
17
18 LIBVD_EXTERN(roqvideo)
19
20 #include "roqav.h"
21
22 // to set/get/query special features/parameters
23 static int control(sh_video_t *sh,int cmd,void* arg,...){
24 return CONTROL_UNKNOWN;
25 }
26
27 // init driver
28 static int init(sh_video_t *sh){
29 sh->context = roq_decode_video_init();
30 mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,IMGFMT_YV12);
31 return 1;
32 }
33
34 // uninit driver
35 static void uninit(sh_video_t *sh){
36 }
37
38 //mp_image_t* mpcodecs_get_image(sh_video_t *sh, int mp_imgtype, int mp_imgflag, int w, int h);
39
40 // decode a frame
41 static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){
42 mp_image_t* mpi;
43 if(len<=0) return NULL; // skipped frame
44
45 mpi=mpcodecs_get_image(sh, MP_IMGTYPE_IP, MP_IMGFLAG_PRESERVE | MP_IMGFLAG_READABLE,
46 sh->disp_w, sh->disp_h);
47 if(!mpi) return NULL;
48
49 roq_decode_video(sh->context, data, len, mpi);
50
51 return mpi;
52 }