annotate libmpcodecs/vd_libmpeg2.c @ 5003:88481d4b9e0e

divx_quality and equalizer support done
author arpi
date Sat, 09 Mar 2002 19:18:46 +0000
parents c32191b02a66
children 9c29ace24f4d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4998
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
1 #include <stdio.h>
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
2 #include <stdlib.h>
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
3
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
4 #include "config.h"
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
5 #include "mp_msg.h"
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
6
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
7 #include "vd_internal.h"
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
8
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
9 static vd_info_t info =
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
10 {
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
11 "MPEG 1/2 Video decoder",
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
12 "libmpeg2",
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
13 VFM_MPEG,
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
14 "A'rpi",
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
15 "Aaron & Walken",
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
16 "native"
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
17 };
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
18
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
19 LIBVD_EXTERN(libmpeg2)
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
20
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
21 #include "libmpdemux/parse_es.h"
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
22
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
23 #include "libvo/video_out.h"
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
24 #include "libmpeg2/mpeg2.h"
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
25 #include "libmpeg2/mpeg2_internal.h"
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
26
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
27 extern picture_t *picture; // exported from libmpeg2/decode.c
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
28
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
29 // to set/get/query special features/parameters
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
30 static int control(sh_video_t *sh,int cmd,void* arg,...){
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
31 return CONTROL_UNKNOWN;
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
32 }
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
33
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
34 // init driver
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
35 static int init(sh_video_t *sh){
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
36 mpeg2_init();
5003
88481d4b9e0e divx_quality and equalizer support done
arpi
parents: 4998
diff changeset
37 picture->pp_options=divx_quality;
4998
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
38 // send seq header to the decoder: *** HACK ***
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
39 mpeg2_decode_data(NULL,videobuffer,videobuffer+videobuf_len,0);
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
40 mpeg2_allocate_image_buffers (picture);
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
41 return 1;
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
42 }
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
43
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
44 // uninit driver
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
45 static void uninit(sh_video_t *sh){
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
46 mpeg2_free_image_buffers (picture);
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
47 }
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
48
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
49 // decode a frame
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
50 static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
51 mp_image_t* mpi=mpcodecs_get_image(sh, MP_IMGTYPE_EXPORT, MP_IMGFLAG_DRAW_CALLBACK,
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
52 sh->disp_w, sh->disp_h);
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
53 mpeg2_decode_data(sh->video_out, data, data+len,flags&3); // decode
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
54 return mpi;
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
55 }
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
56