annotate libmpcodecs/ve_qtvideo.c @ 30812:4c3685b029f7

Fix QuickTime emulated OSErr type. The OSErr type on Mac OS X is int16_t, not int32_t (see http://developer.apple.com/mac/library/documentation/QuickTime/Reference/QTRef_DataTypes/Reference/reference.html). The upper 16 bits will typically be something random (they're entirely undefined). Change the type so it's right; a few places tried to compensate for this by masking out the upper bits, but a few places also missed them, which made for unpredictable behavior.
author sesse
date Sat, 06 Mar 2010 11:12:32 +0000
parents a972c1a4a012
children 8df8a7c20f46
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
28111
9920b9c138f6 Replace informal GPL notices by standard GPL headers.
diego
parents: 26754
diff changeset
1 /*
9920b9c138f6 Replace informal GPL notices by standard GPL headers.
diego
parents: 26754
diff changeset
2 * QT video encoder using Win32 libs
9920b9c138f6 Replace informal GPL notices by standard GPL headers.
diego
parents: 26754
diff changeset
3 *
9920b9c138f6 Replace informal GPL notices by standard GPL headers.
diego
parents: 26754
diff changeset
4 * Copyright (C) 2002 Sascha Sommer
9920b9c138f6 Replace informal GPL notices by standard GPL headers.
diego
parents: 26754
diff changeset
5 *
9920b9c138f6 Replace informal GPL notices by standard GPL headers.
diego
parents: 26754
diff changeset
6 * This file is part of MPlayer.
9920b9c138f6 Replace informal GPL notices by standard GPL headers.
diego
parents: 26754
diff changeset
7 *
9920b9c138f6 Replace informal GPL notices by standard GPL headers.
diego
parents: 26754
diff changeset
8 * MPlayer is free software; you can redistribute it and/or modify
9920b9c138f6 Replace informal GPL notices by standard GPL headers.
diego
parents: 26754
diff changeset
9 * it under the terms of the GNU General Public License as published by
9920b9c138f6 Replace informal GPL notices by standard GPL headers.
diego
parents: 26754
diff changeset
10 * the Free Software Foundation; either version 2 of the License, or
9920b9c138f6 Replace informal GPL notices by standard GPL headers.
diego
parents: 26754
diff changeset
11 * (at your option) any later version.
9920b9c138f6 Replace informal GPL notices by standard GPL headers.
diego
parents: 26754
diff changeset
12 *
9920b9c138f6 Replace informal GPL notices by standard GPL headers.
diego
parents: 26754
diff changeset
13 * MPlayer is distributed in the hope that it will be useful,
9920b9c138f6 Replace informal GPL notices by standard GPL headers.
diego
parents: 26754
diff changeset
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9920b9c138f6 Replace informal GPL notices by standard GPL headers.
diego
parents: 26754
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9920b9c138f6 Replace informal GPL notices by standard GPL headers.
diego
parents: 26754
diff changeset
16 * GNU General Public License for more details.
9920b9c138f6 Replace informal GPL notices by standard GPL headers.
diego
parents: 26754
diff changeset
17 *
9920b9c138f6 Replace informal GPL notices by standard GPL headers.
diego
parents: 26754
diff changeset
18 * You should have received a copy of the GNU General Public License along
9920b9c138f6 Replace informal GPL notices by standard GPL headers.
diego
parents: 26754
diff changeset
19 * with MPlayer; if not, write to the Free Software Foundation, Inc.,
9920b9c138f6 Replace informal GPL notices by standard GPL headers.
diego
parents: 26754
diff changeset
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
9920b9c138f6 Replace informal GPL notices by standard GPL headers.
diego
parents: 26754
diff changeset
21 */
8471
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
22
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
23 #define MAX_IDSIZE 0x6F
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
24
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
25 #include <stdio.h>
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
26 #include <stdlib.h>
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
27 #include <string.h>
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
28
17012
6ff3379a0862 Unify include path handling, -I.. is in CFLAGS.
diego
parents: 15274
diff changeset
29 #include "config.h"
6ff3379a0862 Unify include path handling, -I.. is in CFLAGS.
diego
parents: 15274
diff changeset
30 #include "mp_msg.h"
21507
fa99b3d31d13 Hack around libavutil/bswap.h compilation problems due to always_inline undefined.
reimar
parents: 21372
diff changeset
31 #include "mpbswap.h"
8471
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
32
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28111
diff changeset
33 #ifdef WIN32_LOADER
22577
a033e5519802 Include loader/ prefix in #include path everywhere.
diego
parents: 21660
diff changeset
34 #include "loader/ldt_keeper.h"
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28111
diff changeset
35 #endif
9217
420e2b2f8e5a compiler warning fixes patch by Dominik Mierzejewski <dominik@rangers.eu.org>
arpi
parents: 9014
diff changeset
36
17012
6ff3379a0862 Unify include path handling, -I.. is in CFLAGS.
diego
parents: 15274
diff changeset
37 #include "loader/qtx/qtxsdk/components.h"
22577
a033e5519802 Include loader/ prefix in #include path everywhere.
diego
parents: 21660
diff changeset
38 #include "loader/wine/windef.h"
8471
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
39
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
40 #include "codec-cfg.h"
22600
3c2b4a866c6a Add explicit location for headers from the stream/ directory.
diego
parents: 22577
diff changeset
41 #include "stream/stream.h"
22601
ed8f90096c65 Add explicit location for headers from the libmpdemux/ directory.
diego
parents: 22600
diff changeset
42 #include "libmpdemux/demuxer.h"
ed8f90096c65 Add explicit location for headers from the libmpdemux/ directory.
diego
parents: 22600
diff changeset
43 #include "libmpdemux/stheader.h"
8471
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
44
22600
3c2b4a866c6a Add explicit location for headers from the stream/ directory.
diego
parents: 22577
diff changeset
45 #include "stream/stream.h"
22601
ed8f90096c65 Add explicit location for headers from the libmpdemux/ directory.
diego
parents: 22600
diff changeset
46 #include "libmpdemux/muxer.h"
8471
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
47
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
48 #include "img_format.h"
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
49 #include "mp_image.h"
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
50 #include "vf.h"
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
51
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
52 HMODULE WINAPI LoadLibraryA(LPCSTR);
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
53 FARPROC WINAPI GetProcAddress(HMODULE,LPCSTR);
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
54 int WINAPI FreeLibrary(HMODULE);
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: 13188
diff changeset
55 static HINSTANCE qtime_qts; //handle to preloaded quicktime.qts
8471
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
56 static HMODULE handler;
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
57
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
58 static OSErr (*FindCodec)(CodecType cType,
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
59 CodecComponent specCodec,
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
60 CompressorComponent * compressor,
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
61 DecompressorComponent * decompressor);
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
62 static OSErr (*InitializeQTML)(long flags);
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
63 static PixMapHandle (*GetGWorldPixMap)(GWorldPtr offscreenGWorld);
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
64 static OSErr (*QTNewGWorldFromPtr)(GWorldPtr *gw,
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
65 OSType pixelFormat,
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
66 const Rect *boundsRect,
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
67 CTabHandle cTable,
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
68 /*GDHandle*/void* aGDevice, /*unused anyway*/
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
69 GWorldFlags flags,
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
70 void *baseAddr,
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
71 long rowBytes);
30812
4c3685b029f7 Fix QuickTime emulated OSErr type.
sesse
parents: 30642
diff changeset
72 static Handle (*NewHandleClear)(Size byteCount);
8471
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
73 static OSErr (*CompressSequenceBegin) (
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
74 ImageSequence *seqID,
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
75 PixMapHandle src,
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
76 PixMapHandle prev,
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
77 const Rect *srcRect,
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
78 const Rect *prevRect,
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
79 short colorDepth,
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
80 CodecType cType,
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
81 CompressorComponent codec,
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
82 CodecQ spatialQuality,
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
83 CodecQ temporalQuality,
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
84 long keyFrameRate,
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
85 CTabHandle ctable,
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
86 CodecFlags flags,
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
87 ImageDescriptionHandle desc );
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
88
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
89 static OSErr (*CompressSequenceFrame) (
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
90 ImageSequence seqID,
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
91 PixMapHandle src,
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
92 const Rect *srcRect,
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
93 CodecFlags flags,
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
94 Ptr data,
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
95 long *dataSize,
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
96 UInt8 *similarity,
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
97 ICMCompletionProcRecordPtr asyncCompletionProc );
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
98
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
99 static OSErr (*GetMaxCompressionSize)(PixMapHandle src,
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
100 const Rect *srcRect,
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
101 short colorDepth,
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
102 CodecQ quality,
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
103 CodecType cType,
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
104 CompressorComponent codec,
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
105 long *size );
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
106 static OSErr (*CDSequenceEnd)( ImageSequence seqID );
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
107 static Component (*FindNextComponent)(Component prev,ComponentDescription* desc);
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
108 static long (*CountComponents)(ComponentDescription* desc);
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
109 static OSErr (*GetComponentInfo)(Component prev,ComponentDescription* desc,Handle h1,Handle h2,Handle h3);
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
110
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
111
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
112
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
113 //static int format=mmioFOURCC('S','V','Q','1');
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
114 static int format=mmioFOURCC('S','V','Q','3');
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
115
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
116
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
117
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
118 //static void *frame_in; //input frame
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
119 static void *frame_prev; //previous frame
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
120 static void *frame_comp; //compressed frame
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
121 static GWorldPtr frame_GWorld_in = NULL;//a GWorld is some kind of description for a drawing environment
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
122 static GWorldPtr frame_GWorld_prev = NULL;
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
123 static Rect FrameRect;
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
124
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
125 static CompressorComponent compressor;
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
126 static ImageDescriptionHandle desc;
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
127 static ImageSequence seq;
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
128
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
129
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
130
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
131
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
132
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
133 struct vf_priv_s {
8585
27da710563c2 the long-waited MUXER layer, and new MPEG-PS muxer
arpi
parents: 8511
diff changeset
134 muxer_stream_t* mux;
8471
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
135 //dv_encoder_t* enc;
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
136
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
137 };
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
138 #define mux_v (vf->priv->mux)
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
139
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
140 //===========================================================================//
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
141
30642
a972c1a4a012 cosmetics: Rename struct vf_instance_s --> vf_instance.
diego
parents: 29263
diff changeset
142 static int config(struct vf_instance *vf,
8471
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
143 int width, int height, int d_width, int d_height,
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
144 unsigned int flags, unsigned int outfmt){
24125
87fe090606ba Fix unused variable warning.
diego
parents: 22601
diff changeset
145 // OSErr cres;
8471
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
146 ComponentDescription cdesc;
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
147 mux_v->bih->biWidth=width;
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
148 mux_v->bih->biHeight=height;
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
149 mux_v->bih->biSizeImage=width*height*2;
12061
656a1b45b309 Use aspect from encoder for AVI vprp header
ranma
parents: 9435
diff changeset
150 mux_v->aspect = (float)d_width/d_height;
8471
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
151
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
152
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
153
15274
d42539110db9 typo, memset 0 was done on desc instead of cdesc, see bug #288
reimar
parents: 15212
diff changeset
154 memset(&cdesc,0,sizeof(cdesc));
8471
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
155 cdesc.componentType= (((unsigned char)'i')<<24)|
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
156 (((unsigned char)'m')<<16)|
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
157 (((unsigned char)'c')<<8)|
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
158 (((unsigned char)'o'));
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
159
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
160 cdesc.componentSubType=bswap_32(format);
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
161 cdesc.componentManufacturer=0;
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
162 cdesc.componentFlags=0;
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
163 cdesc.componentFlagsMask=0;
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
164
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
165
17366
934380353fd6 massive attack: mp_msg printf format fixes
rathann
parents: 17012
diff changeset
166 mp_msg(MSGT_MENCODER,MSGL_DBG2,"Count = %ld\n",CountComponents(&cdesc));
8471
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
167 compressor=FindNextComponent(NULL,&cdesc);
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
168 if(!compressor){
12195
96b366ed15ad printf -> mp_msg; print error msg when qtmlClient.dll is missing
faust3
parents: 12061
diff changeset
169 mp_msg(MSGT_MENCODER,MSGL_ERR,"Cannot find requested component\n");
26754
63630c09e237 cosmetics: Remove pointless parentheses from return calls.
diego
parents: 26280
diff changeset
170 return 0;
8471
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
171 }
17366
934380353fd6 massive attack: mp_msg printf format fixes
rathann
parents: 17012
diff changeset
172 mp_msg(MSGT_MENCODER,MSGL_DBG2,"Found it! ID = %p\n",compressor);
8471
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
173
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
174 // cres= FindCodec (fourcc,anyCodec,&compressor,&decompressor );
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
175 // printf("FindCodec returned:%i compressor: 0x%X decompressor: 0x%X\n",cres&0xFFFF,compressor,decompressor);
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
176
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
177 return 1;
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
178 }
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
179
30642
a972c1a4a012 cosmetics: Rename struct vf_instance_s --> vf_instance.
diego
parents: 29263
diff changeset
180 static int control(struct vf_instance *vf, int request, void* data){
8471
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
181
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
182 return CONTROL_UNKNOWN;
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
183 }
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
184
30642
a972c1a4a012 cosmetics: Rename struct vf_instance_s --> vf_instance.
diego
parents: 29263
diff changeset
185 static int query_format(struct vf_instance *vf, unsigned int fmt){
15212
05aa13cdf92f replace VO and VF numeric flags with #defined identifiers
henry
parents: 14878
diff changeset
186 if(fmt==IMGFMT_YUY2) return VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW;
8471
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
187 return 0;
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
188 }
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
189
25962
afa125da85cf typo fix: inited --> initialized
diego
parents: 24247
diff changeset
190 static int codec_initialized = 0;
8471
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
191
30642
a972c1a4a012 cosmetics: Rename struct vf_instance_s --> vf_instance.
diego
parents: 29263
diff changeset
192 static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts){
8471
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
193
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
194 OSErr cres;
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
195 long framesizemax;
8511
2b955a07fdcf set keyframe flag at encoding
arpi
parents: 8471
diff changeset
196 UInt8 similarity=0;
8471
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
197 long compressedsize;
13188
f60bc2314146 small gcc warning fixes
rathann
parents: 12195
diff changeset
198 OSType in_format=kYUVSPixelFormat;
8471
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
199 int width = mpi->width;
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
200 int height = mpi->height;
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
201 int stride = width*2;
25962
afa125da85cf typo fix: inited --> initialized
diego
parents: 24247
diff changeset
202 if(!codec_initialized){
8471
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
203 FrameRect.top=0;
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
204 FrameRect.left=0;
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
205 FrameRect.right=width;
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
206 FrameRect.bottom=height;
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
207 cres = QTNewGWorldFromPtr(
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
208 &frame_GWorld_in,
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
209 in_format,
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
210 &FrameRect,
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
211 0,
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
212 0,
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
213 0,
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
214 mpi->planes[0],
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
215 stride);
12195
96b366ed15ad printf -> mp_msg; print error msg when qtmlClient.dll is missing
faust3
parents: 12061
diff changeset
216 mp_msg(MSGT_MENCODER,MSGL_DBG2,"NewGWorldFromPtr returned:%i\n",cres&0xFFFF);
8471
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
217 //dunno what todo about this
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
218 frame_prev = malloc(stride * height);
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
219 cres = QTNewGWorldFromPtr(
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
220 &frame_GWorld_prev,
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
221 in_format,
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
222 &FrameRect,
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
223 0,
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
224 0,
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
225 0,
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
226 frame_prev,
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
227 stride);
12195
96b366ed15ad printf -> mp_msg; print error msg when qtmlClient.dll is missing
faust3
parents: 12061
diff changeset
228 mp_msg(MSGT_MENCODER,MSGL_DBG2,"height:%i width:%i stride:%i\n",height,width,stride);
96b366ed15ad printf -> mp_msg; print error msg when qtmlClient.dll is missing
faust3
parents: 12061
diff changeset
229 mp_msg(MSGT_MENCODER,MSGL_DBG2,"NewGWorldFromPtr returned:%i\n",cres&0xFFFF);
8471
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
230 cres= GetMaxCompressionSize (
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
231 GetGWorldPixMap(frame_GWorld_in),
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
232 &FrameRect,
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
233 24,
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
234 codecNormalQuality,
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
235 bswap_32(format),
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
236 compressor,
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
237 &framesizemax );
17366
934380353fd6 massive attack: mp_msg printf format fixes
rathann
parents: 17012
diff changeset
238 mp_msg(MSGT_MENCODER,MSGL_DBG2,"GetMaxCompressionSize returned:%i : MaxSize:%li\n",cres&0xFFFF,framesizemax);
8471
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
239 frame_comp=malloc(framesizemax);
8511
2b955a07fdcf set keyframe flag at encoding
arpi
parents: 8471
diff changeset
240
8471
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
241 desc = (ImageDescriptionHandle)NewHandleClear(MAX_IDSIZE); //memory where the desc will be stored
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
242 (*desc)->idSize=MAX_IDSIZE;
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
243
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
244 cres= CompressSequenceBegin (
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
245 &seq,
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
246 GetGWorldPixMap( frame_GWorld_in),
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
247 GetGWorldPixMap( frame_GWorld_prev),
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
248 &FrameRect,
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
249 &FrameRect,
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
250 24, // color depth
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
251 bswap_32(format), // fourcc
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
252 compressor, // codec component
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
253 codecNormalQuality, //codecNormalQuality,
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
254 codecMaxQuality, //codecNormalQuality,
8511
2b955a07fdcf set keyframe flag at encoding
arpi
parents: 8471
diff changeset
255 10*30, // keyframe rate
8471
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
256 0,
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
257 0,
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
258 desc);
12195
96b366ed15ad printf -> mp_msg; print error msg when qtmlClient.dll is missing
faust3
parents: 12061
diff changeset
259 mp_msg(MSGT_MENCODER,MSGL_DBG2,"CompressSequenceBegin returned:%i\n",cres&0xFFFF);
96b366ed15ad printf -> mp_msg; print error msg when qtmlClient.dll is missing
faust3
parents: 12061
diff changeset
260 mp_msg(MSGT_MENCODER,MSGL_DBG2,"Sequence ID:%i\n",seq);
8471
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
261
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
262 dump_ImageDescription(*desc);
25962
afa125da85cf typo fix: inited --> initialized
diego
parents: 24247
diff changeset
263 codec_initialized++;
8471
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
264 }
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
265 cres = CompressSequenceFrame (
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
266 seq,
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
267 GetGWorldPixMap(frame_GWorld_in),
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
268 &FrameRect,
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
269 0,
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
270 (char*)mux_v->buffer,
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
271 &compressedsize,
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
272 &similarity,
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
273 0);
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
274
12195
96b366ed15ad printf -> mp_msg; print error msg when qtmlClient.dll is missing
faust3
parents: 12061
diff changeset
275 if(cres&0xFFFF)mp_msg(MSGT_MENCODER,MSGL_DBG2,"CompressSequenceFrame returned:%i\n",cres&0xFFFF);
8511
2b955a07fdcf set keyframe flag at encoding
arpi
parents: 8471
diff changeset
276 #if 0
8471
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
277 printf("Size %i->%i \n",stride*height,compressedsize);
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
278 printf("Ratio: %i:1\n",(stride*height)/compressedsize);
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
279 #endif
17487
fa17424b4c7b change muxer_write_chunk() so that pts/dts _could_ be passed from encoder to muxer
michael
parents: 17366
diff changeset
280 muxer_write_chunk(mux_v, compressedsize , similarity?0:0x10, MP_NOPTS_VALUE, MP_NOPTS_VALUE);
8471
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
281
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
282 if(((*desc)->idSize)>MAX_IDSIZE){
12195
96b366ed15ad printf -> mp_msg; print error msg when qtmlClient.dll is missing
faust3
parents: 12061
diff changeset
283 mp_msg(MSGT_MENCODER,MSGL_ERR,"FATAL! idSize=%d too big, increase MAX_IDSIZE in ve_qtvideo.c!\n",((*desc)->idSize));
8471
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
284 } else {
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
285 // according to QT docs, imagedescription may be changed while encoding
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
286 // a frame (even its size may (and does!) change!)
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
287 memcpy(mux_v->bih+1,*desc,(*desc)->idSize);
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
288 }
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
289
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
290 return 1;
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
291 }
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
292
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
293 //===========================================================================//
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
294
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
295 static int vf_open(vf_instance_t *vf, char* args){
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
296 OSErr cres = 1;
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
297 vf->config=config;
14878
5723c4b2a2ea fixes for encoding of multiple files
henry
parents: 14549
diff changeset
298 vf->default_caps=VFCAP_CONSTANT;
8471
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
299 vf->control=control;
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
300 vf->query_format=query_format;
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
301 vf->put_image=put_image;
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
302 vf->priv=malloc(sizeof(struct vf_priv_s));
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
303 memset(vf->priv,0,sizeof(struct vf_priv_s));
8585
27da710563c2 the long-waited MUXER layer, and new MPEG-PS muxer
arpi
parents: 8511
diff changeset
304 vf->priv->mux=(muxer_stream_t*)args;
8471
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
305
14549
acf3241be19b Initialized BITMAPINFOHEADER to 0 to avoid problems, esp. windows has problems
reimar
parents: 14528
diff changeset
306 mux_v->bih=calloc(1, sizeof(BITMAPINFOHEADER)+MAX_IDSIZE);
8471
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
307 mux_v->bih->biSize=sizeof(BITMAPINFOHEADER)+MAX_IDSIZE;
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
308 mux_v->bih->biWidth=0;
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
309 mux_v->bih->biHeight=0;
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
310 mux_v->bih->biCompression=format;
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
311 mux_v->bih->biPlanes=1;
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
312 mux_v->bih->biBitCount=24;
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
313
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
314
9435
97b30b4b722f cygwin win32 dll support
faust3
parents: 9217
diff changeset
315 #ifdef WIN32_LOADER
8471
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
316 Setup_LDT_Keeper();
9435
97b30b4b722f cygwin win32 dll support
faust3
parents: 9217
diff changeset
317 #endif
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: 13188
diff changeset
318 //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: 13188
diff changeset
319 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: 13188
diff changeset
320 if(!qtime_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: 13188
diff changeset
321 mp_msg(MSGT_MENCODER,MSGL_ERR,"unable to load QuickTime.qts\n" );
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: 13188
diff changeset
322 return 0;
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: 13188
diff changeset
323 }
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28111
diff changeset
324
8471
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
325 handler = LoadLibraryA("qtmlClient.dll");
12195
96b366ed15ad printf -> mp_msg; print error msg when qtmlClient.dll is missing
faust3
parents: 12061
diff changeset
326 if(!handler){
96b366ed15ad printf -> mp_msg; print error msg when qtmlClient.dll is missing
faust3
parents: 12061
diff changeset
327 mp_msg(MSGT_MENCODER,MSGL_ERR,"unable to load qtmlClient.dll\n");
96b366ed15ad printf -> mp_msg; print error msg when qtmlClient.dll is missing
faust3
parents: 12061
diff changeset
328 return 0;
96b366ed15ad printf -> mp_msg; print error msg when qtmlClient.dll is missing
faust3
parents: 12061
diff changeset
329 }
8733
478561617705 compiler warning fixes by Dominik Mierzejewski <dominik@rangers.eu.org>
arpi
parents: 8585
diff changeset
330 InitializeQTML = (OSErr (*)(long))GetProcAddress(handler, "InitializeQTML");
478561617705 compiler warning fixes by Dominik Mierzejewski <dominik@rangers.eu.org>
arpi
parents: 8585
diff changeset
331 GetGWorldPixMap = (PixMapHandle (*)(GWorldPtr))GetProcAddress(handler, "GetGWorldPixMap");
478561617705 compiler warning fixes by Dominik Mierzejewski <dominik@rangers.eu.org>
arpi
parents: 8585
diff changeset
332 QTNewGWorldFromPtr = (OSErr(*)(GWorldPtr *,OSType,const Rect *,CTabHandle,void*,GWorldFlags,void *,long))GetProcAddress(handler, "QTNewGWorldFromPtr");
478561617705 compiler warning fixes by Dominik Mierzejewski <dominik@rangers.eu.org>
arpi
parents: 8585
diff changeset
333 NewHandleClear = (OSErr(*)(Size))GetProcAddress(handler, "NewHandleClear");
478561617705 compiler warning fixes by Dominik Mierzejewski <dominik@rangers.eu.org>
arpi
parents: 8585
diff changeset
334 FindCodec = (OSErr (*)(CodecType,CodecComponent,CompressorComponent *,DecompressorComponent *))GetProcAddress(handler,"FindCodec");
478561617705 compiler warning fixes by Dominik Mierzejewski <dominik@rangers.eu.org>
arpi
parents: 8585
diff changeset
335 CompressSequenceBegin = (OSErr(*)(ImageSequence *,PixMapHandle,PixMapHandle,const Rect *,const Rect *,short,CodecType,CompressorComponent,CodecQ,CodecQ,long,CTabHandle,CodecFlags,ImageDescriptionHandle))GetProcAddress(handler,"CompressSequenceBegin");
478561617705 compiler warning fixes by Dominik Mierzejewski <dominik@rangers.eu.org>
arpi
parents: 8585
diff changeset
336 CompressSequenceFrame = (OSErr(*)(ImageSequence,PixMapHandle,const Rect *,CodecFlags,Ptr,long *,UInt8 *,ICMCompletionProcRecordPtr))GetProcAddress(handler,"CompressSequenceFrame");
478561617705 compiler warning fixes by Dominik Mierzejewski <dominik@rangers.eu.org>
arpi
parents: 8585
diff changeset
337 GetMaxCompressionSize = (OSErr(*)(PixMapHandle,const Rect *,short,CodecQ,CodecType,CompressorComponent,long *))GetProcAddress(handler,"GetMaxCompressionSize");
478561617705 compiler warning fixes by Dominik Mierzejewski <dominik@rangers.eu.org>
arpi
parents: 8585
diff changeset
338 CDSequenceEnd = (OSErr (*)(ImageSequence))GetProcAddress(handler,"CDSequenceEnd");
478561617705 compiler warning fixes by Dominik Mierzejewski <dominik@rangers.eu.org>
arpi
parents: 8585
diff changeset
339 FindNextComponent = (Component (*)(Component,ComponentDescription*))GetProcAddress(handler, "FindNextComponent");
478561617705 compiler warning fixes by Dominik Mierzejewski <dominik@rangers.eu.org>
arpi
parents: 8585
diff changeset
340 CountComponents = (long (*)(ComponentDescription*))GetProcAddress(handler, "CountComponents");
478561617705 compiler warning fixes by Dominik Mierzejewski <dominik@rangers.eu.org>
arpi
parents: 8585
diff changeset
341 GetComponentInfo = (OSErr (*)(Component,ComponentDescription*,Handle,Handle,Handle))GetProcAddress(handler, "GetComponentInfo");
8471
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
342 if(!InitializeQTML ||!CompressSequenceBegin){
12195
96b366ed15ad printf -> mp_msg; print error msg when qtmlClient.dll is missing
faust3
parents: 12061
diff changeset
343 mp_msg(MSGT_MENCODER,MSGL_ERR,"invalid qt DLL!\n");
8471
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
344 return 0;
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
345 }
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
346 //printf("%i,%i,%i\n",mmioFOURCC('S','V','Q','1'),'SVQ1',bswap_32(mmioFOURCC('S','V','Q','1')));
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
347 cres=InitializeQTML(6+16);
12195
96b366ed15ad printf -> mp_msg; print error msg when qtmlClient.dll is missing
faust3
parents: 12061
diff changeset
348 mp_msg(MSGT_MENCODER,MSGL_DBG2,"InitializeQTML returned %i\n",cres);
8471
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
349 return 1;
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
350 }
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
351
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
352 vf_info_t ve_info_qtvideo = {
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
353 "Quicktime video encoder using win32 DLLs",
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
354 "qtvideo",
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
355 "Sascha Sommer",
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
356 "for internal use by mencoder",
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
357 vf_open
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
358 };
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
359
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents:
diff changeset
360 //===========================================================================//