Re: wineqtdecoder: initial commit of the video decoder using Mac OS/X QuickTime Framework

2010-12-02 Thread Aric Stewart
Humm,  Yup you are right.  I was chatting with Ken Thomases earlier 
today and he was talking about QTKit and how it is only Objective-C and 
the next step beyond QuickTime.  I had not realized that there where no 
64 bit versions of the Quicktime framework.


I think we are stuck. Since we are using the Carbon framework not Cocoa 
we don't really have access to QTKit. We may as well use Quicktime since 
it is still available.


-aric

On 12/2/10 8:10 PM, Charles Davis wrote:

On 12/2/10 7:06 PM, Aric Stewart wrote:

That was true of the first set of APIs i used.  But I believe the
ICMDecompressionSession APIs are available on 64-bit and not deprecated.


chips-computer:/System/Library/Frameworks/QuickTime.framework chip$ nm
-arch x86_64 QuickTime
nm: file: QuickTime does not contain architecture: x86_64
chips-computer:/System/Library/Frameworks/QuickTime.framework chip$

Chip







Re: wineqtdecoder: initial commit of the video decoder using Mac OS/X QuickTime Framework

2010-12-02 Thread Charles Davis
On 12/2/10 7:06 PM, Aric Stewart wrote:
> That was true of the first set of APIs i used.  But I believe the
> ICMDecompressionSession APIs are available on 64-bit and not deprecated.

chips-computer:/System/Library/Frameworks/QuickTime.framework chip$ nm
-arch x86_64 QuickTime
nm: file: QuickTime does not contain architecture: x86_64
chips-computer:/System/Library/Frameworks/QuickTime.framework chip$

Chip




Re: wineqtdecoder: initial commit of the video decoder using Mac OS/X QuickTime Framework

2010-12-02 Thread Aric Stewart
That was true of the first set of APIs i used.  But I believe the 
ICMDecompressionSession APIs are available on 64-bit and not deprecated.


-aric

On 12/2/10 3:46 PM, C.W. Betts wrote:

The main problem when using the QuickTime C APIs is that the majority, if not 
all of it, is deprecated and not available on 64-bit code. I would suggest 
using the Objective-C QTKit, but apparently Objective-C code is a no-no in Wine.
On Nov 29, 2010, at 10:31 AM, Aric Stewart wrote:


---
configure |8 +-
configure.ac  |5 +
dlls/wineqtdecoder/Makefile.in|   11 +
dlls/wineqtdecoder/main.c |  135 +
dlls/wineqtdecoder/qtvdecoder.c   |  536 +
dlls/wineqtdecoder/version.rc |   26 ++
dlls/wineqtdecoder/wineqtdecoder.spec |4 +
7 files changed, 724 insertions(+), 1 deletions(-)
create mode 100644 dlls/wineqtdecoder/Makefile.in
create mode 100644 dlls/wineqtdecoder/main.c
create mode 100644 dlls/wineqtdecoder/qtvdecoder.c
create mode 100644 dlls/wineqtdecoder/version.rc
create mode 100644 dlls/wineqtdecoder/wineqtdecoder.spec


<89fa3b1cdaca45ec01cde9e2350010b82c985666.diff>









Re: wineqtdecoder: initial commit of the video decoder using Mac OS/X QuickTime Framework

2010-12-02 Thread C.W. Betts
The main problem when using the QuickTime C APIs is that the majority, if not 
all of it, is deprecated and not available on 64-bit code. I would suggest 
using the Objective-C QTKit, but apparently Objective-C code is a no-no in Wine.
On Nov 29, 2010, at 10:31 AM, Aric Stewart wrote:

> ---
> configure |8 +-
> configure.ac  |5 +
> dlls/wineqtdecoder/Makefile.in|   11 +
> dlls/wineqtdecoder/main.c |  135 +
> dlls/wineqtdecoder/qtvdecoder.c   |  536 +
> dlls/wineqtdecoder/version.rc |   26 ++
> dlls/wineqtdecoder/wineqtdecoder.spec |4 +
> 7 files changed, 724 insertions(+), 1 deletions(-)
> create mode 100644 dlls/wineqtdecoder/Makefile.in
> create mode 100644 dlls/wineqtdecoder/main.c
> create mode 100644 dlls/wineqtdecoder/qtvdecoder.c
> create mode 100644 dlls/wineqtdecoder/version.rc
> create mode 100644 dlls/wineqtdecoder/wineqtdecoder.spec
> 
> 
> <89fa3b1cdaca45ec01cde9e2350010b82c985666.diff>





