~ubuntu-branches/debian/sid/mplayer/sid

« back to all changes in this revision

Viewing changes to libmpcodecs/vd_qtvideo.c

  • Committer: Bazaar Package Importer
  • Author(s): A Mennucc1
  • Date: 2009-03-23 10:05:45 UTC
  • mfrom: (4.1.4 sid)
  • Revision ID: james.westby@ubuntu.com-20090323100545-x8h79obawnnte7kk
Tags: 1.0~rc2+svn20090303-5
debian/control : move docbook-xml,docbook-xsl,xsltproc from 
Build-Depends-Indep to Build-Depends, since they are needed to run
configure

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
#include <inttypes.h>
4
4
 
5
5
#include "config.h"
 
6
#include "mp_msg.h"
 
7
#include "mpbswap.h"
 
8
#include "vd_internal.h"
6
9
 
7
 
#ifdef MACOSX
 
10
#ifdef CONFIG_QUICKTIME
8
11
#include <QuickTime/ImageCodec.h>
9
12
#define dump_ImageDescription(x)
10
 
#endif
11
 
 
 
13
#else
 
14
#include "loader/ldt_keeper.h"
 
15
#include "loader/qtx/qtxsdk/components.h"
12
16
#include "loader/wine/windef.h"
13
 
 
14
 
#include "mp_msg.h"
15
 
#include "vd_internal.h"
16
 
 
17
 
#ifdef WIN32_LOADER
18
 
#include "loader/ldt_keeper.h"
19
17
#endif
20
18
 
21
19
static vd_info_t info = {
28
26
 
29
27
LIBVD_EXTERN(qtvideo)
30
28
 
31
 
#include "bswap.h"
32
 
 
33
 
#ifndef MACOSX
34
 
#include "loader/qtx/qtxsdk/components.h"
35
 
 
36
 
HMODULE   WINAPI LoadLibraryA(LPCSTR);
37
 
FARPROC   WINAPI GetProcAddress(HMODULE,LPCSTR);
38
 
int       WINAPI FreeLibrary(HMODULE);
39
 
#endif
40
 
 
41
29
//static ComponentDescription desc; // for FindNextComponent()
42
30
static ComponentInstance ci=NULL; // codec handle
43
31
//static CodecInfo cinfo;       // for ImageCodecGetCodecInfo()
50
38
 
51
39
static GWorldPtr OutBufferGWorld = NULL;//a GWorld is some kind of description for a drawing environment
52
40
static ImageDescriptionHandle framedescHandle;
53
 
static HINSTANCE qtime_qts; // handle to the preloaded quicktime.qts
54
 
static HMODULE handler;
55
41
 
56
 
#if !defined(MACOSX)
 
42
#ifndef CONFIG_QUICKTIME
 
43
HMODULE   WINAPI LoadLibraryA(LPCSTR);
 
44
FARPROC   WINAPI GetProcAddress(HMODULE,LPCSTR);
 
45
int       WINAPI FreeLibrary(HMODULE);
 
46
static    HINSTANCE qtime_qts; // handle to the preloaded quicktime.qts
 
47
static    HMODULE handler;
57
48
static    Component (*FindNextComponent)(Component prev,ComponentDescription* desc);
58
49
static    OSErr (*GetComponentInfo)(Component prev,ComponentDescription* desc,Handle h1,Handle h2,Handle h3);
59
50
static    long (*CountComponents)(ComponentDescription* desc);
66
57
                                 CodecDecompressParams * params,
67
58
                                 ImageSubCodecDecompressRecord * drp,
68
59
                                 long                   flags);
69
 
static    ComponentResult (*ImageCodecDrawBand)(ComponentInstance      ci,
70
 
                                 ImageSubCodecDecompressRecord * drp);
71
 
static    ComponentResult (*ImageCodecEndBand)(ComponentInstance      ci,
72
 
                                 ImageSubCodecDecompressRecord * drp,
73
 
                                 OSErr                  result,
74
 
                                 long                   flags);
