5476
|
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 {
|
|
11 "MPEG 1/2 Video passthrough",
|
|
12 "mpegpes",
|
|
13 "A'rpi",
|
|
14 "A'rpi",
|
|
15 "for hw decoders"
|
|
16 };
|
|
17
|
|
18 LIBVD_EXTERN(mpegpes)
|
|
19
|
|
20 //#include "libmpdemux/parse_es.h"
|
|
21
|
|
22 #include "libvo/video_out.h"
|
|
23
|
|
24 // to set/get/query special features/parameters
|
|
25 static int control(sh_video_t *sh,int cmd,void* arg,...){
|
|
26 return CONTROL_UNKNOWN;
|
|
27 }
|
|
28
|
|
29 // init driver
|
|
30 static int init(sh_video_t *sh){
|
|
31 return mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,IMGFMT_MPEGPES);
|
|
32 }
|
|
33
|
|
34 // uninit driver
|
|
35 static void uninit(sh_video_t *sh){
|
|
36 }
|
|
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 static vo_mpegpes_t packet;
|
|
42 mpi=mpcodecs_get_image(sh, MP_IMGTYPE_EXPORT, 0, sh->disp_w, sh->disp_h);
|
|
43 packet.data=data;
|
|
44 packet.size=len-4;
|
|
45 packet.timestamp=sh->timer*90000.0;
|
|
46 packet.id=0x1E0; //+sh_video->ds->id;
|
|
47 mpi->planes[0]=(uint8_t*)(&packet);
|
|
48 return mpi;
|
|
49 }
|