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