Re: wineqtdecoder: initial commit of the video decoder using Mac OS/X QuickTime Framework

2010-11-30 Thread Aric Stewart
Sent a revised patch using the ICMDecompression apis just before seeing 
your e-mail.  So I figured out that part.


I will have to look into the pixel buffer copying improvement once the 
base framework is in place.


thanks!
-aric


On 11/30/10 10:33 AM, Ken Thomases wrote:

On Nov 30, 2010, at 6:52 AM, Alexandre Julliard wrote:


Aric Stewart  writes:


---
configure |8 +-
configure.ac  |5 +
dlls/wineqtdecoder/Makefile.in|   11 +
dlls/wineqtdecoder/main.c |  135 +
dlls/wineqtdecoder/qtvdecoder.c   |  536
+
dlls/wineqtdecoder/version.rc |   26 ++
dlls/wineqtdecoder/wineqtdecoder.spec |4 +
7 files changed, 724 insertions(+), 1 deletions(-)
create mode 100644 dlls/wineqtdecoder/Makefile.in
create mode 100644 dlls/wineqtdecoder/main.c
create mode 100644 dlls/wineqtdecoder/qtvdecoder.c
create mode 100644 dlls/wineqtdecoder/version.rc
create mode 100644 dlls/wineqtdecoder/wineqtdecoder.spec


This is showing many deprecated function warnings even on Leopard. We
should try to avoid that in new code.


Aric,

The DecompressSequenceBeginS takes a CGrafPort or GWorld.  These are QuickDraw 
concepts and are very, very obsolete.  DecompressSequenceBeginS should be 
deprecated, itself, since it depends on them, but doesn't appear to be.  The 
documentation on this whole area is terrible.  Apple seems to have blackholed 
even the documentation of the more modern APIs.  (You can still get it from 
within Xcode 3.2.x if you go into preferences and subscribe to the Leopard 
docset.  But it seems largely gone from their website.)

As is often the case, the headers provide what documentation there is.  
According to the headers 
(/System/Library/Frameworks/QuickTime.framework/Headers/ImageCompression.h), 
the replacement is ICMDecompressionSessionCreate() and friends, also in that 
header.  (That header has both old APIs and new.  You want the ones introduced 
with Mac OS X 10.4 or later, or QuickTime 7 or later.)

The ICMDecompression... functions feed you CVPixelBuffer objects through a callback.  Those are 
documented 
here.
  (Take note of the "Derived from" info at the top of that page.  If you feel that 
CVPixelBuffer is missing some important API, it may be provided by the base classes.)

The ICMDecompression... API seems kind of asynchronous in nature, but I think 
you can force it to fully decompress frames immediately via the frameTime 
parameter to ICMDecompressionSessionDecodeFrame().  The flags field of 
ICMFrameTimeRecord can include icmFrameTimeDecodeImmediately.

The next thing that might be useful are some techniques to avoid doing the pixel copying 
manually.  Depending on the output format you require (This->outputDepth and 
This->rowBytes), you may be able to create a CGBitmapContext to wrap the output buffer.  
Then, you can create a CGImage from the CVPixelBuffer, and draw the image into the context. 
 (The modern Mac APIs don't really have blit operations, they copy and/or convert images by 
drawing.)  Some of these techniques are illustrated in this sample 
code:.
  Actually, it sort of does the reverse.  It wraps the CVPixelBuffer in the bitmap context 
and draws onto it, but the principle is similar.

I hope that helps.

-Ken






Re: wineqtdecoder: initial commit of the video decoder using Mac OS/X QuickTime Framework

2010-11-30 Thread Ken Thomases
On Nov 30, 2010, at 6:52 AM, Alexandre Julliard wrote:

