annotate libmpcodecs/vd_odivx.c @ 7099:0b70f3dc34eb

Applied patch by Andras Mohari <mayday@varoshaza.nagyatad.hu>, with some small additions. * Replaced <UL> with <OL> where it made sense (to me :-)). * Moved "Developer Cries" into the appendix (as Appendix F) with s/Flame Wars/Developer Cries/ and s/In medias res/Developer Cries/. * Renamed "Appendix X" to "Appendix E". * Put a "Hint" inside <BLOCKQUOTE>. * Converted 3-pass encoding and mga_vid installation instructions to lists. * Converted options tables (video eq, SDL, fbdev, VESA, DXR3, TV input, DivX4Linux, AAlib) to <DL> lists. * The "sections" for MPsub and INSTALLING OSD are numbered and displayed in the TOC now. * Changed the text inside some <H4> tags.
author diego
date Tue, 27 Aug 2002 18:06:07 +0000
parents 522713337297
children 28677d779205
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4968
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
1 #include <stdio.h>
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
2 #include <stdlib.h>
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
3 #include <assert.h>
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
4
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
5 #include "config.h"
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
6 #include "mp_msg.h"
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
7 #include "help_mp.h"
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
8
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
9 #ifdef USE_DIVX
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
10
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
11 #include "vd_internal.h"
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
12
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
13 static vd_info_t info = {
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
14 #ifdef NEW_DECORE
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
15 #ifdef DECORE_DIVX5
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
16 "DivX5Linux lib (odivx mode)",
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
17 #else
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
18 "DivX4Linux lib (odivx mode)",
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
19 #endif
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
20 #else
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
21 "Opendivx 0.48 codec",
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
22 #endif
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
23 "odivx",
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
24 VFM_ODIVX,
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
25 "A'rpi",
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
26 #ifdef NEW_DECORE
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
27 "http://www.divx.com",
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
28 #else
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
29 "http://www.projectmayo.org",
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
30 #endif
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
31 "native codecs"
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
32 };
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
33
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
34 LIBVD_EXTERN(odivx)
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
35
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
36 #ifndef NEW_DECORE
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
37 #include "opendivx/decore.h"
5011
d53725339d5d postprocess.h requires for GET_PP_QUALITY_MAX - patch by Fredrik Kuivinen
arpi
parents: 5003
diff changeset
38 #include "postproc/postprocess.h"
6701
522713337297 Support for Xvid using their new api. If divx4 compatiblity is disabeled
albeu
parents: 5247
diff changeset
39 #elif HAVE_DIVX4_H
522713337297 Support for Xvid using their new api. If divx4 compatiblity is disabeled
albeu
parents: 5247
diff changeset
40 #include <divx4.h>
4968
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
41 #else
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
42 #include <decore.h>
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
43 #endif
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
44
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
45 //**************************************************************************//
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
46 // The OpenDivX stuff:
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
47 //**************************************************************************//
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
48
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
49 #ifndef NEW_DECORE
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
50
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
51 static unsigned char *opendivx_src[3];
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
52 static int opendivx_stride[3];
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
53
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
54 // callback, the opendivx decoder calls this for each frame:
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
55 void convert_linux(unsigned char *puc_y, int stride_y,
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
56 unsigned char *puc_u, unsigned char *puc_v, int stride_uv,
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
57 unsigned char *bmp, int width_y, int height_y){
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
58
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
59 // printf("convert_yuv called %dx%d stride: %d,%d\n",width_y,height_y,stride_y,stride_uv);
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
60
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
61 opendivx_src[0]=puc_y;
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
62 opendivx_src[1]=puc_u;
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
63 opendivx_src[2]=puc_v;
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
64
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
65 opendivx_stride[0]=stride_y;
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
66 opendivx_stride[1]=stride_uv;
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
67 opendivx_stride[2]=stride_uv;
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
68 }
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
69 #endif
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
70
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
71
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
72 // to set/get/query special features/parameters
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
73 static int control(sh_video_t *sh,int cmd,void* arg,...){
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
74 switch(cmd){
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
75 case VDCTRL_QUERY_MAX_PP_LEVEL:
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
76 #ifdef NEW_DECORE
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
77 return 9; // for divx4linux
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
78 #else
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
79 return GET_PP_QUALITY_MAX; // for opendivx
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
80 #endif
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
81 case VDCTRL_SET_PP_LEVEL: {
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
82 DEC_SET dec_set;
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
83 int quality=*((int*)arg);
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
84 #ifdef NEW_DECORE
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
85 if(quality<0 || quality>9) quality=9;
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
86 dec_set.postproc_level=quality*10;
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
87 #else
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
88 if(quality<0 || quality>GET_PP_QUALITY_MAX) quality=GET_PP_QUALITY_MAX;
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
89 dec_set.postproc_level=getPpModeForQuality(quality);
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
90 #endif
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
91 decore(0x123,DEC_OPT_SETPP,&dec_set,NULL);
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
92 return CONTROL_OK;
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
93 }
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
94
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
95 }
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
96
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
97 return CONTROL_UNKNOWN;
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
98 }
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
99
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
100 // init driver
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
101 static int init(sh_video_t *sh){
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
102 DEC_PARAM dec_param;
5003
88481d4b9e0e divx_quality and equalizer support done
arpi
parents: 4997
diff changeset
103 DEC_SET dec_set;
5173
4f86aad49530 decore version check for divx3 and divx5
arpi
parents: 5124
diff changeset
104
4f86aad49530 decore version check for divx3 and divx5
arpi
parents: 5124
diff changeset
105 #ifndef NEW_DECORE
4f86aad49530 decore version check for divx3 and divx5
arpi
parents: 5124
diff changeset
106 if(sh->format==mmioFOURCC('D','I','V','3')){
4f86aad49530 decore version check for divx3 and divx5
arpi
parents: 5124
diff changeset
107 mp_msg(MSGT_DECVIDEO,MSGL_INFO,"DivX 3.x not supported by opendivx decore - it requires divx4linux\n");
4f86aad49530 decore version check for divx3 and divx5
arpi
parents: 5124
diff changeset
108 return 0; // not supported
4f86aad49530 decore version check for divx3 and divx5
arpi
parents: 5124
diff changeset
109 }
4f86aad49530 decore version check for divx3 and divx5
arpi
parents: 5124
diff changeset
110 #endif
4f86aad49530 decore version check for divx3 and divx5
arpi
parents: 5124
diff changeset
111 #ifndef DECORE_DIVX5
4f86aad49530 decore version check for divx3 and divx5
arpi
parents: 5124
diff changeset
112 if(sh->format==mmioFOURCC('D','X','5','0')){
4f86aad49530 decore version check for divx3 and divx5
arpi
parents: 5124
diff changeset
113 mp_msg(MSGT_DECVIDEO,MSGL_INFO,"DivX 5.00 not supported by divx4linux decore - it requires divx5linux\n");
4f86aad49530 decore version check for divx3 and divx5
arpi
parents: 5124
diff changeset
114 return 0; // not supported
4f86aad49530 decore version check for divx3 and divx5
arpi
parents: 5124
diff changeset
115 }
4f86aad49530 decore version check for divx3 and divx5
arpi
parents: 5124
diff changeset
116 #endif
4f86aad49530 decore version check for divx3 and divx5
arpi
parents: 5124
diff changeset
117
4968
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
118 memset(&dec_param,0,sizeof(dec_param));
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
119 #ifdef NEW_DECORE
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
120 dec_param.output_format=DEC_USER;
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
121 #else
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
122 dec_param.color_depth = 32;
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
123 #endif
4997
5efa42dd4cd8 divx5 support into libmpcodecs (untested)
atmos4
parents: 4986
diff changeset
124 #ifdef DECORE_DIVX5
5247
b68774024821 Im proved Build Version selection for DivX 5.
atmos4
parents: 5173
diff changeset
125 switch(sh->format) {
b68774024821 Im proved Build Version selection for DivX 5.
atmos4
parents: 5173
diff changeset
126 case mmioFOURCC('D','I','V','3'):
b68774024821 Im proved Build Version selection for DivX 5.
atmos4
parents: 5173
diff changeset
127 dec_param.codec_version = 311;
b68774024821 Im proved Build Version selection for DivX 5.
atmos4
parents: 5173
diff changeset
128 break;
b68774024821 Im proved Build Version selection for DivX 5.
atmos4
parents: 5173
diff changeset
129 case mmioFOURCC('D','I','V','X'):
b68774024821 Im proved Build Version selection for DivX 5.
atmos4
parents: 5173
diff changeset
130 dec_param.codec_version = 400;
b68774024821 Im proved Build Version selection for DivX 5.
atmos4
parents: 5173
diff changeset
131 break;
b68774024821 Im proved Build Version selection for DivX 5.
atmos4
parents: 5173
diff changeset
132 case mmioFOURCC('D','X','5','0'):
b68774024821 Im proved Build Version selection for DivX 5.
atmos4
parents: 5173
diff changeset
133 default: // Fallback to DivX 5 behaviour
b68774024821 Im proved Build Version selection for DivX 5.
atmos4
parents: 5173
diff changeset
134 dec_param.codec_version = 500;
b68774024821 Im proved Build Version selection for DivX 5.
atmos4
parents: 5173
diff changeset
135 }
4997
5efa42dd4cd8 divx5 support into libmpcodecs (untested)
atmos4
parents: 4986
diff changeset
136 dec_param.build_number = 0;
5efa42dd4cd8 divx5 support into libmpcodecs (untested)
atmos4
parents: 4986
diff changeset
137 #endif
4968
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
138 dec_param.x_dim = sh->disp_w;
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
139 dec_param.y_dim = sh->disp_h;
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
140 decore(0x123, DEC_OPT_INIT, &dec_param, NULL);
5003
88481d4b9e0e divx_quality and equalizer support done
arpi
parents: 4997
diff changeset
141
88481d4b9e0e divx_quality and equalizer support done
arpi
parents: 4997
diff changeset
142 dec_set.postproc_level = divx_quality;
88481d4b9e0e divx_quality and equalizer support done
arpi
parents: 4997
diff changeset
143 decore(0x123, DEC_OPT_SETPP, &dec_set, NULL);
4968
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
144
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
145 mp_msg(MSGT_DECVIDEO,MSGL_V,"INFO: OpenDivX video codec init OK!\n");
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
146
5124
3dcbf67c0de0 handle error from mpcodecs_config_vo()
arpi
parents: 5037
diff changeset
147 return mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,IMGFMT_YV12);
4968
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
148 }
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
149
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
150 // uninit driver
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
151 static void uninit(sh_video_t *sh){
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
152 decore(0x123,DEC_OPT_RELEASE,NULL,NULL);
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
153 }
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
154
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
155 //mp_image_t* mpcodecs_get_image(sh_video_t *sh, int mp_imgtype, int mp_imgflag, int w, int h);
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
156
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
157 // decode a frame
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
158 static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
159 mp_image_t* mpi;
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
160 DEC_FRAME dec_frame;
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
161 #ifdef NEW_DECORE
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
162 DEC_PICTURE dec_pic;
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
163 #endif
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
164
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
165 if(len<=0) return NULL; // skipped frame
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
166
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
167 dec_frame.length = len;
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
168 dec_frame.bitstream = data;
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
169 dec_frame.render_flag = (flags&3)?0:1;
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
170
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
171 #ifdef NEW_DECORE
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
172 dec_frame.bmp=&dec_pic;
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
173 dec_pic.y=dec_pic.u=dec_pic.v=NULL;
5037
0ef48d850bc9 hopefully fixed divx5 header + xvid conflict
arpi
parents: 5011
diff changeset
174 #ifndef DEC_OPT_FRAME_311
4968
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
175 decore(0x123, DEC_OPT_FRAME, &dec_frame, NULL);
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
176 #else
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
177 decore(0x123, (sh->format==mmioFOURCC('D','I','V','3'))?DEC_OPT_FRAME_311:DEC_OPT_FRAME, &dec_frame, NULL);
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
178 #endif
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
179 #else
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
180 // opendivx:
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
181 opendivx_src[0]=NULL;
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
182 decore(0x123, 0, &dec_frame, NULL);
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
183 #endif
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
184
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
185 if(flags&3) return NULL; // framedrop
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
186
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
187 #ifdef NEW_DECORE
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
188 if(!dec_pic.y) return NULL; // bad frame
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
189 #else
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
190 if(!opendivx_src[0]) return NULL; // bad frame
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
191 #endif
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
192
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
193 mpi=mpcodecs_get_image(sh, MP_IMGTYPE_EXPORT, MP_IMGFLAG_PRESERVE,
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
194 sh->disp_w, sh->disp_h);
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
195 if(!mpi) return NULL;
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
196
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
197 #ifdef NEW_DECORE
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
198 mpi->planes[0]=dec_pic.y;
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
199 mpi->planes[1]=dec_pic.u;
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
200 mpi->planes[2]=dec_pic.v;
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
201 mpi->stride[0]=dec_pic.stride_y;
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
202 mpi->stride[1]=mpi->stride[2]=dec_pic.stride_uv;
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
203 #else
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
204 mpi->planes[0]=opendivx_src[0];
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
205 mpi->planes[1]=opendivx_src[1];
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
206 mpi->planes[2]=opendivx_src[2];
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
207 mpi->stride[0]=opendivx_stride[0];
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
208 mpi->stride[1]=opendivx_stride[1];
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
209 mpi->stride[2]=opendivx_stride[2];
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
210 #endif
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
211
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
212 return mpi;
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
213 }
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
214
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
215 #endif
236b06410b03 vfw, vfwex, odivx, divx4 added
arpi
parents:
diff changeset
216