annotate libmpcodecs/vd_qtvideo.c @ 33168:0ee0e309677b

Fix wrong allocation. Pointer is being freed with av_freep, so make the code consistent by using av_mallocz. This fix assertion failures with systems having the align memory hack in FFmpeg. Patch by Lucius Windschuh, lwindschuh googlemail com.
author cboesch
date Thu, 14 Apr 2011 05:57:38 +0000
parents ee42c625f5ba
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
30421
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 29263
diff changeset
1 /*
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 29263
diff changeset
2 * This file is part of MPlayer.
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 29263
diff changeset
3 *
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 29263
diff changeset
4 * MPlayer is free software; you can redistribute it and/or modify
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 29263
diff changeset
5 * it under the terms of the GNU General Public License as published by
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 29263
diff changeset
6 * the Free Software Foundation; either version 2 of the License, or
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 29263
diff changeset
7 * (at your option) any later version.
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 29263
diff changeset
8 *
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 29263
diff changeset
9 * MPlayer is distributed in the hope that it will be useful,
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 29263
diff changeset
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 29263
diff changeset
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 29263
diff changeset
12 * GNU General Public License for more details.
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 29263
diff changeset
13 *
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 29263
diff changeset
14 * You should have received a copy of the GNU General Public License along
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 29263
diff changeset
15 * with MPlayer; if not, write to the Free Software Foundation, Inc.,
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 29263
diff changeset
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 29263
diff changeset
17 */
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 29263
diff changeset
18
8160
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
19 #include <stdio.h>
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
20 #include <stdlib.h>
21263
db9754cebfab Move #include <QuickTime/ImageCodec.h> before internal headers
uau
parents: 18771
diff changeset
21 #include <inttypes.h>
8160
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
22
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
23 #include "config.h"
28196
504aa3e3076a Reorder #includes and #ifdefs to avoid warnings and excessive #ifdeffery.
diego
parents: 27432
diff changeset
24 #include "mp_msg.h"
504aa3e3076a Reorder #includes and #ifdefs to avoid warnings and excessive #ifdeffery.
diego
parents: 27432
diff changeset
25 #include "mpbswap.h"
504aa3e3076a Reorder #includes and #ifdefs to avoid warnings and excessive #ifdeffery.
diego
parents: 27432
diff changeset
26 #include "vd_internal.h"
8160
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
27
27388
ac03760f7fcc Rename all preprocessor directives related to Apple / Mac OS X.
diego
parents: 26754
diff changeset
28 #ifdef CONFIG_QUICKTIME
21263
db9754cebfab Move #include <QuickTime/ImageCodec.h> before internal headers
uau
parents: 18771
diff changeset
29 #include <QuickTime/ImageCodec.h>
db9754cebfab Move #include <QuickTime/ImageCodec.h> before internal headers
uau
parents: 18771
diff changeset
30 #define dump_ImageDescription(x)
28196
504aa3e3076a Reorder #includes and #ifdefs to avoid warnings and excessive #ifdeffery.
diego
parents: 27432
diff changeset
31 #else
504aa3e3076a Reorder #includes and #ifdefs to avoid warnings and excessive #ifdeffery.
diego
parents: 27432
diff changeset
32 #include "loader/ldt_keeper.h"
504aa3e3076a Reorder #includes and #ifdefs to avoid warnings and excessive #ifdeffery.
diego
parents: 27432
diff changeset
33 #include "loader/qtx/qtxsdk/components.h"
31348
8df8a7c20f46 Replace forward declarations by proper loader/wine/winbase.h #include.
diego
parents: 30870
diff changeset
34 #include "loader/wine/winbase.h"
22577
a033e5519802 Include loader/ prefix in #include path everywhere.
diego
parents: 21264
diff changeset
35 #include "loader/wine/windef.h"
8451
fb88ccbc5ccc compiler warning fixes
arpi
parents: 8431
diff changeset
36 #endif
fb88ccbc5ccc compiler warning fixes
arpi
parents: 8431
diff changeset
37
30504
cc27da5d7286 Mark all ad_info_t/vd_info_t structure declarations as const.
diego
parents: 30421
diff changeset
38 static const vd_info_t info = {
8160
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
39 "Quicktime Video decoder",
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
40 "qtvideo",
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
41 "A'rpi",
12194
81f8e4f97b38 printf -> mp_msg, error msg when qtmlClient.dll is missing
faust3
parents: 9502
diff changeset
42 "Sascha Sommer",
8160
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
43 "win32"
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
44 };
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
45
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
46 LIBVD_EXTERN(qtvideo)
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
47
30857
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
48 static mp_image_t* mpi;
8160
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
49 static Rect OutBufferRect; //the dimensions of our GWorld
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
50
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
51 static GWorldPtr OutBufferGWorld = NULL;//a GWorld is some kind of description for a drawing environment
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
52 static ImageDescriptionHandle framedescHandle;
30857
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
53 static ImageSequence imageSeq;
8160
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
54
27388
ac03760f7fcc Rename all preprocessor directives related to Apple / Mac OS X.
diego
parents: 26754
diff changeset
55 #ifndef CONFIG_QUICKTIME
28196
504aa3e3076a Reorder #includes and #ifdefs to avoid warnings and excessive #ifdeffery.
diego
parents: 27432
diff changeset
56 static HINSTANCE qtime_qts; // handle to the preloaded quicktime.qts
504aa3e3076a Reorder #includes and #ifdefs to avoid warnings and excessive #ifdeffery.
diego
parents: 27432
diff changeset
57 static HMODULE handler;
8160
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
58 static OSErr (*InitializeQTML)(long flags);
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
59 static OSErr (*EnterMovies)(void);
30869
22ec9cfbb129 Fix libmpcodecs/vd_qtvideo.c compilation on OS X:
sesse
parents: 30857
diff changeset
60 static void (*ExitMovies)(void);
30857
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
61 static OSErr (*DecompressSequenceBegin)(ImageSequence *seqID,
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
62 ImageDescriptionHandle desc,
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
63 CGrafPtr port,
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
64 /*GDHandle*/void* gdh,
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
65 const Rect *srcRect,
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
66 MatrixRecordPtr matrix,
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
67 short mode,
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
68 RgnHandle mask,
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
69 CodecFlags flags,
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
70 CodecQ accuracy,
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
71 DecompressorComponent codec);
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
72 static OSErr (*DecompressSequenceFrameS)(ImageSequence seqID,
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
73 Ptr data,
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
74 long dataSize,
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
75 CodecFlags inFlags,
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
76 CodecFlags *outFlags,
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
77 ICMCompletionProcRecordPtr asyncCompletionProc);
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28198
diff changeset
78 static PixMapHandle (*GetGWorldPixMap)(GWorldPtr offscreenGWorld);
8160
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
79 static OSErr (*QTNewGWorldFromPtr)(GWorldPtr *gw,
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
80 OSType pixelFormat,
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
81 const Rect *boundsRect,
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
82 CTabHandle cTable,
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
83 /*GDHandle*/void* aGDevice, //unused anyway
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
84 GWorldFlags flags,
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
85 void *baseAddr,
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28198
diff changeset
86 long rowBytes);
30812
4c3685b029f7 Fix QuickTime emulated OSErr type.
sesse
parents: 30614
diff changeset
87 static Handle (*NewHandleClear)(Size byteCount);
30857
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
88 static void (*DisposeHandle)(Handle h);
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
89 static void (*DisposeGWorld)(GWorldPtr offscreenGWorld);
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
90 static OSErr (*CDSequenceEnd)(ImageSequence seqID);
27388
ac03760f7fcc Rename all preprocessor directives related to Apple / Mac OS X.
diego
parents: 26754
diff changeset
91 #endif /* #ifndef CONFIG_QUICKTIME */
8160
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
92
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
93 // to set/get/query special features/parameters
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
94 static int control(sh_video_t *sh,int cmd,void* arg,...){
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
95 return CONTROL_UNKNOWN;
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
96 }
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
97
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
98 // init driver
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
99 static int init(sh_video_t *sh){
30812
4c3685b029f7 Fix QuickTime emulated OSErr type.
sesse
parents: 30614
diff changeset
100 OSErr result = 1;
32105
c08363dc5320 Replace sizoef(type) by sizeof(*ptrvar).
reimar
parents: 31719
diff changeset
101 int extradata_size = sh->bih ? sh->bih->biSize - sizeof(*sh->bih) : 0;
31718
56e3df9c8aaa Generate a ImageDescription if none is passed neither via ImageDesc nor
reimar
parents: 31348
diff changeset
102 void *extradata = sh->bih + 1;
8160
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
103
31718
56e3df9c8aaa Generate a ImageDescription if none is passed neither via ImageDesc nor
reimar
parents: 31348
diff changeset
104 if (!sh->ImageDesc)
56e3df9c8aaa Generate a ImageDescription if none is passed neither via ImageDesc nor
reimar
parents: 31348
diff changeset
105 mp_msg(MSGT_DECVIDEO,MSGL_ERR,"sh->ImageDesc not set, try -demuxer mov if this fails.\n");
9502
241bba8f60e8 MACOSX support patch, based on Dan Christiansens work
alex
parents: 9405
diff changeset
106
30857
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
107 #ifndef CONFIG_QUICKTIME
9405
a4444e7ee56a real cygwin support by Sascha Sommer <saschasommer@freenet.de>
alex
parents: 8473
diff changeset
108 #ifdef WIN32_LOADER
8270
badd24741e4a loader support
arpi
parents: 8188
diff changeset
109 Setup_LDT_Keeper();
badd24741e4a loader support
arpi
parents: 8188
diff changeset
110 #endif
badd24741e4a loader support
arpi
parents: 8188
diff changeset
111
14528
860f06087aac preload quicktime.qts, this allows us to ignore the hardcoded path inside the dlls so that quicktime.qts doesn't need to be in the windows system dir, patch by Gianluigi Tiesi <mplayer at netfarm.it>, comments by myself
faust3
parents: 13606
diff changeset
112 //preload quicktime.qts to avoid the problems caused by the hardcoded path inside the dll
860f06087aac preload quicktime.qts, this allows us to ignore the hardcoded path inside the dlls so that quicktime.qts doesn't need to be in the windows system dir, patch by Gianluigi Tiesi <mplayer at netfarm.it>, comments by myself
faust3
parents: 13606
diff changeset
113 qtime_qts = LoadLibraryA("QuickTime.qts");
860f06087aac preload quicktime.qts, this allows us to ignore the hardcoded path inside the dlls so that quicktime.qts doesn't need to be in the windows system dir, patch by Gianluigi Tiesi <mplayer at netfarm.it>, comments by myself
faust3
parents: 13606
diff changeset
114 if(!qtime_qts){
31719
7a3b616b2dfb Some indentation fixes.
reimar
parents: 31718
diff changeset
115 mp_msg(MSGT_DECVIDEO,MSGL_ERR,"unable to load QuickTime.qts\n" );
7a3b616b2dfb Some indentation fixes.
reimar
parents: 31718
diff changeset
116 return 0;
14528
860f06087aac preload quicktime.qts, this allows us to ignore the hardcoded path inside the dlls so that quicktime.qts doesn't need to be in the windows system dir, patch by Gianluigi Tiesi <mplayer at netfarm.it>, comments by myself
faust3
parents: 13606
diff changeset
117 }
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28198
diff changeset
118
8160
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
119 handler = LoadLibraryA("qtmlClient.dll");
12194
81f8e4f97b38 printf -> mp_msg, error msg when qtmlClient.dll is missing
faust3
parents: 9502
diff changeset
120 if(!handler){
31719
7a3b616b2dfb Some indentation fixes.
reimar
parents: 31718
diff changeset
121 mp_msg(MSGT_DECVIDEO,MSGL_ERR,"unable to load qtmlClient.dll\n");
7a3b616b2dfb Some indentation fixes.
reimar
parents: 31718
diff changeset
122 return 0;
12194
81f8e4f97b38 printf -> mp_msg, error msg when qtmlClient.dll is missing
faust3
parents: 9502
diff changeset
123 }
8160
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
124
8451
fb88ccbc5ccc compiler warning fixes
arpi
parents: 8431
diff changeset
125 InitializeQTML = (OSErr (*)(long))GetProcAddress(handler, "InitializeQTML");
fb88ccbc5ccc compiler warning fixes
arpi
parents: 8431
diff changeset
126 EnterMovies = (OSErr (*)(void))GetProcAddress(handler, "EnterMovies");
30869
22ec9cfbb129 Fix libmpcodecs/vd_qtvideo.c compilation on OS X:
sesse
parents: 30857
diff changeset
127 ExitMovies = (void (*)(void))GetProcAddress(handler, "ExitMovies");
30857
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
128 DecompressSequenceBegin = (OSErr (*)(ImageSequence*,ImageDescriptionHandle,CGrafPtr,void *,const Rect *,MatrixRecordPtr,short,RgnHandle,CodecFlags,CodecQ,DecompressorComponent))GetProcAddress(handler, "DecompressSequenceBegin");
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
129 DecompressSequenceFrameS = (OSErr (*)(ImageSequence,Ptr,long,CodecFlags,CodecFlags*,ICMCompletionProcRecordPtr))GetProcAddress(handler, "DecompressSequenceFrameS");
8451
fb88ccbc5ccc compiler warning fixes
arpi
parents: 8431
diff changeset
130 GetGWorldPixMap = (PixMapHandle (*)(GWorldPtr))GetProcAddress(handler, "GetGWorldPixMap");
fb88ccbc5ccc compiler warning fixes
arpi
parents: 8431
diff changeset
131 QTNewGWorldFromPtr = (OSErr(*)(GWorldPtr *,OSType,const Rect *,CTabHandle,void*,GWorldFlags,void *,long))GetProcAddress(handler, "QTNewGWorldFromPtr");
fb88ccbc5ccc compiler warning fixes
arpi
parents: 8431
diff changeset
132 NewHandleClear = (OSErr(*)(Size))GetProcAddress(handler, "NewHandleClear");
30857
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
133 DisposeHandle = (void (*)(Handle))GetProcAddress(handler, "DisposeHandle");
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
134 DisposeGWorld = (void (*)(GWorldPtr))GetProcAddress(handler, "DisposeGWorld");
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
135 CDSequenceEnd = (OSErr (*)(ImageSequence))GetProcAddress(handler, "CDSequenceEnd");
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28198
diff changeset
136
30857
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
137 if(!InitializeQTML || !EnterMovies || !DecompressSequenceBegin || !DecompressSequenceFrameS){
12194
81f8e4f97b38 printf -> mp_msg, error msg when qtmlClient.dll is missing
faust3
parents: 9502
diff changeset
138 mp_msg(MSGT_DECVIDEO,MSGL_ERR,"invalid qtmlClient.dll!\n");
8160
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
139 return 0;
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
140 }
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
141
30857
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
142 result=InitializeQTML(kInitializeQTMLDisableDirectSound |
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
143 kInitializeQTMLUseGDIFlag |
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
144 kInitializeQTMLDisableDDClippers);
30812
4c3685b029f7 Fix QuickTime emulated OSErr type.
sesse
parents: 30614
diff changeset
145 mp_msg(MSGT_DECVIDEO,MSGL_DBG2,"InitializeQTML returned %d\n",result);
27388
ac03760f7fcc Rename all preprocessor directives related to Apple / Mac OS X.
diego
parents: 26754
diff changeset
146 #endif /* CONFIG_QUICKTIME */
8160
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
147
30857
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
148 result=EnterMovies();
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
149 mp_msg(MSGT_DECVIDEO,MSGL_DBG2,"EnterMovies returned %d\n",result);
8160
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
150
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
151 //make a yuy2 gworld
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
152 OutBufferRect.top=0;
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
153 OutBufferRect.left=0;
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
154 OutBufferRect.right=sh->disp_w;
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
155 OutBufferRect.bottom=sh->disp_h;
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
156
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
157 //Fill the imagedescription for our SVQ3 frame
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
158 //we can probably get this from Demuxer
31718
56e3df9c8aaa Generate a ImageDescription if none is passed neither via ImageDesc nor
reimar
parents: 31348
diff changeset
159 if (!sh->ImageDesc && extradata_size >= sizeof(ImageDescription) &&
56e3df9c8aaa Generate a ImageDescription if none is passed neither via ImageDesc nor
reimar
parents: 31348
diff changeset
160 ((ImageDescription *)extradata)->idSize <= extradata_size)
56e3df9c8aaa Generate a ImageDescription if none is passed neither via ImageDesc nor
reimar
parents: 31348
diff changeset
161 sh->ImageDesc = extradata;
56e3df9c8aaa Generate a ImageDescription if none is passed neither via ImageDesc nor
reimar
parents: 31348
diff changeset
162 if (sh->ImageDesc) {
31719
7a3b616b2dfb Some indentation fixes.
reimar
parents: 31718
diff changeset
163 mp_msg(MSGT_DECVIDEO,MSGL_DBG2,"ImageDescription size: %d\n",((ImageDescription*)(sh->ImageDesc))->idSize);
7a3b616b2dfb Some indentation fixes.
reimar
parents: 31718
diff changeset
164 framedescHandle=(ImageDescriptionHandle)NewHandleClear(((ImageDescription*)(sh->ImageDesc))->idSize);
7a3b616b2dfb Some indentation fixes.
reimar
parents: 31718
diff changeset
165 memcpy(*framedescHandle,sh->ImageDesc,((ImageDescription*)(sh->ImageDesc))->idSize);
31718
56e3df9c8aaa Generate a ImageDescription if none is passed neither via ImageDesc nor
reimar
parents: 31348
diff changeset
166 } else {
56e3df9c8aaa Generate a ImageDescription if none is passed neither via ImageDesc nor
reimar
parents: 31348
diff changeset
167 // assume extradata consists only of the atoms, build the other parts
56e3df9c8aaa Generate a ImageDescription if none is passed neither via ImageDesc nor
reimar
parents: 31348
diff changeset
168 ImageDescription *idesc;
56e3df9c8aaa Generate a ImageDescription if none is passed neither via ImageDesc nor
reimar
parents: 31348
diff changeset
169 int size = sizeof(*idesc) + extradata_size;
56e3df9c8aaa Generate a ImageDescription if none is passed neither via ImageDesc nor
reimar
parents: 31348
diff changeset
170 mp_msg(MSGT_DECVIDEO, MSGL_V, "Generating a ImageDescription\n");
56e3df9c8aaa Generate a ImageDescription if none is passed neither via ImageDesc nor
reimar
parents: 31348
diff changeset
171 framedescHandle=(ImageDescriptionHandle)NewHandleClear(size);
56e3df9c8aaa Generate a ImageDescription if none is passed neither via ImageDesc nor
reimar
parents: 31348
diff changeset
172 idesc = *framedescHandle;
56e3df9c8aaa Generate a ImageDescription if none is passed neither via ImageDesc nor
reimar
parents: 31348
diff changeset
173 memcpy(idesc + 1, extradata, extradata_size);
56e3df9c8aaa Generate a ImageDescription if none is passed neither via ImageDesc nor
reimar
parents: 31348
diff changeset
174 idesc->idSize = size;
56e3df9c8aaa Generate a ImageDescription if none is passed neither via ImageDesc nor
reimar
parents: 31348
diff changeset
175 idesc->width = sh->disp_w;
56e3df9c8aaa Generate a ImageDescription if none is passed neither via ImageDesc nor
reimar
parents: 31348
diff changeset
176 idesc->height = sh->disp_h;
56e3df9c8aaa Generate a ImageDescription if none is passed neither via ImageDesc nor
reimar
parents: 31348
diff changeset
177 }
32569
e1027d24244b Do not dump image description by default.
reimar
parents: 32400
diff changeset
178 if (mp_msg_test(MSGT_DECVIDEO, MSGL_V))
32570
ee42c625f5ba Reindent.
reimar
parents: 32569
diff changeset
179 dump_ImageDescription(*framedescHandle);
8160
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
180
30857
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
181 (**framedescHandle).cType = bswap_32(sh->format);
13188
f60bc2314146 small gcc warning fixes
rathann
parents: 12356
diff changeset
182 sh->context = (void *)kYUVSPixelFormat;
8282
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
183 {
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
184 int imgfmt = sh->codec->outfmt[sh->outfmtidx];
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
185 int qt_imgfmt;
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
186 switch(imgfmt)
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
187 {
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
188 case IMGFMT_YUY2:
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
189 qt_imgfmt = kYUVSPixelFormat;
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
190 break;
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
191 case IMGFMT_YVU9:
8301
d867439e3940 - fixed 10l bug (imagedesc handle allocation)
arpi
parents: 8282
diff changeset
192 qt_imgfmt = 0x73797639; //kYVU9PixelFormat;
d867439e3940 - fixed 10l bug (imagedesc handle allocation)
arpi
parents: 8282
diff changeset
193 break;
d867439e3940 - fixed 10l bug (imagedesc handle allocation)
arpi
parents: 8282
diff changeset
194 case IMGFMT_YV12:
d867439e3940 - fixed 10l bug (imagedesc handle allocation)
arpi
parents: 8282
diff changeset
195 qt_imgfmt = 0x79343230;
8282
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
196 break;
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
197 case IMGFMT_UYVY:
30857
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
198 qt_imgfmt = k2vuyPixelFormat;
8282
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
199 break;
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
200 case IMGFMT_YVYU:
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
201 qt_imgfmt = kYVYU422PixelFormat;
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
202 imgfmt = IMGFMT_YUY2;
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
203 break;
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
204 case IMGFMT_RGB16:
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
205 qt_imgfmt = k16LE555PixelFormat;
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
206 break;
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
207 case IMGFMT_BGR24:
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
208 qt_imgfmt = k24BGRPixelFormat;
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
209 break;
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
210 case IMGFMT_BGR32:
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
211 qt_imgfmt = k32BGRAPixelFormat;
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
212 break;
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
213 case IMGFMT_RGB32:
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
214 qt_imgfmt = k32RGBAPixelFormat;
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
215 break;
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
216 default:
12194
81f8e4f97b38 printf -> mp_msg, error msg when qtmlClient.dll is missing
faust3
parents: 9502
diff changeset
217 mp_msg(MSGT_DECVIDEO,MSGL_ERR,"Unknown requested csp\n");
26754
63630c09e237 cosmetics: Remove pointless parentheses from return calls.
diego
parents: 26542
diff changeset
218 return 0;
8282
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
219 }
17366
934380353fd6 massive attack: mp_msg printf format fixes
rathann
parents: 17012
diff changeset
220 mp_msg(MSGT_DECVIDEO,MSGL_DBG2,"imgfmt: %s qt_imgfmt: %.4s\n", vo_format_name(imgfmt), (char *)&qt_imgfmt);
13188
f60bc2314146 small gcc warning fixes
rathann
parents: 12356
diff changeset
221 sh->context = (void *)qt_imgfmt;
8282
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
222 if(!mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,imgfmt)) return 0;
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
223 }
8160
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
224
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28198
diff changeset
225 mpi=mpcodecs_get_image(sh, MP_IMGTYPE_STATIC, MP_IMGFLAG_PRESERVE,
8160
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
226 sh->disp_w, sh->disp_h);
30857
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
227 if(!mpi) return 0;
30614
ed516abd6137 Fix the stack crash(SYS3171) on OS/2 when playing qtaudio/qtvideo.
komh
parents: 30504
diff changeset
228
8160
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
229 result = QTNewGWorldFromPtr(
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28198
diff changeset
230 &OutBufferGWorld,
13188
f60bc2314146 small gcc warning fixes
rathann
parents: 12356
diff changeset
231 (OSType)sh->context,
8160
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
232 &OutBufferRect, //we should benchmark if yvu9 is faster for svq3, too
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28198
diff changeset
233 0,
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28198
diff changeset
234 0,
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28198
diff changeset
235 0,
8160
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
236 mpi->planes[0],
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
237 mpi->stride[0]);
30857
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
238 if (result) {
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
239 mp_msg(MSGT_DECVIDEO,MSGL_ERR,"QTNewGWorldFromPtr result=%d\n",result);
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
240 return 0;
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
241 }
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28198
diff changeset
242
30857
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
243 result = DecompressSequenceBegin(&imageSeq, framedescHandle, (CGrafPtr)OutBufferGWorld,
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
244 NULL, NULL, NULL, srcCopy, NULL, 0,
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
245 codecNormalQuality, 0);
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
246 if(result) {
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
247 mp_msg(MSGT_DECVIDEO,MSGL_ERR,"DecompressSequenceBegin result=%d\n",result);
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
248 return 0;
8430
e3804a802aac print list of supported output colorspaces
arpi
parents: 8428
diff changeset
249 }
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28198
diff changeset
250
30857
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
251 return 1;
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
252 }
8160
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
253
30857
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
254 // uninit driver
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
255 static void uninit(sh_video_t *sh){
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
256 if(OutBufferGWorld) {
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
257 DisposeGWorld(OutBufferGWorld);
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
258 OutBufferGWorld = NULL;
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
259 }
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
260 if(framedescHandle) {
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
261 DisposeHandle((Handle)framedescHandle);
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
262 framedescHandle = NULL;
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
263 }
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
264 if(imageSeq) {
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
265 CDSequenceEnd(imageSeq);
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
266 imageSeq = 0;
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
267 }
30869
22ec9cfbb129 Fix libmpcodecs/vd_qtvideo.c compilation on OS X:
sesse
parents: 30857
diff changeset
268 ExitMovies();
8160
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
269 }
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
270
30857
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
271 // decode a frame
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
272 static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
273 OSErr result = 1;
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
274 CodecFlags ignore;
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
275
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
276 if(len<=0) return NULL; // skipped frame
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
277
32400
83d15532e904 Do not call Setup_FS_Segment if the QuickTime framework is used on OSX
reimar
parents: 32105
diff changeset
278 #if defined(WIN32_LOADER) && !defined(CONFIG_QUICKTIME)
30857
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
279 Setup_FS_Segment();
8160
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
280 #endif
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
281
30857
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
282 result = DecompressSequenceFrameS(imageSeq, data, len, 0, &ignore, NULL);
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
283 if(result) {
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
284 mp_msg(MSGT_DECVIDEO,MSGL_ERR,"DecompressSequenceFrameS result=0x%d\n",result);
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
285 return NULL;
8321
ca24204fb547 SVQ1 support (ugly hack... - really we need 'syuv' support in swscaler :))
arpi
parents: 8301
diff changeset
286 }
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28198
diff changeset
287
30857
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
288 if((int)sh->context==0x73797639){ // Sorenson 16-bit YUV -> std YVU9
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
289 int i;
8321
ca24204fb547 SVQ1 support (ugly hack... - really we need 'syuv' support in swscaler :))
arpi
parents: 8301
diff changeset
290
30857
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
291 PixMap dstPixMap = **GetGWorldPixMap(OutBufferGWorld);
77ce62f13d42 Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
sesse
parents: 30812
diff changeset
292 short *src0=(short *)((char*)dstPixMap.baseAddr+0x20);
8321
ca24204fb547 SVQ1 support (ugly hack... - really we need 'syuv' support in swscaler :))
arpi
parents: 8301
diff changeset
293
ca24204fb547 SVQ1 support (ugly hack... - really we need 'syuv' support in swscaler :))
arpi
parents: 8301
diff changeset
294 for(i=0;i<mpi->h;i++){
ca24204fb547 SVQ1 support (ugly hack... - really we need 'syuv' support in swscaler :))
arpi
parents: 8301
diff changeset
295 int x;
ca24204fb547 SVQ1 support (ugly hack... - really we need 'syuv' support in swscaler :))
arpi
parents: 8301
diff changeset
296 unsigned char* dst=mpi->planes[0]+i*mpi->stride[0];
ca24204fb547 SVQ1 support (ugly hack... - really we need 'syuv' support in swscaler :))
arpi
parents: 8301
diff changeset
297 unsigned short* src=src0+i*((mpi->w+15)&(~15));
ca24204fb547 SVQ1 support (ugly hack... - really we need 'syuv' support in swscaler :))
arpi
parents: 8301
diff changeset
298 for(x=0;x<mpi->w;x++) dst[x]=src[x];
ca24204fb547 SVQ1 support (ugly hack... - really we need 'syuv' support in swscaler :))
arpi
parents: 8301
diff changeset
299 }
ca24204fb547 SVQ1 support (ugly hack... - really we need 'syuv' support in swscaler :))
arpi
parents: 8301
diff changeset
300 src0+=((mpi->w+15)&(~15))*((mpi->h+15)&(~15));
ca24204fb547 SVQ1 support (ugly hack... - really we need 'syuv' support in swscaler :))
arpi
parents: 8301
diff changeset
301 for(i=0;i<mpi->h/4;i++){
ca24204fb547 SVQ1 support (ugly hack... - really we need 'syuv' support in swscaler :))
arpi
parents: 8301
diff changeset
302 int x;
ca24204fb547 SVQ1 support (ugly hack... - really we need 'syuv' support in swscaler :))
arpi
parents: 8301
diff changeset
303 unsigned char* dst=mpi->planes[1]+i*mpi->stride[1];
ca24204fb547 SVQ1 support (ugly hack... - really we need 'syuv' support in swscaler :))
arpi
parents: 8301
diff changeset
304 unsigned short* src=src0+i*(((mpi->w+63)&(~63))/4);
ca24204fb547 SVQ1 support (ugly hack... - really we need 'syuv' support in swscaler :))
arpi
parents: 8301
diff changeset
305 for(x=0;x<mpi->w/4;x++) dst[x]=src[x];
ca24204fb547 SVQ1 support (ugly hack... - really we need 'syuv' support in swscaler :))
arpi
parents: 8301
diff changeset
306 src+=((mpi->w+63)&(~63))/4;
ca24204fb547 SVQ1 support (ugly hack... - really we need 'syuv' support in swscaler :))
arpi
parents: 8301
diff changeset
307 }
ca24204fb547 SVQ1 support (ugly hack... - really we need 'syuv' support in swscaler :))
arpi
parents: 8301
diff changeset
308 src0+=(((mpi->w+63)&(~63))/4)*(((mpi->h+63)&(~63))/4);
ca24204fb547 SVQ1 support (ugly hack... - really we need 'syuv' support in swscaler :))
arpi
parents: 8301
diff changeset
309 for(i=0;i<mpi->h/4;i++){
ca24204fb547 SVQ1 support (ugly hack... - really we need 'syuv' support in swscaler :))
arpi
parents: 8301
diff changeset
310 int x;
ca24204fb547 SVQ1 support (ugly hack... - really we need 'syuv' support in swscaler :))
arpi
parents: 8301
diff changeset
311 unsigned char* dst=mpi->planes[2]+i*mpi->stride[2];
ca24204fb547 SVQ1 support (ugly hack... - really we need 'syuv' support in swscaler :))
arpi
parents: 8301
diff changeset
312 unsigned short* src=src0+i*(((mpi->w+63)&(~63))/4);
ca24204fb547 SVQ1 support (ugly hack... - really we need 'syuv' support in swscaler :))
arpi
parents: 8301
diff changeset
313 for(x=0;x<mpi->w/4;x++) dst[x]=src[x];
ca24204fb547 SVQ1 support (ugly hack... - really we need 'syuv' support in swscaler :))
arpi
parents: 8301
diff changeset
314 src+=((mpi->w+63)&(~63))/4;
ca24204fb547 SVQ1 support (ugly hack... - really we need 'syuv' support in swscaler :))
arpi
parents: 8301
diff changeset
315 }
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28198
diff changeset
316
8321
ca24204fb547 SVQ1 support (ugly hack... - really we need 'syuv' support in swscaler :))
arpi
parents: 8301
diff changeset
317 }
ca24204fb547 SVQ1 support (ugly hack... - really we need 'syuv' support in swscaler :))
arpi
parents: 8301
diff changeset
318
ca24204fb547 SVQ1 support (ugly hack... - really we need 'syuv' support in swscaler :))
arpi
parents: 8301
diff changeset
319
8160
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
320 return mpi;
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
321 }