> Aric Stewart  writes:
> 
>> ---
>> configure |8 +-
>> configure.ac  |5 +
>> dlls/wineqtdecoder/Makefile.in|   11 +
>> dlls/wineqtdecoder/main.c |  135 +
>> dlls/wineqtdecoder/qtvdecoder.c   |  536
>> +
>> dlls/wineqtdecoder/version.rc |   26 ++
>> dlls/wineqtdecoder/wineqtdecoder.spec |4 +
>> 7 files changed, 724 insertions(+), 1 deletions(-)
>> create mode 100644 dlls/wineqtdecoder/Makefile.in
>> create mode 100644 dlls/wineqtdecoder/main.c
>> create mode 100644 dlls/wineqtdecoder/qtvdecoder.c
>> create mode 100644 dlls/wineqtdecoder/version.rc
>> create mode 100644 dlls/wineqtdecoder/wineqtdecoder.spec
> 
> This is showing many deprecated function warnings even on Leopard. We
> should try to avoid that in new code.

Aric,

The DecompressSequenceBeginS takes a CGrafPort or GWorld.  These are QuickDraw 
concepts and are very, very obsolete.  DecompressSequenceBeginS should be 
deprecated, itself, since it depends on them, but doesn't appear to be.  The 
documentation on this whole area is terrible.  Apple seems to have blackholed 
even the documentation of the more modern APIs.  (You can still get it from 
within Xcode 3.2.x if you go into preferences and subscribe to the Leopard 
docset.  But it seems largely gone from their website.)

As is often the case, the headers provide what documentation there is.  
According to the headers 
(/System/Library/Frameworks/QuickTime.framework/Headers/ImageCompression.h), 
the replacement is ICMDecompressionSessionCreate() and friends, also in that 
header.  (That header has both old APIs and new.  You want the ones introduced 
with Mac OS X 10.4 or later, or QuickTime 7 or later.)

The ICMDecompression... functions feed you CVPixelBuffer objects through a 
callback.  Those are documented here 
.
  (Take note of the "Derived from" info at the top of that page.  If you feel 
that CVPixelBuffer is missing some important API, it may be provided by the 
base classes.)

The ICMDecompression... API seems kind of asynchronous in nature, but I think 
you can force it to fully decompress frames immediately via the frameTime 
parameter to ICMDecompressionSessionDecodeFrame().  The flags field of 
ICMFrameTimeRecord can include icmFrameTimeDecodeImmediately.

The next thing that might be useful are some techniques to avoid doing the 
pixel copying manually.  Depending on the output format you require 
(This->outputDepth and This->rowBytes), you may be able to create a 
CGBitmapContext to wrap the output buffer.  Then, you can create a CGImage from 
the CVPixelBuffer, and draw the image into the context.  (The modern Mac APIs 
don't really have blit operations, they copy and/or convert images by drawing.) 
 Some of these techniques are illustrated in this sample code: 
.
  Actually, it sort of does the reverse.  It wraps the CVPixelBuffer in the 
bitmap context and draws onto it, but the principle is similar.

I hope that helps.

-Ken





Re: wineqtdecoder: initial commit of the video decoder using Mac OS/X QuickTime Framework

2010-11-30 Thread Alexandre Julliard
Aric Stewart  writes:

> ---
>  configure |8 +-
>  configure.ac  |5 +
>  dlls/wineqtdecoder/Makefile.in|   11 +
>  dlls/wineqtdecoder/main.c |  135 +
>  dlls/wineqtdecoder/qtvdecoder.c   |  536
> +
>  dlls/wineqtdecoder/version.rc |   26 ++
>  dlls/wineqtdecoder/wineqtdecoder.spec |4 +
>  7 files changed, 724 insertions(+), 1 deletions(-)
>  create mode 100644 dlls/wineqtdecoder/Makefile.in
>  create mode 100644 dlls/wineqtdecoder/main.c
>  create mode 100644 dlls/wineqtdecoder/qtvdecoder.c
>  create mode 100644 dlls/wineqtdecoder/version.rc
>  create mode 100644 dlls/wineqtdecoder/wineqtdecoder.spec

This is showing many deprecated function warnings even on Leopard. We
should try to avoid that in new code.

-- 
Alexandre Julliard
julli...@winehq.org