comparison libmpcodecs/vd_libmpeg2.c @ 4998:c32191b02a66

mpng, libmpeg2 added, none of them finished :(
author arpi
date Sat, 09 Mar 2002 02:18:33 +0000
parents
children 88481d4b9e0e
comparison
equal deleted inserted replaced
4997:5efa42dd4cd8 4998:c32191b02a66
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 decoder",
12 "libmpeg2",
13 VFM_MPEG,
14 "A'rpi",
15 "Aaron & Walken",
16 "native"
17 };
18
19 LIBVD_EXTERN(libmpeg2)
20
21 #include "libmpdemux/parse_es.h"
22
23 #include "libvo/video_out.h"
24 #include "libmpeg2/mpeg2.h"
25 #include "libmpeg2/mpeg2_internal.h"
26
27 extern picture_t *picture; // exported from libmpeg2/decode.c
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 // init driver
35 static int init(sh_video_t *sh){
36 mpeg2_init();
37 picture->pp_options=0; //divx_quality;
38 // send seq header to the decoder: *** HACK ***
39 mpeg2_decode_data(NULL,videobuffer,videobuffer+videobuf_len,0);
40 mpeg2_allocate_image_buffers (picture);
41 return 1;
42 }
43
44 // uninit driver
45 static void uninit(sh_video_t *sh){
46 mpeg2_free_image_buffers (picture);
47 }
48
49 // decode a frame
50 static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){
51 mp_image_t* mpi=mpcodecs_get_image(sh, MP_IMGTYPE_EXPORT, MP_IMGFLAG_DRAW_CALLBACK,
52 sh->disp_w, sh->disp_h);
53 mpeg2_decode_data(sh->video_out, data, data+len,flags&3); // decode
54 return mpi;
55 }
56