75
60
static    ComponentResult (*ImageCodecGetCodecInfo)(ComponentInstance      ci,
76
61
                                 CodecInfo *            info);
77
62
static    ComponentResult (*ImageCodecPreDecompress)(ComponentInstance      ci,
88
73
                               void *baseAddr,
89
74
                               long rowBytes); 
90
75
static    OSErr           (*NewHandleClear)(Size byteCount);                          
91
 
#endif /* #if !defined(MACOSX) */
 
76
#endif /* #ifndef CONFIG_QUICKTIME */
92
77
 
93
78
// to set/get/query special features/parameters
94
79
static int control(sh_video_t *sh,int cmd,void* arg,...){
95
80
    return CONTROL_UNKNOWN;
96
81
}
97
82
 
98
 
static int codec_inited=0;
 
83
static int codec_initialized=0;
99
84
 
100
85
// init driver
101
86
static int init(sh_video_t *sh){
 
87
#ifndef CONFIG_QUICKTIME
102
88
    long result = 1;
 
89
#endif
103
90
    ComponentResult cres;
104
91
    ComponentDescription desc;
105
92
    Component prev=NULL;
106
93
    CodecInfo cinfo;    // for ImageCodecGetCodecInfo()
107
94
    ImageSubCodecDecompressCapabilities icap; // for ImageCodecInitialize()
108
95
 
109
 
#ifdef MACOSX
 
96
    codec_initialized = 0;
 
97
#ifdef CONFIG_QUICKTIME
110
98
    EnterMovies();
111
99
#else
112
100
 
153
141
    mp_msg(MSGT_DECVIDEO,MSGL_DBG2,"InitializeQTML returned %li\n",result);
154
142
//    result=EnterMovies();
155
143
//    printf("EnterMovies->%d\n",result);
156
 
#endif /* MACOSX */
 
144
#endif /* CONFIG_QUICKTIME */
157
145
 
158
146
#if 0
159
147
    memset(&desc,0,sizeof(desc));
195
183
    prev=FindNextComponent(NULL,&desc);
196
184
    if(!prev){
197
185
        mp_msg(MSGT_DECVIDEO,MSGL_ERR,"Cannot find requested component\n");
198
 
        return(0);
 
186
        return 0;
199
187
    }
200
188
    mp_msg(MSGT_DECVIDEO,MSGL_DBG2,"Found it! ID = %p\n",prev);
201
189
 
277
265
            break;
278
266
        default:
279
267
            mp_msg(MSGT_DECVIDEO,MSGL_ERR,"Unknown requested csp\n");
280
 
            return(0);    
 
268
            return 0;
281
269
    }
282
270
    mp_msg(MSGT_DECVIDEO,MSGL_DBG2,"imgfmt: %s qt_imgfmt: %.4s\n", vo_format_name(imgfmt), (char *)&qt_imgfmt);
283
271
    sh->context = (void *)qt_imgfmt;
292
280
 
293
281
// uninit driver
294
282
static void uninit(sh_video_t *sh){
295
 
#ifdef MACOSX
 
283
#ifdef CONFIG_QUICKTIME
296
284
    ExitMovies();
297
285
#endif
298
286
}
314
302
    decpar.bufferSize = len;
315
303
    (**framedescHandle).dataSize=len;
316
304
 
317
 
if(!codec_inited){
 
305
if(!codec_initialized){
318
306
    result = QTNewGWorldFromPtr(
319
307
        &OutBufferGWorld,  
320
308
//        kYUVSPixelFormat, //pixel format of new GWorld == YUY2
381
369
//    printf("ImageCodecPreDecompress cres=0x%X\n",cres);
382
370
 
383
371
 
384
 
    codec_inited=1;
 
372
    codec_initialized=1;
385
373
}
386
374
 
387
375
#if 0