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
603b00fe
Commit
603b00fe
authored
Nov 10, 2020
by
Nikolay Sivov
Committed by
Alexandre Julliard
Nov 10, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
evr/presenter: Create sample allocator on object creation.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
11fb2a59
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
7 deletions
+22
-7
presenter.c
dlls/evr/presenter.c
+22
-7
No files found.
dlls/evr/presenter.c
View file @
603b00fe
...
...
@@ -70,6 +70,7 @@ struct video_presenter
IMediaEventSink
*
event_sink
;
IDirect3DDeviceManager9
*
device_manager
;
IMFVideoSampleAllocator
*
allocator
;
struct
streaming_thread
thread
;
IMFMediaType
*
media_type
;
UINT
reset_token
;
...
...
@@ -175,12 +176,13 @@ static void video_presenter_reset_media_type(struct video_presenter *presenter)
IMFMediaType_Release
(
presenter
->
media_type
);
presenter
->
media_type
=
NULL
;
/* FIXME: release samples pool */
IMFVideoSampleAllocator_UninitializeSampleAllocator
(
presenter
->
allocator
);
}
static
HRESULT
video_presenter_set_media_type
(
struct
video_presenter
*
presenter
,
IMFMediaType
*
media_type
)
{
unsigned
int
flags
;
HRESULT
hr
;
if
(
!
media_type
)
{
...
...
@@ -193,12 +195,15 @@ static HRESULT video_presenter_set_media_type(struct video_presenter *presenter,
video_presenter_reset_media_type
(
presenter
);
/* FIXME: allocate samples pool */
presenter
->
media_type
=
media_type
;
IMFMediaType_AddRef
(
presenter
->
media_type
);
if
(
SUCCEEDED
(
hr
=
IMFVideoSampleAllocator_InitializeSampleAllocator
(
presenter
->
allocator
,
3
,
media_type
)))
{
presenter
->
media_type
=
media_type
;
IMFMediaType_AddRef
(
presenter
->
media_type
);
}
else
WARN
(
"Failed to initialize sample allocator, hr %#x.
\n
"
,
hr
);
return
S_OK
;
return
hr
;
}
static
HRESULT
video_presenter_invalidate_media_type
(
struct
video_presenter
*
presenter
)
...
...
@@ -220,7 +225,9 @@ static HRESULT video_presenter_invalidate_media_type(struct video_presenter *pre
if
(
SUCCEEDED
(
hr
))
hr
=
video_presenter_set_media_type
(
presenter
,
media_type
);
hr
=
IMFTransform_SetOutputType
(
presenter
->
mixer
,
0
,
media_type
,
0
);
if
(
SUCCEEDED
(
hr
))
hr
=
IMFTransform_SetOutputType
(
presenter
->
mixer
,
0
,
media_type
,
0
);
IMFMediaType_Release
(
media_type
);
if
(
SUCCEEDED
(
hr
))
...
...
@@ -388,9 +395,12 @@ static ULONG WINAPI video_presenter_inner_Release(IUnknown *iface)
{
video_presenter_end_streaming
(
presenter
);
video_presenter_clear_container
(
presenter
);
video_presenter_reset_media_type
(
presenter
);
DeleteCriticalSection
(
&
presenter
->
cs
);
if
(
presenter
->
device_manager
)
IDirect3DDeviceManager9_Release
(
presenter
->
device_manager
);
if
(
presenter
->
allocator
)
IMFVideoSampleAllocator_Release
(
presenter
->
allocator
);
heap_free
(
presenter
);
}
...
...
@@ -1179,6 +1189,11 @@ static HRESULT video_presenter_init_d3d(struct video_presenter *presenter)
if
(
FAILED
(
hr
))
WARN
(
"Failed to set new device for the manager, hr %#x.
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
=
MFCreateVideoSampleAllocator
(
&
IID_IMFVideoSampleAllocator
,
(
void
**
)
&
presenter
->
allocator
)))
{
hr
=
IMFVideoSampleAllocator_SetDirectXManager
(
presenter
->
allocator
,
(
IUnknown
*
)
presenter
->
device_manager
);
}
return
hr
;
}
...
...
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