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
6ab9ad10
Commit
6ab9ad10
authored
Mar 10, 2021
by
Zebediah Figura
Committed by
Alexandre Julliard
Mar 11, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
strmbase: Move run_event handling to strmbase.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
914ad66c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
58 deletions
+13
-58
nullrenderer.c
dlls/qedit/nullrenderer.c
+0
-24
videorenderer.c
dlls/quartz/videorenderer.c
+0
-20
vmr9.c
dlls/quartz/vmr9.c
+1
-14
renderer.c
dlls/strmbase/renderer.c
+12
-0
No files found.
dlls/qedit/nullrenderer.c
View file @
6ab9ad10
...
...
@@ -38,16 +38,6 @@ static struct null_renderer *impl_from_strmbase_renderer(struct strmbase_rendere
static
HRESULT
WINAPI
NullRenderer_DoRenderSample
(
struct
strmbase_renderer
*
iface
,
IMediaSample
*
sample
)
{
struct
null_renderer
*
filter
=
impl_from_strmbase_renderer
(
iface
);
if
(
filter
->
renderer
.
filter
.
state
==
State_Paused
)
{
const
HANDLE
events
[
2
]
=
{
filter
->
renderer
.
run_event
,
filter
->
renderer
.
flush_event
};
SetEvent
(
filter
->
renderer
.
state_event
);
WaitForMultipleObjects
(
2
,
events
,
FALSE
,
INFINITE
);
}
return
S_OK
;
}
...
...
@@ -65,24 +55,10 @@ static void null_renderer_destroy(struct strmbase_renderer *iface)
free
(
filter
);
}
static
void
null_renderer_start_stream
(
struct
strmbase_renderer
*
iface
)
{
struct
null_renderer
*
filter
=
impl_from_strmbase_renderer
(
iface
);
SetEvent
(
filter
->
renderer
.
run_event
);
}
static
void
null_renderer_stop_stream
(
struct
strmbase_renderer
*
iface
)
{
struct
null_renderer
*
filter
=
impl_from_strmbase_renderer
(
iface
);
ResetEvent
(
filter
->
renderer
.
run_event
);
}
static
const
struct
strmbase_renderer_ops
renderer_ops
=
{
.
pfnCheckMediaType
=
NullRenderer_CheckMediaType
,
.
pfnDoRenderSample
=
NullRenderer_DoRenderSample
,
.
renderer_start_stream
=
null_renderer_start_stream
,
.
renderer_stop_stream
=
null_renderer_stop_stream
,
.
renderer_destroy
=
null_renderer_destroy
,
};
...
...
dlls/quartz/videorenderer.c
View file @
6ab9ad10
...
...
@@ -102,16 +102,6 @@ static HRESULT WINAPI VideoRenderer_DoRenderSample(struct strmbase_renderer *ifa
(
BITMAPINFO
*
)
get_bitmap_header
(
&
filter
->
renderer
.
sink
.
pin
.
mt
),
DIB_RGB_COLORS
,
SRCCOPY
);
ReleaseDC
(
filter
->
window
.
hwnd
,
dc
);
if
(
filter
->
renderer
.
filter
.
state
==
State_Paused
)
{
const
HANDLE
events
[
2
]
=
{
filter
->
renderer
.
run_event
,
filter
->
renderer
.
flush_event
};
SetEvent
(
filter
->
renderer
.
state_event
);
LeaveCriticalSection
(
&
filter
->
renderer
.
filter
.
stream_cs
);
WaitForMultipleObjects
(
2
,
events
,
FALSE
,
INFINITE
);
EnterCriticalSection
(
&
filter
->
renderer
.
filter
.
stream_cs
);
}
return
S_OK
;
}
...
...
@@ -172,13 +162,6 @@ static HRESULT video_renderer_pin_query_interface(struct strmbase_renderer *ifac
return
S_OK
;
}
static
void
video_renderer_start_stream
(
struct
strmbase_renderer
*
iface
)
{
struct
video_renderer
*
filter
=
impl_from_strmbase_renderer
(
iface
);
SetEvent
(
filter
->
renderer
.
run_event
);
}
static
void
video_renderer_stop_stream
(
struct
strmbase_renderer
*
iface
)
{
struct
video_renderer
*
This
=
impl_from_strmbase_renderer
(
iface
);
...
...
@@ -188,8 +171,6 @@ static void video_renderer_stop_stream(struct strmbase_renderer *iface)
if
(
This
->
window
.
AutoShow
)
/* Black it out */
RedrawWindow
(
This
->
window
.
hwnd
,
NULL
,
NULL
,
RDW_INVALIDATE
|
RDW_ERASE
);
ResetEvent
(
This
->
renderer
.
run_event
);
}
static
void
video_renderer_init_stream
(
struct
strmbase_renderer
*
iface
)
...
...
@@ -235,7 +216,6 @@ static const struct strmbase_renderer_ops renderer_ops =
.
pfnCheckMediaType
=
VideoRenderer_CheckMediaType
,
.
pfnDoRenderSample
=
VideoRenderer_DoRenderSample
,
.
renderer_init_stream
=
video_renderer_init_stream
,
.
renderer_start_stream
=
video_renderer_start_stream
,
.
renderer_stop_stream
=
video_renderer_stop_stream
,
.
renderer_destroy
=
video_renderer_destroy
,
.
renderer_query_interface
=
video_renderer_query_interface
,
...
...
dlls/quartz/vmr9.c
View file @
6ab9ad10
...
...
@@ -209,7 +209,6 @@ static inline struct quartz_vmr *impl_from_IBaseFilter(IBaseFilter *iface)
static
HRESULT
WINAPI
VMR9_DoRenderSample
(
struct
strmbase_renderer
*
iface
,
IMediaSample
*
sample
)
{
struct
quartz_vmr
*
filter
=
impl_from_IBaseFilter
(
&
iface
->
filter
.
IBaseFilter_iface
);
const
HANDLE
events
[
2
]
=
{
filter
->
renderer
.
run_event
,
filter
->
renderer
.
flush_event
};
unsigned
int
data_size
,
width
,
depth
,
src_pitch
;
const
BITMAPINFOHEADER
*
bitmap_header
;
REFERENCE_TIME
start_time
,
end_time
;
...
...
@@ -310,17 +309,7 @@ static HRESULT WINAPI VMR9_DoRenderSample(struct strmbase_renderer *iface, IMedi
IDirect3DSurface9_UnlockRect
(
info
.
lpSurf
);
hr
=
IVMRImagePresenter9_PresentImage
(
filter
->
presenter
,
filter
->
cookie
,
&
info
);
if
(
filter
->
renderer
.
filter
.
state
==
State_Paused
)
{
SetEvent
(
filter
->
renderer
.
state_event
);
LeaveCriticalSection
(
&
filter
->
renderer
.
filter
.
stream_cs
);
WaitForMultipleObjects
(
2
,
events
,
FALSE
,
INFINITE
);
EnterCriticalSection
(
&
filter
->
renderer
.
filter
.
stream_cs
);
}
return
hr
;
return
IVMRImagePresenter9_PresentImage
(
filter
->
presenter
,
filter
->
cookie
,
&
info
);
}
static
HRESULT
WINAPI
VMR9_CheckMediaType
(
struct
strmbase_renderer
*
iface
,
const
AM_MEDIA_TYPE
*
mt
)
...
...
@@ -484,7 +473,6 @@ static void vmr_start_stream(struct strmbase_renderer *iface)
struct
quartz_vmr
*
filter
=
impl_from_IBaseFilter
(
&
iface
->
filter
.
IBaseFilter_iface
);
IVMRImagePresenter9_StartPresenting
(
filter
->
presenter
,
filter
->
cookie
);
SetEvent
(
filter
->
renderer
.
run_event
);
}
static
void
vmr_stop_stream
(
struct
strmbase_renderer
*
iface
)
...
...
@@ -495,7 +483,6 @@ static void vmr_stop_stream(struct strmbase_renderer *iface)
if
(
This
->
renderer
.
filter
.
state
==
State_Running
)
IVMRImagePresenter9_StopPresenting
(
This
->
presenter
,
This
->
cookie
);
ResetEvent
(
This
->
renderer
.
run_event
);
}
static
HRESULT
vmr_connect
(
struct
strmbase_renderer
*
iface
,
const
AM_MEDIA_TYPE
*
mt
)
...
...
dlls/strmbase/renderer.c
View file @
6ab9ad10
...
...
@@ -245,6 +245,7 @@ static HRESULT renderer_start_stream(struct strmbase_filter *iface, REFERENCE_TI
filter
->
stream_start
=
start
;
SetEvent
(
filter
->
state_event
);
SetEvent
(
filter
->
run_event
);
if
(
filter
->
sink
.
pin
.
peer
)
filter
->
eos
=
FALSE
;
reset_qos
(
filter
);
...
...
@@ -258,6 +259,8 @@ static HRESULT renderer_stop_stream(struct strmbase_filter *iface)
{
struct
strmbase_renderer
*
filter
=
impl_from_strmbase_filter
(
iface
);
ResetEvent
(
filter
->
run_event
);
if
(
filter
->
sink
.
pin
.
peer
&&
filter
->
pFuncsTable
->
renderer_stop_stream
)
filter
->
pFuncsTable
->
renderer_stop_stream
(
filter
);
...
...
@@ -354,8 +357,17 @@ static HRESULT WINAPI BaseRenderer_Receive(struct strmbase_sink *pin, IMediaSamp
if
(
state
==
State_Paused
)
{
HANDLE
events
[
2
]
=
{
filter
->
run_event
,
filter
->
flush_event
};
filter
->
current_sample
=
sample
;
hr
=
filter
->
pFuncsTable
->
pfnDoRenderSample
(
filter
,
sample
);
SetEvent
(
filter
->
state_event
);
LeaveCriticalSection
(
&
filter
->
filter
.
stream_cs
);
WaitForMultipleObjects
(
2
,
events
,
FALSE
,
INFINITE
);
EnterCriticalSection
(
&
filter
->
filter
.
stream_cs
);
filter
->
current_sample
=
NULL
;
}
...
...
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