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
c7023042
Commit
c7023042
authored
May 17, 2021
by
Nikolay Sivov
Committed by
Alexandre Julliard
May 17, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mfmediaengine: Keep latest video frame buffer.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
79a71f96
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
10 deletions
+19
-10
main.c
dlls/mfmediaengine/main.c
+19
-10
No files found.
dlls/mfmediaengine/main.c
View file @
c7023042
...
...
@@ -84,14 +84,6 @@ enum media_engine_flags
FLAGS_ENGINE_IS_ENDED
=
0x4000
,
};
struct
video_frame
{
LONGLONG
pts
;
SIZE
size
;
SIZE
ratio
;
TOPOID
node_id
;
};
struct
media_engine
{
IMFMediaEngine
IMFMediaEngine_iface
;
...
...
@@ -115,7 +107,15 @@ struct media_engine
IMFPresentationClock
*
clock
;
IMFSourceResolver
*
resolver
;
BSTR
current_source
;
struct
video_frame
video_frame
;
struct
{
LONGLONG
pts
;
SIZE
size
;
SIZE
ratio
;
TOPOID
node_id
;
BYTE
*
buffer
;
UINT
buffer_size
;
}
video_frame
;
CRITICAL_SECTION
cs
;
};
...
...
@@ -976,6 +976,7 @@ static void free_media_engine(struct media_engine *engine)
IMFSourceResolver_Release
(
engine
->
resolver
);
SysFreeString
(
engine
->
current_source
);
DeleteCriticalSection
(
&
engine
->
cs
);
free
(
engine
->
video_frame
.
buffer
);
free
(
engine
);
}
...
...
@@ -1781,7 +1782,7 @@ static HRESULT WINAPI media_engine_grabber_callback_OnSetPresentationClock(IMFSa
static
HRESULT
WINAPI
media_engine_grabber_callback_OnProcessSample
(
IMFSampleGrabberSinkCallback
*
iface
,
REFGUID
major_type
,
DWORD
sample_flags
,
LONGLONG
sample_time
,
LONGLONG
sample_duration
,
const
BYTE
*
buffer
,
DWORD
sample
_size
)
const
BYTE
*
buffer
,
DWORD
buffer
_size
)
{
struct
media_engine
*
engine
=
impl_from_IMFSampleGrabberSinkCallback
(
iface
);
...
...
@@ -1793,6 +1794,14 @@ static HRESULT WINAPI media_engine_grabber_callback_OnProcessSample(IMFSampleGra
media_engine_set_flag
(
engine
,
FLAGS_ENGINE_FIRST_FRAME
,
TRUE
);
}
engine
->
video_frame
.
pts
=
sample_time
;
if
(
engine
->
video_frame
.
buffer_size
<
buffer_size
)
{
free
(
engine
->
video_frame
.
buffer
);
if
((
engine
->
video_frame
.
buffer
=
malloc
(
buffer_size
)))
engine
->
video_frame
.
buffer_size
=
buffer_size
;
}
if
(
engine
->
video_frame
.
buffer
)
memcpy
(
engine
->
video_frame
.
buffer
,
buffer
,
buffer_size
);
LeaveCriticalSection
(
&
engine
->
cs
);
...
...
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