Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
3c984e29
Commit
3c984e29
authored
Mar 24, 2020
by
Zebediah Figura
Committed by
Alexandre Julliard
Mar 25, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
quartz/avidec: Correctly implement avi_decompressor_source_query_accept().
Signed-off-by:
Zebediah Figura
<
zfigura@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
9f9201c9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
25 deletions
+23
-25
avidec.c
dlls/quartz/avidec.c
+16
-25
avidec.c
dlls/quartz/tests/avidec.c
+7
-0
No files found.
dlls/quartz/avidec.c
View file @
3c984e29
...
...
@@ -47,7 +47,6 @@ typedef struct AVIDecImpl
struct
strmbase_sink
sink
;
AM_MEDIA_TYPE
mt
;
HIC
hvid
;
BITMAPINFOHEADER
*
pBihIn
;
BITMAPINFOHEADER
*
pBihOut
;
...
...
@@ -238,21 +237,19 @@ static HRESULT avi_decompressor_sink_connect(struct strmbase_sink *iface, IPin *
This
->
hvid
=
ICLocate
(
pmt
->
majortype
.
Data1
,
pmt
->
subtype
.
Data1
,
bmi
,
NULL
,
ICMODE_DECOMPRESS
);
if
(
This
->
hvid
)
{
const
CLSID
*
outsubtype
;
DWORD
bih_size
;
DWORD
output_depth
=
bmi
->
biBitCount
;
DWORD
result
;
FreeMediaType
(
&
This
->
mt
);
switch
(
bmi
->
biBitCount
)
{
case
32
:
outsubtype
=
&
MEDIASUBTYPE_RGB32
;
break
;
case
24
:
outsubtype
=
&
MEDIASUBTYPE_RGB24
;
break
;
case
16
:
outsubtype
=
&
MEDIASUBTYPE_RGB565
;
break
;
case
8
:
outsubtype
=
&
MEDIASUBTYPE_RGB8
;
break
;
case
32
:
case
24
:
case
16
:
case
8
:
break
;
default:
WARN
(
"Non standard input depth %d, forced output depth to 32
\n
"
,
bmi
->
biBitCount
);
outsubtype
=
&
MEDIASUBTYPE_RGB32
;
output_depth
=
32
;
break
;
}
...
...
@@ -286,17 +283,6 @@ static HRESULT avi_decompressor_sink_connect(struct strmbase_sink *iface, IPin *
goto
failed
;
}
/* Update output media type */
CopyMediaType
(
&
This
->
mt
,
pmt
);
This
->
mt
.
subtype
=
*
outsubtype
;
if
(
IsEqualIID
(
&
pmt
->
formattype
,
&
FORMAT_VideoInfo
))
memcpy
(
&
(((
VIDEOINFOHEADER
*
)
This
->
mt
.
pbFormat
)
->
bmiHeader
),
This
->
pBihOut
,
This
->
pBihOut
->
biSize
);
else
if
(
IsEqualIID
(
&
pmt
->
formattype
,
&
FORMAT_VideoInfo2
))
memcpy
(
&
(((
VIDEOINFOHEADER2
*
)
This
->
mt
.
pbFormat
)
->
bmiHeader
),
This
->
pBihOut
,
This
->
pBihOut
->
biSize
);
else
assert
(
0
);
TRACE
(
"Connection accepted
\n
"
);
return
S_OK
;
}
...
...
@@ -351,12 +337,18 @@ static HRESULT avi_decompressor_source_query_interface(struct strmbase_pin *ifac
static
HRESULT
avi_decompressor_source_query_accept
(
struct
strmbase_pin
*
iface
,
const
AM_MEDIA_TYPE
*
mt
)
{
AVIDecImpl
*
filter
=
impl_from_strmbase_filter
(
iface
->
filter
);
VIDEOINFOHEADER
*
sink_format
,
*
format
;
if
(
IsEqualGUID
(
&
mt
->
majortype
,
&
filter
->
mt
.
majortype
)
&&
(
IsEqualGUID
(
&
mt
->
subtype
,
&
filter
->
mt
.
subtype
)
||
IsEqualGUID
(
&
filter
->
mt
.
subtype
,
&
GUID_NULL
)))
return
S_OK
;
return
S_FALSE
;
if
(
!
filter
->
sink
.
pin
.
peer
||
!
IsEqualGUID
(
&
mt
->
formattype
,
&
FORMAT_VideoInfo
))
return
S_FALSE
;
sink_format
=
(
VIDEOINFOHEADER
*
)
filter
->
sink
.
pin
.
mt
.
pbFormat
;
format
=
(
VIDEOINFOHEADER
*
)
mt
->
pbFormat
;
if
(
ICDecompressQuery
(
filter
->
hvid
,
&
sink_format
->
bmiHeader
,
&
format
->
bmiHeader
))
return
S_FALSE
;
return
S_OK
;
}
static
HRESULT
avi_decompressor_source_get_media_type
(
struct
strmbase_pin
*
iface
,
...
...
@@ -584,7 +576,6 @@ static void avi_decompressor_destroy(struct strmbase_filter *iface)
filter
->
stream_cs
.
DebugInfo
->
Spare
[
0
]
=
0
;
DeleteCriticalSection
(
&
filter
->
stream_cs
);
FreeMediaType
(
&
filter
->
mt
);
IUnknown_Release
(
filter
->
seeking
);
strmbase_filter_cleanup
(
&
filter
->
filter
);
free
(
filter
);
...
...
dlls/quartz/tests/avidec.c
View file @
3c984e29
...
...
@@ -586,6 +586,13 @@ static void test_media_types(void)
hr
=
IEnumMediaTypes_Next
(
enummt
,
1
,
&
pmt
,
NULL
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
mt
.
subtype
=
MEDIASUBTYPE_RGB24
;
vih
.
bmiHeader
.
biCompression
=
BI_RGB
;
vih
.
bmiHeader
.
biBitCount
=
24
;
vih
.
bmiHeader
.
biSizeImage
=
32
*
24
*
3
;
hr
=
IPin_QueryAccept
(
pin
,
&
mt
);
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
IEnumMediaTypes_Release
(
enummt
);
IPin_Release
(
pin
);
...
...
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