annotate libmpcodecs/vd_libmpeg2.c @ 10033:4ecb40d73e24

Add support for Realaudio files
author rtognimp
date Wed, 30 Apr 2003 19:50:46 +0000
parents 6f293e709a39
children 2bf4914e2253
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"
8026
b465ba5897a3 usage of libmpeg2, liba52, mp3lib & svq1 can be disabled
arpi
parents: 7957
diff changeset
5 #ifdef USE_LIBMPEG2
b465ba5897a3 usage of libmpeg2, liba52, mp3lib & svq1 can be disabled
arpi
parents: 7957
diff changeset
6
4998
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
7 #include "mp_msg.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 #include "vd_internal.h"
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
10
9859
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
11 //#undef MPEG12_POSTPROC
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
12
4998
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
13 static vd_info_t info =
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
14 {
9859
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
15 "MPEG 1/2 Video decoder libmpeg2-v0.3.1",
4998
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
16 "libmpeg2",
9859
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
17 "A'rpi & Fabian Franz",
4998
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
18 "Aaron & Walken",
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
19 "native"
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
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
22 LIBVD_EXTERN(libmpeg2)
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
23
9859
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
24 //#include "libvo/video_out.h" // FIXME!!!
5465
1f9c8301a7f2 rewritten - it replaces libmpeg2/decode.c now
arpi
parents: 5360
diff changeset
25
4998
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
26 #include "libmpeg2/mpeg2.h"
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
27 #include "libmpeg2/mpeg2_internal.h"
9859
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
28 //#include "libmpeg2/convert.h"
4998
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
29
5465
1f9c8301a7f2 rewritten - it replaces libmpeg2/decode.c now
arpi
parents: 5360
diff changeset
30 #include "../cpudetect.h"
1f9c8301a7f2 rewritten - it replaces libmpeg2/decode.c now
arpi
parents: 5360
diff changeset
31
4998
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
32 // to set/get/query special features/parameters
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
33 static int control(sh_video_t *sh,int cmd,void* arg,...){
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
34 return CONTROL_UNKNOWN;
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
35 }
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
36
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
37 // init driver
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
38 static int init(sh_video_t *sh){
9859
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
39 mpeg2dec_t * mpeg2dec;
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
40 const mpeg2_info_t * info;
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
41 int accel;
5465
1f9c8301a7f2 rewritten - it replaces libmpeg2/decode.c now
arpi
parents: 5360
diff changeset
42
9859
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
43 accel = 0;
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
44 if(gCpuCaps.hasMMX)
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
45 accel |= MPEG2_ACCEL_X86_MMX;
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
46 if(gCpuCaps.hasMMX2)
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
47 accel |= MPEG2_ACCEL_X86_MMXEXT;
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
48 if(gCpuCaps.has3DNow)
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
49 accel |= MPEG2_ACCEL_X86_3DNOW;
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
50 #ifdef HAVE_MLIB
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
51 accel |= MPEG2_ACCEL_MLIB;
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
52 #endif
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
53 mpeg2_accel(accel);
5465
1f9c8301a7f2 rewritten - it replaces libmpeg2/decode.c now
arpi
parents: 5360
diff changeset
54
9859
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
55 mpeg2dec = mpeg2_init ();
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
56
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
57 if(!mpeg2dec) return 0;
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
58
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
59 mpeg2_custom_fbuf(mpeg2dec,1); // enable DR1
5675
0ff1b9ab7afc slices+field pictures fixed, initial sig11 workaround
arpi
parents: 5613
diff changeset
60
9859
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
61 sh->context=mpeg2dec;
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
62
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
63 return 1;
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
64 //return mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,IMGFMT_YV12);
4998
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
65 }
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
66
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
67 // uninit driver
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
68 static void uninit(sh_video_t *sh){
9859
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
69 mpeg2dec_t * mpeg2dec = sh->context;
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
70 mpeg2_close (mpeg2dec);
4998
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
71 }
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
72
9859
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
73 static void draw_slice (void * _sh, uint8_t ** src, unsigned int y){
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
74 sh_video_t* sh = (sh_video_t*) _sh;
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
75 mpeg2dec_t* mpeg2dec = sh->context;
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
76 const mpeg2_info_t * info = mpeg2_info (mpeg2dec);
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
77 int stride[3];
5465
1f9c8301a7f2 rewritten - it replaces libmpeg2/decode.c now
arpi
parents: 5360
diff changeset
78
9938
6f293e709a39 too verbose
alex
parents: 9925
diff changeset
79 // printf("draw_slice() y=%d \n",y);
5465
1f9c8301a7f2 rewritten - it replaces libmpeg2/decode.c now
arpi
parents: 5360
diff changeset
80
9859
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
81 stride[0]=mpeg2dec->decoder.stride;
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
82 stride[1]=stride[2]=mpeg2dec->decoder.uv_stride;
5465
1f9c8301a7f2 rewritten - it replaces libmpeg2/decode.c now
arpi
parents: 5360
diff changeset
83
9859
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
84 mpcodecs_draw_slice(sh, (uint8_t **)src,
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
85 stride, info->sequence->display_width,
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
86 (y+16<=info->sequence->display_height) ? 16 :
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
87 info->sequence->display_height-y,
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
88 0, y);
4998
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
89 }
c32191b02a66 mpng, libmpeg2 added, none of them finished :(
arpi
parents:
diff changeset
90
5465
1f9c8301a7f2 rewritten - it replaces libmpeg2/decode.c now
arpi
parents: 5360
diff changeset
91 // decode a frame
1f9c8301a7f2 rewritten - it replaces libmpeg2/decode.c now
arpi
parents: 5360
diff changeset
92 static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){
9859
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
93 mpeg2dec_t * mpeg2dec = sh->context;
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
94 const mpeg2_info_t * info = mpeg2_info (mpeg2dec);
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
95 mp_image_t* mpi=NULL;
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
96 int drop_frame, framedrop=flags&3;
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
97
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
98 // append extra 'end of frame' code:
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
99 ((char*)data+len)[0]=0;
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
100 ((char*)data+len)[1]=0;
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
101 ((char*)data+len)[2]=1;
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
102 ((char*)data+len)[3]=0xff;
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
103 len+=4;
5465
1f9c8301a7f2 rewritten - it replaces libmpeg2/decode.c now
arpi
parents: 5360
diff changeset
104
9859
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
105 mpeg2_buffer (mpeg2dec, data, data+len);
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
106
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
107 while(1){
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
108 int state=mpeg2_parse (mpeg2dec);
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
109 switch(state){
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
110 case -1:
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
111 // parsing of the passed buffer finished, return.
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
112 // if(!mpi) printf("\nNO PICTURE!\n");
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
113 return mpi;
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
114 case STATE_SEQUENCE:
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
115 // video parameters inited/changed, (re)init libvo:
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
116 if(!mpcodecs_config_vo(sh,
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
117 info->sequence->width,
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
118 info->sequence->height, IMGFMT_YV12)) return 0;
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
119 break;
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
120 case STATE_PICTURE: {
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
121 int type=info->current_picture->flags&PIC_MASK_CODING_TYPE;
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
122 mp_image_t* mpi;
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
123
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
124 drop_frame = framedrop && (mpeg2dec->decoder.coding_type == B_TYPE);
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
125 drop_frame |= framedrop>=2; // hard drop
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
126 if (drop_frame) {
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
127 mpeg2_skip(mpeg2dec, 1);
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
128 //printf("Dropping Frame ...\n");
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
129 break;
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
130 }
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
131 mpeg2_skip(mpeg2dec, 0); //mpeg2skip skips frames until set again to 0
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
132
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
133 // get_buffer "callback":
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
134 mpi=mpcodecs_get_image(sh,MP_IMGTYPE_IPB,
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
135 (type==PIC_FLAG_CODING_TYPE_B)
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
136 ? ((!framedrop && vd_use_slices &&
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
137 (info->current_picture->flags&PIC_FLAG_PROGRESSIVE_FRAME)) ?
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
138 MP_IMGFLAG_DRAW_CALLBACK:0)
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
139 : (MP_IMGFLAG_PRESERVE|MP_IMGFLAG_READABLE),
9919
4e5af551f8d0 w%8!=0 hack
arpi
parents: 9860
diff changeset
140 (info->sequence->picture_width+7)&(~7),
4e5af551f8d0 w%8!=0 hack
arpi
parents: 9860
diff changeset
141 (info->sequence->picture_height+7)&(~7) );
9859
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
142 if(!mpi) return 0; // VO ERROR!!!!!!!!
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
143 mpeg2_set_buf(mpeg2dec, mpi->planes, mpi);
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
144
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
145 #ifdef MPEG12_POSTPROC
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
146 if(!mpi->qscale){
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
147 mpi->qstride=info->sequence->picture_width>>4;
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
148 mpi->qscale=malloc(mpi->qstride*(info->sequence->picture_height>>4));
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
149 }
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
150 mpeg2dec->decoder.quant_store=mpi->qscale;
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
151 mpeg2dec->decoder.quant_stride=mpi->qstride;
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
152 mpi->pict_type=type; // 1->I, 2->P, 3->B
9925
420640a0f6d0 passing qscale_type around so the pp code can fix the mpeg2 <<1 thing
michael
parents: 9919
diff changeset
153 mpi->qscale_type= 1;
5465
1f9c8301a7f2 rewritten - it replaces libmpeg2/decode.c now
arpi
parents: 5360
diff changeset
154 #endif
1f9c8301a7f2 rewritten - it replaces libmpeg2/decode.c now
arpi
parents: 5360
diff changeset
155
9859
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
156 if(mpi->flags&MP_IMGFLAG_DRAW_CALLBACK &&
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
157 !(mpi->flags&MP_IMGFLAG_DIRECT)){
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
158 // nice, filter/vo likes draw_callback :)
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
159 mpeg2dec->decoder.convert=draw_slice;
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
160 mpeg2dec->decoder.fbuf_id=sh;
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
161 } else
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
162 mpeg2dec->decoder.convert=NULL;
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
163 break;
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
164 }
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
165 case STATE_SLICE:
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
166 case STATE_END:
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
167 // decoding done:
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
168 if(mpi) printf("AJAJJJJJJJJ2!\n");
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
169 if(info->display_fbuf) mpi=info->display_fbuf->id;
16a7d1f4da38 Rewritten, to use new libmpeg2 0.3.1 API
arpi
parents: 8026
diff changeset
170 // return mpi;
7957
31fd09cc9ba2 passing picture_type (might be usefull for postprocessing)
michael
parents: 7756
diff changeset
171 }
31fd09cc9ba2 passing picture_type (might be usefull for postprocessing)
michael
parents: 7756
diff changeset
172 }
5465
1f9c8301a7f2 rewritten - it replaces libmpeg2/decode.c now
arpi
parents: 5360
diff changeset
173 }
8026
b465ba5897a3 usage of libmpeg2, liba52, mp3lib & svq1 can be disabled
arpi
parents: 7957
diff changeset
174 #endif