4989
|
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 "A'rpi",
|
|
13 "Mike Melanson",
|
|
14 "native codec"
|
|
15 };
|
|
16
|
|
17 LIBVD_EXTERN(roqvideo)
|
|
18
|
|
19 #include "roqav.h"
|
|
20
|
|
21 // to set/get/query special features/parameters
|
|
22 static int control(sh_video_t *sh,int cmd,void* arg,...){
|
|
23 return CONTROL_UNKNOWN;
|
|
24 }
|
|
25
|
|
26 // init driver
|
|
27 static int init(sh_video_t *sh){
|
|
28 sh->context = roq_decode_video_init();
|
5124
|
29 return mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,IMGFMT_YV12);
|
4989
|
30 }
|
|
31
|
|
32 // uninit driver
|
|
33 static void uninit(sh_video_t *sh){
|
|
34 }
|
|
35
|
|
36 //mp_image_t* mpcodecs_get_image(sh_video_t *sh, int mp_imgtype, int mp_imgflag, int w, int h);
|
|
37
|
|
38 // decode a frame
|
|
39 static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){
|
|
40 mp_image_t* mpi;
|
|
41 if(len<=0) return NULL; // skipped frame
|
|
42
|
|
43 mpi=mpcodecs_get_image(sh, MP_IMGTYPE_IP, MP_IMGFLAG_PRESERVE | MP_IMGFLAG_READABLE,
|
|
44 sh->disp_w, sh->disp_h);
|
|
45 if(!mpi) return NULL;
|
|
46
|
|
47 roq_decode_video(sh->context, data, len, mpi);
|
|
48
|
|
49 return mpi;
|
|
50 }
|