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
ba664e10
Commit
ba664e10
authored
Dec 18, 2023
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jan 17, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
evr/dshow: Handle YUY2 sample copy.
Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=53810
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
parent
a1adaaca
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
4 deletions
+14
-4
evr.c
dlls/evr/evr.c
+14
-4
No files found.
dlls/evr/evr.c
View file @
ba664e10
...
@@ -344,7 +344,7 @@ static void evr_destroy(struct strmbase_renderer *iface)
...
@@ -344,7 +344,7 @@ static void evr_destroy(struct strmbase_renderer *iface)
free
(
filter
);
free
(
filter
);
}
}
static
HRESULT
evr_copy_sample_buffer
(
struct
evr
*
filter
,
IMediaSample
*
input_sample
,
IMFSample
**
sample
)
static
HRESULT
evr_copy_sample_buffer
(
struct
evr
*
filter
,
const
GUID
*
subtype
,
IMediaSample
*
input_sample
,
IMFSample
**
sample
)
{
{
IDirect3DSurface9
*
surface
;
IDirect3DSurface9
*
surface
;
D3DLOCKED_RECT
locked_rect
;
D3DLOCKED_RECT
locked_rect
;
...
@@ -364,6 +364,15 @@ static HRESULT evr_copy_sample_buffer(struct evr *filter, IMediaSample *input_sa
...
@@ -364,6 +364,15 @@ static HRESULT evr_copy_sample_buffer(struct evr *filter, IMediaSample *input_sa
width
=
frame_size
>>
32
;
width
=
frame_size
>>
32
;
lines
=
frame_size
;
lines
=
frame_size
;
if
(
IsEqualGUID
(
subtype
,
&
MFVideoFormat_YUY2
))
{
width
=
(
3
*
width
+
3
)
&
~
3
;
}
else
{
width
*=
4
;
}
if
(
FAILED
(
hr
=
IMediaSample_GetPointer
(
input_sample
,
&
src
)))
if
(
FAILED
(
hr
=
IMediaSample_GetPointer
(
input_sample
,
&
src
)))
{
{
WARN
(
"Failed to get pointer to sample data, hr %#lx.
\n
"
,
hr
);
WARN
(
"Failed to get pointer to sample data, hr %#lx.
\n
"
,
hr
);
...
@@ -383,7 +392,7 @@ static HRESULT evr_copy_sample_buffer(struct evr *filter, IMediaSample *input_sa
...
@@ -383,7 +392,7 @@ static HRESULT evr_copy_sample_buffer(struct evr *filter, IMediaSample *input_sa
if
(
SUCCEEDED
(
hr
=
IDirect3DSurface9_LockRect
(
surface
,
&
locked_rect
,
NULL
,
D3DLOCK_DISCARD
)))
if
(
SUCCEEDED
(
hr
=
IDirect3DSurface9_LockRect
(
surface
,
&
locked_rect
,
NULL
,
D3DLOCK_DISCARD
)))
{
{
if
(
src_stride
<
0
)
src
+=
(
-
src_stride
)
*
(
lines
-
1
);
if
(
src_stride
<
0
)
src
+=
(
-
src_stride
)
*
(
lines
-
1
);
MFCopyImage
(
locked_rect
.
pBits
,
locked_rect
.
Pitch
,
src
,
src_stride
,
width
*
4
,
lines
);
MFCopyImage
(
locked_rect
.
pBits
,
locked_rect
.
Pitch
,
src
,
src_stride
,
width
,
lines
);
IDirect3DSurface9_UnlockRect
(
surface
);
IDirect3DSurface9_UnlockRect
(
surface
);
}
}
...
@@ -417,9 +426,10 @@ static HRESULT evr_render(struct strmbase_renderer *iface, IMediaSample *input_s
...
@@ -417,9 +426,10 @@ static HRESULT evr_render(struct strmbase_renderer *iface, IMediaSample *input_s
IMFMediaType_GetGUID
(
filter
->
media_type
,
&
MF_MT_SUBTYPE
,
&
subtype
);
IMFMediaType_GetGUID
(
filter
->
media_type
,
&
MF_MT_SUBTYPE
,
&
subtype
);
if
(
IsEqualGUID
(
&
subtype
,
&
MFVideoFormat_ARGB32
)
if
(
IsEqualGUID
(
&
subtype
,
&
MFVideoFormat_ARGB32
)
||
IsEqualGUID
(
&
subtype
,
&
MFVideoFormat_RGB32
))
||
IsEqualGUID
(
&
subtype
,
&
MFVideoFormat_RGB32
)
||
IsEqualGUID
(
&
subtype
,
&
MFVideoFormat_YUY2
))
{
{
if
(
SUCCEEDED
(
hr
=
evr_copy_sample_buffer
(
filter
,
input_sample
,
&
sample
)))
if
(
SUCCEEDED
(
hr
=
evr_copy_sample_buffer
(
filter
,
&
subtype
,
input_sample
,
&
sample
)))
{
{
if
(
SUCCEEDED
(
IMFTransform_ProcessInput
(
filter
->
mixer
,
0
,
sample
,
0
)))
if
(
SUCCEEDED
(
IMFTransform_ProcessInput
(
filter
->
mixer
,
0
,
sample
,
0
)))
IMFVideoPresenter_ProcessMessage
(
filter
->
presenter
,
MFVP_MESSAGE_PROCESSINPUTNOTIFY
,
0
);
IMFVideoPresenter_ProcessMessage
(
filter
->
presenter
,
MFVP_MESSAGE_PROCESSINPUTNOTIFY
,
0
);
...
...
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