Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
f9abb07f
Commit
f9abb07f
authored
Apr 05, 2011
by
Aric Stewart
Committed by
Alexandre Julliard
Apr 06, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wineqtdecoder: Move pixel buffer access to utility module.
parent
ed71339d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
196 additions
and
39 deletions
+196
-39
Makefile.in
dlls/wineqtdecoder/Makefile.in
+1
-0
qtprivate.h
dlls/wineqtdecoder/qtprivate.h
+21
-0
qtutils.c
dlls/wineqtdecoder/qtutils.c
+160
-0
qtvdecoder.c
dlls/wineqtdecoder/qtvdecoder.c
+14
-39
No files found.
dlls/wineqtdecoder/Makefile.in
View file @
f9abb07f
...
...
@@ -4,6 +4,7 @@ EXTRALIBS = @QUICKTIMELIB@
C_SRCS
=
\
main.c
\
qtutils.c
\
qtvdecoder.c
@MAKE_DLL_RULES@
dlls/wineqtdecoder/qtprivate.h
0 → 100644
View file @
f9abb07f
/*
* QuickTime Toolkit decoder header
*
* Copyright 2011 Aric Stewart, CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
HRESULT
AccessPixelBufferPixels
(
CVPixelBufferRef
pixelBuffer
,
LPBYTE
pbDstStream
);
dlls/wineqtdecoder/qtutils.c
0 → 100644
View file @
f9abb07f
/*
* QuickTime Toolkit decoder utils
*
* Copyright 2011 Aric Stewart, CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#define ULONG CoreFoundation_ULONG
#define HRESULT CoreFoundation_HRESULT
#define LoadResource __carbon_LoadResource
#define CompareString __carbon_CompareString
#define GetCurrentThread __carbon_GetCurrentThread
#define GetCurrentProcess __carbon_GetCurrentProcess
#define AnimatePalette __carbon_AnimatePalette
#define EqualRgn __carbon_EqualRgn
#define FillRgn __carbon_FillRgn
#define FrameRgn __carbon_FrameRgn
#define GetPixel __carbon_GetPixel
#define InvertRgn __carbon_InvertRgn
#define LineTo __carbon_LineTo
#define OffsetRgn __carbon_OffsetRgn
#define PaintRgn __carbon_PaintRgn
#define Polygon __carbon_Polygon
#define ResizePalette __carbon_ResizePalette
#define SetRectRgn __carbon_SetRectRgn
#define CheckMenuItem __carbon_CheckMenuItem
#define DeleteMenu __carbon_DeleteMenu
#define DrawMenuBar __carbon_DrawMenuBar
#define EnableMenuItem __carbon_EnableMenuItem
#define EqualRect __carbon_EqualRect
#define FillRect __carbon_FillRect
#define FrameRect __carbon_FrameRect
#define GetCursor __carbon_GetCursor
#define GetMenu __carbon_GetMenu
#define InvertRect __carbon_InvertRect
#define IsWindowVisible __carbon_IsWindowVisible
#define MoveWindow __carbon_MoveWindow
#define OffsetRect __carbon_OffsetRect
#define PtInRect __carbon_PtInRect
#define SetCursor __carbon_SetCursor
#define SetRect __carbon_SetRect
#define ShowCursor __carbon_ShowCursor
#define ShowWindow __carbon_ShowWindow
#define UnionRect __carbon_UnionRect
#include <CoreVideo/CVPixelBuffer.h>
#undef LoadResource
#undef CompareString
#undef GetCurrentThread
#undef _CDECL
#undef DPRINTF
#undef GetCurrentProcess
#undef AnimatePalette
#undef EqualRgn
#undef FillRgn
#undef FrameRgn
#undef GetPixel
#undef InvertRgn
#undef LineTo
#undef OffsetRgn
#undef PaintRgn
#undef Polygon
#undef ResizePalette
#undef SetRectRgn
#undef CheckMenuItem
#undef DeleteMenu
#undef DrawMenuBar
#undef EnableMenuItem
#undef EqualRect
#undef FillRect
#undef FrameRect
#undef GetCursor
#undef GetMenu
#undef InvertRect
#undef IsWindowVisible
#undef MoveWindow
#undef OffsetRect
#undef PtInRect
#undef SetCursor
#undef SetRect
#undef ShowCursor
#undef ShowWindow
#undef UnionRect
#undef ULONG
#undef HRESULT
#undef DPRINTF
#undef STDMETHODCALLTYPE
#include "windef.h"
#include "winbase.h"
#include "wtypes.h"
#include "winuser.h"
#include "dshow.h"
#include "wine/debug.h"
#include "qtprivate.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
qtdecoder
);
typedef
struct
{
UInt8
a
;
/* Alpha Channel */
UInt8
r
;
/* red component */
UInt8
g
;
/* green component */
UInt8
b
;
/* blue component */
}
ARGBPixelRecord
,
*
ARGBPixelPtr
,
**
ARGBPixelHdl
;
HRESULT
AccessPixelBufferPixels
(
CVPixelBufferRef
pixelBuffer
,
LPBYTE
pbDstStream
)
{
LPBYTE
pPixels
=
NULL
;
LPBYTE
out
=
NULL
;
size_t
bytesPerRow
=
0
,
height
=
0
,
width
=
0
;
OSType
actualType
;
int
i
;
actualType
=
CVPixelBufferGetPixelFormatType
(
pixelBuffer
);
if
(
k32ARGBPixelFormat
!=
actualType
)
{
ERR
(
"Pixel Buffer is not desired Type
\n
"
);
return
E_FAIL
;
}
CVPixelBufferLockBaseAddress
(
pixelBuffer
,
0
);
pPixels
=
(
LPBYTE
)
CVPixelBufferGetBaseAddress
(
pixelBuffer
);
bytesPerRow
=
CVPixelBufferGetBytesPerRow
(
pixelBuffer
);
height
=
CVPixelBufferGetHeight
(
pixelBuffer
);
width
=
CVPixelBufferGetWidth
(
pixelBuffer
);
for
(
out
=
pbDstStream
,
i
=
0
;
i
<
height
;
i
++
)
{
int
j
;
for
(
j
=
0
;
j
<
width
;
j
++
)
{
*
((
DWORD
*
)
out
)
=
(((
ARGBPixelPtr
)
pPixels
)[
j
].
r
)
<<
16
|
(((
ARGBPixelPtr
)
pPixels
)[
j
].
g
)
<<
8
|
(((
ARGBPixelPtr
)
pPixels
)[
j
].
b
);
out
+=
3
;
}
pPixels
+=
bytesPerRow
;
}
CVPixelBufferUnlockBaseAddress
(
pixelBuffer
,
0
);
return
S_OK
;
}
dlls/wineqtdecoder/qtvdecoder.c
View file @
f9abb07f
...
...
@@ -127,6 +127,8 @@
#include "wine/debug.h"
#include "wine/strmbase.h"
#include "qtprivate.h"
extern
CLSID
CLSID_QTVDecoder
;
WINE_DEFAULT_DEBUG_CHANNEL
(
qtdecoder
);
...
...
@@ -142,17 +144,9 @@ typedef struct QTVDecoderImpl
HRESULT
decodeHR
;
DWORD
outputSize
;
DWORD
outputWidth
,
outputHeight
,
outputDepth
;
}
QTVDecoderImpl
;
typedef
struct
{
UInt8
a
;
/* Alpha Channel */
UInt8
r
;
/* red component */
UInt8
g
;
/* green component */
UInt8
b
;
/* blue component */
}
ARGBPixelRecord
,
*
ARGBPixelPtr
,
**
ARGBPixelHdl
;
static
const
IBaseFilterVtbl
QTVDecoder_Vtbl
;
static
void
trackingCallback
(
...
...
@@ -172,11 +166,6 @@ static void trackingCallback(
IMediaSample
*
pOutSample
=
NULL
;
LPBYTE
pbDstStream
;
DWORD
cbDstStream
;
LPBYTE
pPixels
=
NULL
;
LPBYTE
out
=
NULL
;
size_t
bytesPerRow
=
0
;
int
i
;
if
(
result
!=
noErr
)
{
...
...
@@ -213,24 +202,9 @@ static void trackingCallback(
goto
error
;
}
/* ACCESS THE PIXELS */
CVPixelBufferLockBaseAddress
(
pixelBuffer
,
0
);
pPixels
=
(
LPBYTE
)
CVPixelBufferGetBaseAddress
(
pixelBuffer
);
bytesPerRow
=
CVPixelBufferGetBytesPerRow
(
pixelBuffer
);
for
(
out
=
pbDstStream
,
i
=
0
;
i
<
This
->
outputHeight
;
i
++
)
{
int
j
;
for
(
j
=
0
;
j
<
This
->
outputWidth
;
j
++
)
{
*
((
DWORD
*
)
out
)
=
(((
ARGBPixelPtr
)
pPixels
)[
j
].
r
)
<<
16
|
(((
ARGBPixelPtr
)
pPixels
)[
j
].
g
)
<<
8
|
(((
ARGBPixelPtr
)
pPixels
)[
j
].
b
);
out
+=
This
->
outputDepth
;
}
pPixels
+=
bytesPerRow
;
}
CVPixelBufferUnlockBaseAddress
(
pixelBuffer
,
0
);
hr
=
AccessPixelBufferPixels
(
pixelBuffer
,
pbDstStream
);
if
(
FAILED
(
hr
))
goto
error
;
IMediaSample_SetActualDataLength
(
pOutSample
,
This
->
outputSize
);
...
...
@@ -404,6 +378,7 @@ static HRESULT WINAPI QTVDecoder_SetMediaType(TransformFilter *tf, PIN_DIRECTION
OSType
fourCC
;
DecompressorComponent
dc
;
OSType
format
;
DWORD
outputWidth
,
outputHeight
,
outputDepth
;
if
(
IsEqualIID
(
&
pmt
->
formattype
,
&
FORMAT_VideoInfo
))
bmi
=
&
format1
->
bmiHeader
;
...
...
@@ -425,12 +400,12 @@ static HRESULT WINAPI QTVDecoder_SetMediaType(TransformFilter *tf, PIN_DIRECTION
goto
failed
;
}
This
->
outputWidth
=
bmi
->
biWidth
;
This
->
outputHeight
=
bmi
->
biHeight
;
outputWidth
=
bmi
->
biWidth
;
outputHeight
=
bmi
->
biHeight
;
(
**
This
->
hImageDescription
).
cType
=
fourCC
;
(
**
This
->
hImageDescription
).
width
=
This
->
outputWidth
;
(
**
This
->
hImageDescription
).
height
=
This
->
outputHeight
;
(
**
This
->
hImageDescription
).
width
=
outputWidth
;
(
**
This
->
hImageDescription
).
height
=
outputHeight
;
(
**
This
->
hImageDescription
).
depth
=
bmi
->
biBitCount
;
(
**
This
->
hImageDescription
).
hRes
=
72
<<
16
;
(
**
This
->
hImageDescription
).
vRes
=
72
<<
16
;
...
...
@@ -445,11 +420,11 @@ static HRESULT WINAPI QTVDecoder_SetMediaType(TransformFilter *tf, PIN_DIRECTION
goto
failed
;
}
n
=
CFNumberCreate
(
NULL
,
kCFNumberIntType
,
&
This
->
outputWidth
);
n
=
CFNumberCreate
(
NULL
,
kCFNumberIntType
,
&
outputWidth
);
CFDictionaryAddValue
(
This
->
outputBufferAttributes
,
kCVPixelBufferWidthKey
,
n
);
CFRelease
(
n
);
n
=
CFNumberCreate
(
NULL
,
kCFNumberIntType
,
&
This
->
outputHeight
);
n
=
CFNumberCreate
(
NULL
,
kCFNumberIntType
,
&
outputHeight
);
CFDictionaryAddValue
(
This
->
outputBufferAttributes
,
kCVPixelBufferHeightKey
,
n
);
CFRelease
(
n
);
...
...
@@ -462,8 +437,8 @@ static HRESULT WINAPI QTVDecoder_SetMediaType(TransformFilter *tf, PIN_DIRECTION
CFDictionaryAddValue
(
This
->
outputBufferAttributes
,
kCVPixelBufferCGBitmapContextCompatibilityKey
,
kCFBooleanTrue
);
CFDictionaryAddValue
(
This
->
outputBufferAttributes
,
kCVPixelBufferCGImageCompatibilityKey
,
kCFBooleanTrue
);
This
->
outputDepth
=
3
;
This
->
outputSize
=
This
->
outputWidth
*
This
->
outputHeight
*
This
->
outputDepth
;
outputDepth
=
3
;
This
->
outputSize
=
outputWidth
*
outputHeight
*
outputDepth
;
bmi
->
biCompression
=
BI_RGB
;
bmi
->
biBitCount
=
24
;
outpmt
->
subtype
=
MEDIASUBTYPE_RGB24
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment