2010-01-30 16:57:40 +00:00
|
|
|
/*
|
|
|
|
* This file is part of MPlayer.
|
|
|
|
*
|
|
|
|
* MPlayer is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* MPlayer is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with MPlayer; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*/
|
|
|
|
|
2002-11-12 00:06:36 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
2006-11-26 19:19:00 +00:00
|
|
|
#include <inttypes.h>
|
2002-11-12 00:06:36 +00:00
|
|
|
|
|
|
|
#include "config.h"
|
2009-01-02 12:28:47 +00:00
|
|
|
#include "mp_msg.h"
|
|
|
|
#include "mpbswap.h"
|
|
|
|
#include "vd_internal.h"
|
2002-11-12 00:06:36 +00:00
|
|
|
|
2008-08-06 07:42:26 +00:00
|
|
|
#ifdef CONFIG_QUICKTIME
|
2006-11-26 19:19:00 +00:00
|
|
|
#include <QuickTime/ImageCodec.h>
|
|
|
|
#define dump_ImageDescription(x)
|
2009-01-02 12:28:47 +00:00
|
|
|
#else
|
2007-03-15 08:29:24 +00:00
|
|
|
#include "loader/ldt_keeper.h"
|
2009-01-02 12:28:47 +00:00
|
|
|
#include "loader/qtx/qtxsdk/components.h"
|
2010-06-14 14:35:57 +00:00
|
|
|
#include "loader/wine/winbase.h"
|
2009-01-02 12:28:47 +00:00
|
|
|
#include "loader/wine/windef.h"
|
2002-12-14 17:56:35 +00:00
|
|
|
#endif
|
|
|
|
|
2010-02-12 16:29:34 +00:00
|
|
|
static const vd_info_t info = {
|
2002-11-12 00:06:36 +00:00
|
|
|
"Quicktime Video decoder",
|
|
|
|
"qtvideo",
|
|
|
|
"A'rpi",
|
2004-04-13 14:48:31 +00:00
|
|
|
"Sascha Sommer",
|
2002-11-12 00:06:36 +00:00
|
|
|
"win32"
|
|
|
|
};
|
|
|
|
|
|
|
|
LIBVD_EXTERN(qtvideo)
|
|
|
|
|
Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
friends) instead of the unsupported, internal ones (ImageCodecBeginBand
etc.). This is a prerequisite for, among others, Apple ProRes 4:2:2 support,
and simplifies the file by quite a bit.
Tested on Linux with all existing QuickTime codecs I could get to work in the
first place; qt261, qtavui, qtsvq3 have no change. qtcvid appears to not give
bit-exact the same output as before, but it looks just the same in playback
to me. qt3ivx stops crashing on exit (so works better than before). With some
extra patches and a codecs.conf entry, ProRes 4:2:2 also works, including on
Linux.
Since codec initialization is now actually done on decoder init instead of on
first frame, fallback should also work a bit better (although usually, qtvideo
is last in the chain). Also made the decoder complain explicitly if the
demuxer data is not there (ie., the user tried to run without -demuxer mov).
This patch is a cleaned up version of what Andrew Wason (rectalogic A
rectalogic D com) posted to mplayer-dev-eng in June.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30899 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-03-15 12:05:56 +00:00
|
|
|
static mp_image_t* mpi;
|
2002-11-12 00:06:36 +00:00
|
|
|
static Rect OutBufferRect; //the dimensions of our GWorld
|
|
|
|
|
|
|
|
static GWorldPtr OutBufferGWorld = NULL;//a GWorld is some kind of description for a drawing environment
|
|
|
|
static ImageDescriptionHandle framedescHandle;
|
Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
friends) instead of the unsupported, internal ones (ImageCodecBeginBand
etc.). This is a prerequisite for, among others, Apple ProRes 4:2:2 support,
and simplifies the file by quite a bit.
Tested on Linux with all existing QuickTime codecs I could get to work in the
first place; qt261, qtavui, qtsvq3 have no change. qtcvid appears to not give
bit-exact the same output as before, but it looks just the same in playback
to me. qt3ivx stops crashing on exit (so works better than before). With some
extra patches and a codecs.conf entry, ProRes 4:2:2 also works, including on
Linux.
Since codec initialization is now actually done on decoder init instead of on
first frame, fallback should also work a bit better (although usually, qtvideo
is last in the chain). Also made the decoder complain explicitly if the
demuxer data is not there (ie., the user tried to run without -demuxer mov).
This patch is a cleaned up version of what Andrew Wason (rectalogic A
rectalogic D com) posted to mplayer-dev-eng in June.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30899 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-03-15 12:05:56 +00:00
|
|
|
static ImageSequence imageSeq;
|
2002-11-12 00:06:36 +00:00
|
|
|
|
2008-08-06 07:42:26 +00:00
|
|
|
#ifndef CONFIG_QUICKTIME
|
2009-01-02 12:28:47 +00:00
|
|
|
static HINSTANCE qtime_qts; // handle to the preloaded quicktime.qts
|
|
|
|
static HMODULE handler;
|
2002-11-12 00:06:36 +00:00
|
|
|
static OSErr (*InitializeQTML)(long flags);
|
|
|
|
static OSErr (*EnterMovies)(void);
|
2010-03-16 14:30:31 +00:00
|
|
|
static void (*ExitMovies)(void);
|
Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
friends) instead of the unsupported, internal ones (ImageCodecBeginBand
etc.). This is a prerequisite for, among others, Apple ProRes 4:2:2 support,
and simplifies the file by quite a bit.
Tested on Linux with all existing QuickTime codecs I could get to work in the
first place; qt261, qtavui, qtsvq3 have no change. qtcvid appears to not give
bit-exact the same output as before, but it looks just the same in playback
to me. qt3ivx stops crashing on exit (so works better than before). With some
extra patches and a codecs.conf entry, ProRes 4:2:2 also works, including on
Linux.
Since codec initialization is now actually done on decoder init instead of on
first frame, fallback should also work a bit better (although usually, qtvideo
is last in the chain). Also made the decoder complain explicitly if the
demuxer data is not there (ie., the user tried to run without -demuxer mov).
This patch is a cleaned up version of what Andrew Wason (rectalogic A
rectalogic D com) posted to mplayer-dev-eng in June.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30899 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-03-15 12:05:56 +00:00
|
|
|
static OSErr (*DecompressSequenceBegin)(ImageSequence *seqID,
|
|
|
|
ImageDescriptionHandle desc,
|
|
|
|
CGrafPtr port,
|
|
|
|
/*GDHandle*/void* gdh,
|
|
|
|
const Rect *srcRect,
|
|
|
|
MatrixRecordPtr matrix,
|
|
|
|
short mode,
|
|
|
|
RgnHandle mask,
|
|
|
|
CodecFlags flags,
|
|
|
|
CodecQ accuracy,
|
|
|
|
DecompressorComponent codec);
|
|
|
|
static OSErr (*DecompressSequenceFrameS)(ImageSequence seqID,
|
|
|
|
Ptr data,
|
|
|
|
long dataSize,
|
|
|
|
CodecFlags inFlags,
|
|
|
|
CodecFlags *outFlags,
|
|
|
|
ICMCompletionProcRecordPtr asyncCompletionProc);
|
2009-05-13 02:58:57 +00:00
|
|
|
static PixMapHandle (*GetGWorldPixMap)(GWorldPtr offscreenGWorld);
|
2002-11-12 00:06:36 +00:00
|
|
|
static OSErr (*QTNewGWorldFromPtr)(GWorldPtr *gw,
|
|
|
|
OSType pixelFormat,
|
|
|
|
const Rect *boundsRect,
|
|
|
|
CTabHandle cTable,
|
|
|
|
/*GDHandle*/void* aGDevice, //unused anyway
|
|
|
|
GWorldFlags flags,
|
|
|
|
void *baseAddr,
|
2009-05-13 02:58:57 +00:00
|
|
|
long rowBytes);
|
2010-03-06 11:12:32 +00:00
|
|
|
static Handle (*NewHandleClear)(Size byteCount);
|
Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
friends) instead of the unsupported, internal ones (ImageCodecBeginBand
etc.). This is a prerequisite for, among others, Apple ProRes 4:2:2 support,
and simplifies the file by quite a bit.
Tested on Linux with all existing QuickTime codecs I could get to work in the
first place; qt261, qtavui, qtsvq3 have no change. qtcvid appears to not give
bit-exact the same output as before, but it looks just the same in playback
to me. qt3ivx stops crashing on exit (so works better than before). With some
extra patches and a codecs.conf entry, ProRes 4:2:2 also works, including on
Linux.
Since codec initialization is now actually done on decoder init instead of on
first frame, fallback should also work a bit better (although usually, qtvideo
is last in the chain). Also made the decoder complain explicitly if the
demuxer data is not there (ie., the user tried to run without -demuxer mov).
This patch is a cleaned up version of what Andrew Wason (rectalogic A
rectalogic D com) posted to mplayer-dev-eng in June.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30899 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-03-15 12:05:56 +00:00
|
|
|
static void (*DisposeHandle)(Handle h);
|
|
|
|
static void (*DisposeGWorld)(GWorldPtr offscreenGWorld);
|
|
|
|
static OSErr (*CDSequenceEnd)(ImageSequence seqID);
|
2008-08-06 07:42:26 +00:00
|
|
|
#endif /* #ifndef CONFIG_QUICKTIME */
|
2002-11-12 00:06:36 +00:00
|
|
|
|
|
|
|
// to set/get/query special features/parameters
|
|
|
|
static int control(sh_video_t *sh,int cmd,void* arg,...){
|
|
|
|
return CONTROL_UNKNOWN;
|
|
|
|
}
|
|
|
|
|
|
|
|
// init driver
|
|
|
|
static int init(sh_video_t *sh){
|
2010-03-06 11:12:32 +00:00
|
|
|
OSErr result = 1;
|
2010-09-12 11:44:42 +00:00
|
|
|
int extradata_size = sh->bih ? sh->bih->biSize - sizeof(*sh->bih) : 0;
|
2010-07-24 16:33:22 +00:00
|
|
|
void *extradata = sh->bih + 1;
|
2002-11-12 00:06:36 +00:00
|
|
|
|
2010-07-24 16:33:22 +00:00
|
|
|
if (!sh->ImageDesc)
|
|
|
|
mp_msg(MSGT_DECVIDEO,MSGL_ERR,"sh->ImageDesc not set, try -demuxer mov if this fails.\n");
|
2003-02-25 15:39:36 +00:00
|
|
|
|
Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
friends) instead of the unsupported, internal ones (ImageCodecBeginBand
etc.). This is a prerequisite for, among others, Apple ProRes 4:2:2 support,
and simplifies the file by quite a bit.
Tested on Linux with all existing QuickTime codecs I could get to work in the
first place; qt261, qtavui, qtsvq3 have no change. qtcvid appears to not give
bit-exact the same output as before, but it looks just the same in playback
to me. qt3ivx stops crashing on exit (so works better than before). With some
extra patches and a codecs.conf entry, ProRes 4:2:2 also works, including on
Linux.
Since codec initialization is now actually done on decoder init instead of on
first frame, fallback should also work a bit better (although usually, qtvideo
is last in the chain). Also made the decoder complain explicitly if the
demuxer data is not there (ie., the user tried to run without -demuxer mov).
This patch is a cleaned up version of what Andrew Wason (rectalogic A
rectalogic D com) posted to mplayer-dev-eng in June.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30899 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-03-15 12:05:56 +00:00
|
|
|
#ifndef CONFIG_QUICKTIME
|
2003-02-12 15:39:59 +00:00
|
|
|
#ifdef WIN32_LOADER
|
2002-11-24 21:49:52 +00:00
|
|
|
Setup_LDT_Keeper();
|
|
|
|
#endif
|
|
|
|
|
2005-01-17 20:57:48 +00:00
|
|
|
//preload quicktime.qts to avoid the problems caused by the hardcoded path inside the dll
|
|
|
|
qtime_qts = LoadLibraryA("QuickTime.qts");
|
|
|
|
if(!qtime_qts){
|
2010-07-24 16:36:02 +00:00
|
|
|
mp_msg(MSGT_DECVIDEO,MSGL_ERR,"unable to load QuickTime.qts\n" );
|
|
|
|
return 0;
|
2005-01-17 20:57:48 +00:00
|
|
|
}
|
2009-05-13 02:58:57 +00:00
|
|
|
|
2002-11-12 00:06:36 +00:00
|
|
|
handler = LoadLibraryA("qtmlClient.dll");
|
2004-04-13 14:48:31 +00:00
|
|
|
if(!handler){
|
2010-07-24 16:36:02 +00:00
|
|
|
mp_msg(MSGT_DECVIDEO,MSGL_ERR,"unable to load qtmlClient.dll\n");
|
|
|
|
return 0;
|
2004-04-13 14:48:31 +00:00
|
|
|
}
|
2002-11-12 00:06:36 +00:00
|
|
|
|
2002-12-14 17:56:35 +00:00
|
|
|
InitializeQTML = (OSErr (*)(long))GetProcAddress(handler, "InitializeQTML");
|
|
|
|
EnterMovies = (OSErr (*)(void))GetProcAddress(handler, "EnterMovies");
|
2010-03-16 14:30:31 +00:00
|
|
|
ExitMovies = (void (*)(void))GetProcAddress(handler, "ExitMovies");
|
Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
friends) instead of the unsupported, internal ones (ImageCodecBeginBand
etc.). This is a prerequisite for, among others, Apple ProRes 4:2:2 support,
and simplifies the file by quite a bit.
Tested on Linux with all existing QuickTime codecs I could get to work in the
first place; qt261, qtavui, qtsvq3 have no change. qtcvid appears to not give
bit-exact the same output as before, but it looks just the same in playback
to me. qt3ivx stops crashing on exit (so works better than before). With some
extra patches and a codecs.conf entry, ProRes 4:2:2 also works, including on
Linux.
Since codec initialization is now actually done on decoder init instead of on
first frame, fallback should also work a bit better (although usually, qtvideo
is last in the chain). Also made the decoder complain explicitly if the
demuxer data is not there (ie., the user tried to run without -demuxer mov).
This patch is a cleaned up version of what Andrew Wason (rectalogic A
rectalogic D com) posted to mplayer-dev-eng in June.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30899 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-03-15 12:05:56 +00:00
|
|
|
DecompressSequenceBegin = (OSErr (*)(ImageSequence*,ImageDescriptionHandle,CGrafPtr,void *,const Rect *,MatrixRecordPtr,short,RgnHandle,CodecFlags,CodecQ,DecompressorComponent))GetProcAddress(handler, "DecompressSequenceBegin");
|
|
|
|
DecompressSequenceFrameS = (OSErr (*)(ImageSequence,Ptr,long,CodecFlags,CodecFlags*,ICMCompletionProcRecordPtr))GetProcAddress(handler, "DecompressSequenceFrameS");
|
2002-12-14 17:56:35 +00:00
|
|
|
GetGWorldPixMap = (PixMapHandle (*)(GWorldPtr))GetProcAddress(handler, "GetGWorldPixMap");
|
|
|
|
QTNewGWorldFromPtr = (OSErr(*)(GWorldPtr *,OSType,const Rect *,CTabHandle,void*,GWorldFlags,void *,long))GetProcAddress(handler, "QTNewGWorldFromPtr");
|
2012-02-27 18:15:13 +00:00
|
|
|
NewHandleClear = (Handle(*)(Size))GetProcAddress(handler, "NewHandleClear");
|
Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
friends) instead of the unsupported, internal ones (ImageCodecBeginBand
etc.). This is a prerequisite for, among others, Apple ProRes 4:2:2 support,
and simplifies the file by quite a bit.
Tested on Linux with all existing QuickTime codecs I could get to work in the
first place; qt261, qtavui, qtsvq3 have no change. qtcvid appears to not give
bit-exact the same output as before, but it looks just the same in playback
to me. qt3ivx stops crashing on exit (so works better than before). With some
extra patches and a codecs.conf entry, ProRes 4:2:2 also works, including on
Linux.
Since codec initialization is now actually done on decoder init instead of on
first frame, fallback should also work a bit better (although usually, qtvideo
is last in the chain). Also made the decoder complain explicitly if the
demuxer data is not there (ie., the user tried to run without -demuxer mov).
This patch is a cleaned up version of what Andrew Wason (rectalogic A
rectalogic D com) posted to mplayer-dev-eng in June.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30899 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-03-15 12:05:56 +00:00
|
|
|
DisposeHandle = (void (*)(Handle))GetProcAddress(handler, "DisposeHandle");
|
|
|
|
DisposeGWorld = (void (*)(GWorldPtr))GetProcAddress(handler, "DisposeGWorld");
|
|
|
|
CDSequenceEnd = (OSErr (*)(ImageSequence))GetProcAddress(handler, "CDSequenceEnd");
|
2009-05-13 02:58:57 +00:00
|
|
|
|
Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
friends) instead of the unsupported, internal ones (ImageCodecBeginBand
etc.). This is a prerequisite for, among others, Apple ProRes 4:2:2 support,
and simplifies the file by quite a bit.
Tested on Linux with all existing QuickTime codecs I could get to work in the
first place; qt261, qtavui, qtsvq3 have no change. qtcvid appears to not give
bit-exact the same output as before, but it looks just the same in playback
to me. qt3ivx stops crashing on exit (so works better than before). With some
extra patches and a codecs.conf entry, ProRes 4:2:2 also works, including on
Linux.
Since codec initialization is now actually done on decoder init instead of on
first frame, fallback should also work a bit better (although usually, qtvideo
is last in the chain). Also made the decoder complain explicitly if the
demuxer data is not there (ie., the user tried to run without -demuxer mov).
This patch is a cleaned up version of what Andrew Wason (rectalogic A
rectalogic D com) posted to mplayer-dev-eng in June.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30899 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-03-15 12:05:56 +00:00
|
|
|
if(!InitializeQTML || !EnterMovies || !DecompressSequenceBegin || !DecompressSequenceFrameS){
|
2004-04-13 14:48:31 +00:00
|
|
|
mp_msg(MSGT_DECVIDEO,MSGL_ERR,"invalid qtmlClient.dll!\n");
|
2002-11-12 00:06:36 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
friends) instead of the unsupported, internal ones (ImageCodecBeginBand
etc.). This is a prerequisite for, among others, Apple ProRes 4:2:2 support,
and simplifies the file by quite a bit.
Tested on Linux with all existing QuickTime codecs I could get to work in the
first place; qt261, qtavui, qtsvq3 have no change. qtcvid appears to not give
bit-exact the same output as before, but it looks just the same in playback
to me. qt3ivx stops crashing on exit (so works better than before). With some
extra patches and a codecs.conf entry, ProRes 4:2:2 also works, including on
Linux.
Since codec initialization is now actually done on decoder init instead of on
first frame, fallback should also work a bit better (although usually, qtvideo
is last in the chain). Also made the decoder complain explicitly if the
demuxer data is not there (ie., the user tried to run without -demuxer mov).
This patch is a cleaned up version of what Andrew Wason (rectalogic A
rectalogic D com) posted to mplayer-dev-eng in June.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30899 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-03-15 12:05:56 +00:00
|
|
|
result=InitializeQTML(kInitializeQTMLDisableDirectSound |
|
|
|
|
kInitializeQTMLUseGDIFlag |
|
|
|
|
kInitializeQTMLDisableDDClippers);
|
2010-03-06 11:12:32 +00:00
|
|
|
mp_msg(MSGT_DECVIDEO,MSGL_DBG2,"InitializeQTML returned %d\n",result);
|
2008-08-06 07:42:26 +00:00
|
|
|
#endif /* CONFIG_QUICKTIME */
|
2002-11-12 00:06:36 +00:00
|
|
|
|
Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
friends) instead of the unsupported, internal ones (ImageCodecBeginBand
etc.). This is a prerequisite for, among others, Apple ProRes 4:2:2 support,
and simplifies the file by quite a bit.
Tested on Linux with all existing QuickTime codecs I could get to work in the
first place; qt261, qtavui, qtsvq3 have no change. qtcvid appears to not give
bit-exact the same output as before, but it looks just the same in playback
to me. qt3ivx stops crashing on exit (so works better than before). With some
extra patches and a codecs.conf entry, ProRes 4:2:2 also works, including on
Linux.
Since codec initialization is now actually done on decoder init instead of on
first frame, fallback should also work a bit better (although usually, qtvideo
is last in the chain). Also made the decoder complain explicitly if the
demuxer data is not there (ie., the user tried to run without -demuxer mov).
This patch is a cleaned up version of what Andrew Wason (rectalogic A
rectalogic D com) posted to mplayer-dev-eng in June.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30899 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-03-15 12:05:56 +00:00
|
|
|
result=EnterMovies();
|
|
|
|
mp_msg(MSGT_DECVIDEO,MSGL_DBG2,"EnterMovies returned %d\n",result);
|
2002-11-12 00:06:36 +00:00
|
|
|
|
|
|
|
//make a yuy2 gworld
|
|
|
|
OutBufferRect.top=0;
|
|
|
|
OutBufferRect.left=0;
|
|
|
|
OutBufferRect.right=sh->disp_w;
|
|
|
|
OutBufferRect.bottom=sh->disp_h;
|
|
|
|
|
|
|
|
//Fill the imagedescription for our SVQ3 frame
|
|
|
|
//we can probably get this from Demuxer
|
2010-07-24 16:33:22 +00:00
|
|
|
if (!sh->ImageDesc && extradata_size >= sizeof(ImageDescription) &&
|
|
|
|
((ImageDescription *)extradata)->idSize <= extradata_size)
|
|
|
|
sh->ImageDesc = extradata;
|
|
|
|
if (sh->ImageDesc) {
|
2010-07-24 16:36:02 +00:00
|
|
|
mp_msg(MSGT_DECVIDEO,MSGL_DBG2,"ImageDescription size: %d\n",((ImageDescription*)(sh->ImageDesc))->idSize);
|
|
|
|
framedescHandle=(ImageDescriptionHandle)NewHandleClear(((ImageDescription*)(sh->ImageDesc))->idSize);
|
|
|
|
memcpy(*framedescHandle,sh->ImageDesc,((ImageDescription*)(sh->ImageDesc))->idSize);
|
2010-07-24 16:33:22 +00:00
|
|
|
} else {
|
|
|
|
// assume extradata consists only of the atoms, build the other parts
|
|
|
|
ImageDescription *idesc;
|
|
|
|
int size = sizeof(*idesc) + extradata_size;
|
|
|
|
mp_msg(MSGT_DECVIDEO, MSGL_V, "Generating a ImageDescription\n");
|
|
|
|
framedescHandle=(ImageDescriptionHandle)NewHandleClear(size);
|
|
|
|
idesc = *framedescHandle;
|
|
|
|
memcpy(idesc + 1, extradata, extradata_size);
|
|
|
|
idesc->idSize = size;
|
|
|
|
idesc->width = sh->disp_w;
|
|
|
|
idesc->height = sh->disp_h;
|
|
|
|
}
|
2010-11-27 12:23:20 +00:00
|
|
|
if (mp_msg_test(MSGT_DECVIDEO, MSGL_V))
|
|
|
|
dump_ImageDescription(*framedescHandle);
|
2002-11-12 00:06:36 +00:00
|
|
|
|
Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
friends) instead of the unsupported, internal ones (ImageCodecBeginBand
etc.). This is a prerequisite for, among others, Apple ProRes 4:2:2 support,
and simplifies the file by quite a bit.
Tested on Linux with all existing QuickTime codecs I could get to work in the
first place; qt261, qtavui, qtsvq3 have no change. qtcvid appears to not give
bit-exact the same output as before, but it looks just the same in playback
to me. qt3ivx stops crashing on exit (so works better than before). With some
extra patches and a codecs.conf entry, ProRes 4:2:2 also works, including on
Linux.
Since codec initialization is now actually done on decoder init instead of on
first frame, fallback should also work a bit better (although usually, qtvideo
is last in the chain). Also made the decoder complain explicitly if the
demuxer data is not there (ie., the user tried to run without -demuxer mov).
This patch is a cleaned up version of what Andrew Wason (rectalogic A
rectalogic D com) posted to mplayer-dev-eng in June.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30899 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-03-15 12:05:56 +00:00
|
|
|
(**framedescHandle).cType = bswap_32(sh->format);
|
2004-08-28 20:59:49 +00:00
|
|
|
sh->context = (void *)kYUVSPixelFormat;
|
2002-11-25 18:04:19 +00:00
|
|
|
{
|
|
|
|
int imgfmt = sh->codec->outfmt[sh->outfmtidx];
|
|
|
|
int qt_imgfmt;
|
|
|
|
switch(imgfmt)
|
|
|
|
{
|
|
|
|
case IMGFMT_YUY2:
|
|
|
|
qt_imgfmt = kYUVSPixelFormat;
|
|
|
|
break;
|
|
|
|
case IMGFMT_YVU9:
|
2002-11-27 23:47:14 +00:00
|
|
|
qt_imgfmt = 0x73797639; //kYVU9PixelFormat;
|
|
|
|
break;
|
|
|
|
case IMGFMT_YV12:
|
|
|
|
qt_imgfmt = 0x79343230;
|
2002-11-25 18:04:19 +00:00
|
|
|
break;
|
|
|
|
case IMGFMT_UYVY:
|
Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
friends) instead of the unsupported, internal ones (ImageCodecBeginBand
etc.). This is a prerequisite for, among others, Apple ProRes 4:2:2 support,
and simplifies the file by quite a bit.
Tested on Linux with all existing QuickTime codecs I could get to work in the
first place; qt261, qtavui, qtsvq3 have no change. qtcvid appears to not give
bit-exact the same output as before, but it looks just the same in playback
to me. qt3ivx stops crashing on exit (so works better than before). With some
extra patches and a codecs.conf entry, ProRes 4:2:2 also works, including on
Linux.
Since codec initialization is now actually done on decoder init instead of on
first frame, fallback should also work a bit better (although usually, qtvideo
is last in the chain). Also made the decoder complain explicitly if the
demuxer data is not there (ie., the user tried to run without -demuxer mov).
This patch is a cleaned up version of what Andrew Wason (rectalogic A
rectalogic D com) posted to mplayer-dev-eng in June.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30899 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-03-15 12:05:56 +00:00
|
|
|
qt_imgfmt = k2vuyPixelFormat;
|
2002-11-25 18:04:19 +00:00
|
|
|
break;
|
|
|
|
case IMGFMT_YVYU:
|
|
|
|
qt_imgfmt = kYVYU422PixelFormat;
|
|
|
|
imgfmt = IMGFMT_YUY2;
|
|
|
|
break;
|
|
|
|
case IMGFMT_RGB16:
|
|
|
|
qt_imgfmt = k16LE555PixelFormat;
|
|
|
|
break;
|
|
|
|
case IMGFMT_BGR24:
|
|
|
|
qt_imgfmt = k24BGRPixelFormat;
|
|
|
|
break;
|
|
|
|
case IMGFMT_BGR32:
|
|
|
|
qt_imgfmt = k32BGRAPixelFormat;
|
|
|
|
break;
|
|
|
|
case IMGFMT_RGB32:
|
|
|
|
qt_imgfmt = k32RGBAPixelFormat;
|
|
|
|
break;
|
|
|
|
default:
|
2004-04-13 14:48:31 +00:00
|
|
|
mp_msg(MSGT_DECVIDEO,MSGL_ERR,"Unknown requested csp\n");
|
2008-05-16 00:23:02 +00:00
|
|
|
return 0;
|
2002-11-25 18:04:19 +00:00
|
|
|
}
|
2006-01-12 20:04:36 +00:00
|
|
|
mp_msg(MSGT_DECVIDEO,MSGL_DBG2,"imgfmt: %s qt_imgfmt: %.4s\n", vo_format_name(imgfmt), (char *)&qt_imgfmt);
|
2004-08-28 20:59:49 +00:00
|
|
|
sh->context = (void *)qt_imgfmt;
|
2002-11-25 18:04:19 +00:00
|
|
|
if(!mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,imgfmt)) return 0;
|
|
|
|
}
|
2002-11-12 00:06:36 +00:00
|
|
|
|
2009-05-13 02:58:57 +00:00
|
|
|
mpi=mpcodecs_get_image(sh, MP_IMGTYPE_STATIC, MP_IMGFLAG_PRESERVE,
|
2002-11-12 00:06:36 +00:00
|
|
|
sh->disp_w, sh->disp_h);
|
Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
friends) instead of the unsupported, internal ones (ImageCodecBeginBand
etc.). This is a prerequisite for, among others, Apple ProRes 4:2:2 support,
and simplifies the file by quite a bit.
Tested on Linux with all existing QuickTime codecs I could get to work in the
first place; qt261, qtavui, qtsvq3 have no change. qtcvid appears to not give
bit-exact the same output as before, but it looks just the same in playback
to me. qt3ivx stops crashing on exit (so works better than before). With some
extra patches and a codecs.conf entry, ProRes 4:2:2 also works, including on
Linux.
Since codec initialization is now actually done on decoder init instead of on
first frame, fallback should also work a bit better (although usually, qtvideo
is last in the chain). Also made the decoder complain explicitly if the
demuxer data is not there (ie., the user tried to run without -demuxer mov).
This patch is a cleaned up version of what Andrew Wason (rectalogic A
rectalogic D com) posted to mplayer-dev-eng in June.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30899 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-03-15 12:05:56 +00:00
|
|
|
if(!mpi) return 0;
|
2002-11-12 00:06:36 +00:00
|
|
|
|
|
|
|
result = QTNewGWorldFromPtr(
|
2009-05-13 02:58:57 +00:00
|
|
|
&OutBufferGWorld,
|
2004-08-28 20:59:49 +00:00
|
|
|
(OSType)sh->context,
|
2002-11-12 00:06:36 +00:00
|
|
|
&OutBufferRect, //we should benchmark if yvu9 is faster for svq3, too
|
2009-05-13 02:58:57 +00:00
|
|
|
0,
|
|
|
|
0,
|
|
|
|
0,
|
2002-11-12 00:06:36 +00:00
|
|
|
mpi->planes[0],
|
|
|
|
mpi->stride[0]);
|
Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
friends) instead of the unsupported, internal ones (ImageCodecBeginBand
etc.). This is a prerequisite for, among others, Apple ProRes 4:2:2 support,
and simplifies the file by quite a bit.
Tested on Linux with all existing QuickTime codecs I could get to work in the
first place; qt261, qtavui, qtsvq3 have no change. qtcvid appears to not give
bit-exact the same output as before, but it looks just the same in playback
to me. qt3ivx stops crashing on exit (so works better than before). With some
extra patches and a codecs.conf entry, ProRes 4:2:2 also works, including on
Linux.
Since codec initialization is now actually done on decoder init instead of on
first frame, fallback should also work a bit better (although usually, qtvideo
is last in the chain). Also made the decoder complain explicitly if the
demuxer data is not there (ie., the user tried to run without -demuxer mov).
This patch is a cleaned up version of what Andrew Wason (rectalogic A
rectalogic D com) posted to mplayer-dev-eng in June.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30899 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-03-15 12:05:56 +00:00
|
|
|
if (result) {
|
|
|
|
mp_msg(MSGT_DECVIDEO,MSGL_ERR,"QTNewGWorldFromPtr result=%d\n",result);
|
|
|
|
return 0;
|
2002-12-11 21:39:05 +00:00
|
|
|
}
|
2009-05-13 02:58:57 +00:00
|
|
|
|
Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
friends) instead of the unsupported, internal ones (ImageCodecBeginBand
etc.). This is a prerequisite for, among others, Apple ProRes 4:2:2 support,
and simplifies the file by quite a bit.
Tested on Linux with all existing QuickTime codecs I could get to work in the
first place; qt261, qtavui, qtsvq3 have no change. qtcvid appears to not give
bit-exact the same output as before, but it looks just the same in playback
to me. qt3ivx stops crashing on exit (so works better than before). With some
extra patches and a codecs.conf entry, ProRes 4:2:2 also works, including on
Linux.
Since codec initialization is now actually done on decoder init instead of on
first frame, fallback should also work a bit better (although usually, qtvideo
is last in the chain). Also made the decoder complain explicitly if the
demuxer data is not there (ie., the user tried to run without -demuxer mov).
This patch is a cleaned up version of what Andrew Wason (rectalogic A
rectalogic D com) posted to mplayer-dev-eng in June.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30899 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-03-15 12:05:56 +00:00
|
|
|
result = DecompressSequenceBegin(&imageSeq, framedescHandle, (CGrafPtr)OutBufferGWorld,
|
|
|
|
NULL, NULL, NULL, srcCopy, NULL, 0,
|
|
|
|
codecNormalQuality, 0);
|
|
|
|
if(result) {
|
|
|
|
mp_msg(MSGT_DECVIDEO,MSGL_ERR,"DecompressSequenceBegin result=%d\n",result);
|
|
|
|
return 0;
|
|
|
|
}
|
2002-11-12 00:06:36 +00:00
|
|
|
|
Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
friends) instead of the unsupported, internal ones (ImageCodecBeginBand
etc.). This is a prerequisite for, among others, Apple ProRes 4:2:2 support,
and simplifies the file by quite a bit.
Tested on Linux with all existing QuickTime codecs I could get to work in the
first place; qt261, qtavui, qtsvq3 have no change. qtcvid appears to not give
bit-exact the same output as before, but it looks just the same in playback
to me. qt3ivx stops crashing on exit (so works better than before). With some
extra patches and a codecs.conf entry, ProRes 4:2:2 also works, including on
Linux.
Since codec initialization is now actually done on decoder init instead of on
first frame, fallback should also work a bit better (although usually, qtvideo
is last in the chain). Also made the decoder complain explicitly if the
demuxer data is not there (ie., the user tried to run without -demuxer mov).
This patch is a cleaned up version of what Andrew Wason (rectalogic A
rectalogic D com) posted to mplayer-dev-eng in June.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30899 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-03-15 12:05:56 +00:00
|
|
|
return 1;
|
2002-11-12 00:06:36 +00:00
|
|
|
}
|
|
|
|
|
Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
friends) instead of the unsupported, internal ones (ImageCodecBeginBand
etc.). This is a prerequisite for, among others, Apple ProRes 4:2:2 support,
and simplifies the file by quite a bit.
Tested on Linux with all existing QuickTime codecs I could get to work in the
first place; qt261, qtavui, qtsvq3 have no change. qtcvid appears to not give
bit-exact the same output as before, but it looks just the same in playback
to me. qt3ivx stops crashing on exit (so works better than before). With some
extra patches and a codecs.conf entry, ProRes 4:2:2 also works, including on
Linux.
Since codec initialization is now actually done on decoder init instead of on
first frame, fallback should also work a bit better (although usually, qtvideo
is last in the chain). Also made the decoder complain explicitly if the
demuxer data is not there (ie., the user tried to run without -demuxer mov).
This patch is a cleaned up version of what Andrew Wason (rectalogic A
rectalogic D com) posted to mplayer-dev-eng in June.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30899 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-03-15 12:05:56 +00:00
|
|
|
// uninit driver
|
|
|
|
static void uninit(sh_video_t *sh){
|
|
|
|
if(OutBufferGWorld) {
|
|
|
|
DisposeGWorld(OutBufferGWorld);
|
|
|
|
OutBufferGWorld = NULL;
|
2002-11-12 00:06:36 +00:00
|
|
|
}
|
Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
friends) instead of the unsupported, internal ones (ImageCodecBeginBand
etc.). This is a prerequisite for, among others, Apple ProRes 4:2:2 support,
and simplifies the file by quite a bit.
Tested on Linux with all existing QuickTime codecs I could get to work in the
first place; qt261, qtavui, qtsvq3 have no change. qtcvid appears to not give
bit-exact the same output as before, but it looks just the same in playback
to me. qt3ivx stops crashing on exit (so works better than before). With some
extra patches and a codecs.conf entry, ProRes 4:2:2 also works, including on
Linux.
Since codec initialization is now actually done on decoder init instead of on
first frame, fallback should also work a bit better (although usually, qtvideo
is last in the chain). Also made the decoder complain explicitly if the
demuxer data is not there (ie., the user tried to run without -demuxer mov).
This patch is a cleaned up version of what Andrew Wason (rectalogic A
rectalogic D com) posted to mplayer-dev-eng in June.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30899 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-03-15 12:05:56 +00:00
|
|
|
if(framedescHandle) {
|
|
|
|
DisposeHandle((Handle)framedescHandle);
|
|
|
|
framedescHandle = NULL;
|
|
|
|
}
|
|
|
|
if(imageSeq) {
|
|
|
|
CDSequenceEnd(imageSeq);
|
|
|
|
imageSeq = 0;
|
|
|
|
}
|
2010-03-16 14:30:31 +00:00
|
|
|
ExitMovies();
|
Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
friends) instead of the unsupported, internal ones (ImageCodecBeginBand
etc.). This is a prerequisite for, among others, Apple ProRes 4:2:2 support,
and simplifies the file by quite a bit.
Tested on Linux with all existing QuickTime codecs I could get to work in the
first place; qt261, qtavui, qtsvq3 have no change. qtcvid appears to not give
bit-exact the same output as before, but it looks just the same in playback
to me. qt3ivx stops crashing on exit (so works better than before). With some
extra patches and a codecs.conf entry, ProRes 4:2:2 also works, including on
Linux.
Since codec initialization is now actually done on decoder init instead of on
first frame, fallback should also work a bit better (although usually, qtvideo
is last in the chain). Also made the decoder complain explicitly if the
demuxer data is not there (ie., the user tried to run without -demuxer mov).
This patch is a cleaned up version of what Andrew Wason (rectalogic A
rectalogic D com) posted to mplayer-dev-eng in June.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30899 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-03-15 12:05:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// decode a frame
|
|
|
|
static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){
|
|
|
|
OSErr result = 1;
|
|
|
|
CodecFlags ignore;
|
2002-11-12 00:06:36 +00:00
|
|
|
|
Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
friends) instead of the unsupported, internal ones (ImageCodecBeginBand
etc.). This is a prerequisite for, among others, Apple ProRes 4:2:2 support,
and simplifies the file by quite a bit.
Tested on Linux with all existing QuickTime codecs I could get to work in the
first place; qt261, qtavui, qtsvq3 have no change. qtcvid appears to not give
bit-exact the same output as before, but it looks just the same in playback
to me. qt3ivx stops crashing on exit (so works better than before). With some
extra patches and a codecs.conf entry, ProRes 4:2:2 also works, including on
Linux.
Since codec initialization is now actually done on decoder init instead of on
first frame, fallback should also work a bit better (although usually, qtvideo
is last in the chain). Also made the decoder complain explicitly if the
demuxer data is not there (ie., the user tried to run without -demuxer mov).
This patch is a cleaned up version of what Andrew Wason (rectalogic A
rectalogic D com) posted to mplayer-dev-eng in June.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30899 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-03-15 12:05:56 +00:00
|
|
|
if(len<=0) return NULL; // skipped frame
|
2002-11-12 00:06:36 +00:00
|
|
|
|
2010-10-13 18:38:50 +00:00
|
|
|
#if defined(WIN32_LOADER) && !defined(CONFIG_QUICKTIME)
|
Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
friends) instead of the unsupported, internal ones (ImageCodecBeginBand
etc.). This is a prerequisite for, among others, Apple ProRes 4:2:2 support,
and simplifies the file by quite a bit.
Tested on Linux with all existing QuickTime codecs I could get to work in the
first place; qt261, qtavui, qtsvq3 have no change. qtcvid appears to not give
bit-exact the same output as before, but it looks just the same in playback
to me. qt3ivx stops crashing on exit (so works better than before). With some
extra patches and a codecs.conf entry, ProRes 4:2:2 also works, including on
Linux.
Since codec initialization is now actually done on decoder init instead of on
first frame, fallback should also work a bit better (although usually, qtvideo
is last in the chain). Also made the decoder complain explicitly if the
demuxer data is not there (ie., the user tried to run without -demuxer mov).
This patch is a cleaned up version of what Andrew Wason (rectalogic A
rectalogic D com) posted to mplayer-dev-eng in June.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30899 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-03-15 12:05:56 +00:00
|
|
|
Setup_FS_Segment();
|
|
|
|
#endif
|
2002-12-01 00:09:13 +00:00
|
|
|
|
Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
friends) instead of the unsupported, internal ones (ImageCodecBeginBand
etc.). This is a prerequisite for, among others, Apple ProRes 4:2:2 support,
and simplifies the file by quite a bit.
Tested on Linux with all existing QuickTime codecs I could get to work in the
first place; qt261, qtavui, qtsvq3 have no change. qtcvid appears to not give
bit-exact the same output as before, but it looks just the same in playback
to me. qt3ivx stops crashing on exit (so works better than before). With some
extra patches and a codecs.conf entry, ProRes 4:2:2 also works, including on
Linux.
Since codec initialization is now actually done on decoder init instead of on
first frame, fallback should also work a bit better (although usually, qtvideo
is last in the chain). Also made the decoder complain explicitly if the
demuxer data is not there (ie., the user tried to run without -demuxer mov).
This patch is a cleaned up version of what Andrew Wason (rectalogic A
rectalogic D com) posted to mplayer-dev-eng in June.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30899 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-03-15 12:05:56 +00:00
|
|
|
result = DecompressSequenceFrameS(imageSeq, data, len, 0, &ignore, NULL);
|
|
|
|
if(result) {
|
|
|
|
mp_msg(MSGT_DECVIDEO,MSGL_ERR,"DecompressSequenceFrameS result=0x%d\n",result);
|
|
|
|
return NULL;
|
2002-12-01 00:09:13 +00:00
|
|
|
}
|
2009-05-13 02:58:57 +00:00
|
|
|
|
2002-12-01 00:09:13 +00:00
|
|
|
if((int)sh->context==0x73797639){ // Sorenson 16-bit YUV -> std YVU9
|
Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
friends) instead of the unsupported, internal ones (ImageCodecBeginBand
etc.). This is a prerequisite for, among others, Apple ProRes 4:2:2 support,
and simplifies the file by quite a bit.
Tested on Linux with all existing QuickTime codecs I could get to work in the
first place; qt261, qtavui, qtsvq3 have no change. qtcvid appears to not give
bit-exact the same output as before, but it looks just the same in playback
to me. qt3ivx stops crashing on exit (so works better than before). With some
extra patches and a codecs.conf entry, ProRes 4:2:2 also works, including on
Linux.
Since codec initialization is now actually done on decoder init instead of on
first frame, fallback should also work a bit better (although usually, qtvideo
is last in the chain). Also made the decoder complain explicitly if the
demuxer data is not there (ie., the user tried to run without -demuxer mov).
This patch is a cleaned up version of what Andrew Wason (rectalogic A
rectalogic D com) posted to mplayer-dev-eng in June.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30899 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-03-15 12:05:56 +00:00
|
|
|
int i;
|
2002-12-01 00:09:13 +00:00
|
|
|
|
Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and
friends) instead of the unsupported, internal ones (ImageCodecBeginBand
etc.). This is a prerequisite for, among others, Apple ProRes 4:2:2 support,
and simplifies the file by quite a bit.
Tested on Linux with all existing QuickTime codecs I could get to work in the
first place; qt261, qtavui, qtsvq3 have no change. qtcvid appears to not give
bit-exact the same output as before, but it looks just the same in playback
to me. qt3ivx stops crashing on exit (so works better than before). With some
extra patches and a codecs.conf entry, ProRes 4:2:2 also works, including on
Linux.
Since codec initialization is now actually done on decoder init instead of on
first frame, fallback should also work a bit better (although usually, qtvideo
is last in the chain). Also made the decoder complain explicitly if the
demuxer data is not there (ie., the user tried to run without -demuxer mov).
This patch is a cleaned up version of what Andrew Wason (rectalogic A
rectalogic D com) posted to mplayer-dev-eng in June.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30899 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-03-15 12:05:56 +00:00
|
|
|
PixMap dstPixMap = **GetGWorldPixMap(OutBufferGWorld);
|
|
|
|
short *src0=(short *)((char*)dstPixMap.baseAddr+0x20);
|
2002-12-01 00:09:13 +00:00
|
|
|
|
|
|
|
for(i=0;i<mpi->h;i++){
|
|
|
|
int x;
|
|
|
|
unsigned char* dst=mpi->planes[0]+i*mpi->stride[0];
|
|
|
|
unsigned short* src=src0+i*((mpi->w+15)&(~15));
|
|
|
|
for(x=0;x<mpi->w;x++) dst[x]=src[x];
|
|
|
|
}
|
|
|
|
src0+=((mpi->w+15)&(~15))*((mpi->h+15)&(~15));
|
|
|
|
for(i=0;i<mpi->h/4;i++){
|
|
|
|
int x;
|
|
|
|
unsigned char* dst=mpi->planes[1]+i*mpi->stride[1];
|
|
|
|
unsigned short* src=src0+i*(((mpi->w+63)&(~63))/4);
|
|
|
|
for(x=0;x<mpi->w/4;x++) dst[x]=src[x];
|
|
|
|
src+=((mpi->w+63)&(~63))/4;
|
|
|
|
}
|
|
|
|
src0+=(((mpi->w+63)&(~63))/4)*(((mpi->h+63)&(~63))/4);
|
|
|
|
for(i=0;i<mpi->h/4;i++){
|
|
|
|
int x;
|
|
|
|
unsigned char* dst=mpi->planes[2]+i*mpi->stride[2];
|
|
|
|
unsigned short* src=src0+i*(((mpi->w+63)&(~63))/4);
|
|
|
|
for(x=0;x<mpi->w/4;x++) dst[x]=src[x];
|
|
|
|
src+=((mpi->w+63)&(~63))/4;
|
|
|
|
}
|
2009-05-13 02:58:57 +00:00
|
|
|
|
2002-12-01 00:09:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2002-11-12 00:06:36 +00:00
|
|
|
return mpi;
|
|
|
|
}
|