Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
507ba18d
Commit
507ba18d
authored
Feb 13, 2021
by
Zebediah Figura
Committed by
Alexandre Julliard
Feb 15, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winegstreamer: Move wg_parser sink disconnection code to the Unix library.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
6c67a0a6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
65 additions
and
52 deletions
+65
-52
gst_private.h
dlls/winegstreamer/gst_private.h
+1
-0
gstdemux.c
dlls/winegstreamer/gstdemux.c
+3
-52
wg_parser.c
dlls/winegstreamer/wg_parser.c
+61
-0
No files found.
dlls/winegstreamer/gst_private.h
View file @
507ba18d
...
@@ -213,6 +213,7 @@ struct unix_funcs
...
@@ -213,6 +213,7 @@ struct unix_funcs
void
(
CDECL
*
wg_parser_destroy
)(
struct
wg_parser
*
parser
);
void
(
CDECL
*
wg_parser_destroy
)(
struct
wg_parser
*
parser
);
HRESULT
(
CDECL
*
wg_parser_connect
)(
struct
wg_parser
*
parser
,
uint64_t
file_size
);
HRESULT
(
CDECL
*
wg_parser_connect
)(
struct
wg_parser
*
parser
,
uint64_t
file_size
);
void
(
CDECL
*
wg_parser_disconnect
)(
struct
wg_parser
*
parser
);
};
};
extern
const
struct
unix_funcs
*
unix_funcs
;
extern
const
struct
unix_funcs
*
unix_funcs
;
...
...
dlls/winegstreamer/gstdemux.c
View file @
507ba18d
...
@@ -1546,30 +1546,6 @@ static void source_disconnect(struct strmbase_source *iface)
...
@@ -1546,30 +1546,6 @@ static void source_disconnect(struct strmbase_source *iface)
stream
->
enabled
=
false
;
stream
->
enabled
=
false
;
}
}
static
void
free_stream
(
struct
wg_parser_stream
*
stream
)
{
if
(
stream
->
their_src
)
{
if
(
stream
->
post_sink
)
{
gst_pad_unlink
(
stream
->
their_src
,
stream
->
post_sink
);
gst_pad_unlink
(
stream
->
post_src
,
stream
->
my_sink
);
gst_object_unref
(
stream
->
post_src
);
gst_object_unref
(
stream
->
post_sink
);
stream
->
post_src
=
stream
->
post_sink
=
NULL
;
}
else
gst_pad_unlink
(
stream
->
their_src
,
stream
->
my_sink
);
gst_object_unref
(
stream
->
their_src
);
}
gst_object_unref
(
stream
->
my_sink
);
pthread_cond_destroy
(
&
stream
->
event_cond
);
pthread_cond_destroy
(
&
stream
->
event_empty_cond
);
free
(
stream
);
}
static
void
free_source_pin
(
struct
parser_source
*
pin
)
static
void
free_source_pin
(
struct
parser_source
*
pin
)
{
{
if
(
pin
->
pin
.
pin
.
peer
)
if
(
pin
->
pin
.
pin
.
peer
)
...
@@ -1579,8 +1555,6 @@ static void free_source_pin(struct parser_source *pin)
...
@@ -1579,8 +1555,6 @@ static void free_source_pin(struct parser_source *pin)
IPin_Disconnect
(
&
pin
->
pin
.
pin
.
IPin_iface
);
IPin_Disconnect
(
&
pin
->
pin
.
pin
.
IPin_iface
);
}
}
free_stream
(
pin
->
wg_stream
);
pin
->
flushing_cs
.
DebugInfo
->
Spare
[
0
]
=
0
;
pin
->
flushing_cs
.
DebugInfo
->
Spare
[
0
]
=
0
;
DeleteCriticalSection
(
&
pin
->
flushing_cs
);
DeleteCriticalSection
(
&
pin
->
flushing_cs
);
...
@@ -1628,37 +1602,19 @@ static struct parser_source *create_pin(struct parser *filter,
...
@@ -1628,37 +1602,19 @@ static struct parser_source *create_pin(struct parser *filter,
static
HRESULT
GST_RemoveOutputPins
(
struct
parser
*
This
)
static
HRESULT
GST_RemoveOutputPins
(
struct
parser
*
This
)
{
{
struct
wg_parser
*
parser
=
This
->
wg_parser
;
unsigned
int
i
;
unsigned
int
i
;
TRACE
(
"(%p)
\n
"
,
This
);
TRACE
(
"(%p)
\n
"
,
This
);
mark_wine_thread
();
mark_wine_thread
();
if
(
!
parser
->
container
)
if
(
!
This
->
sink_connected
)
return
S_OK
;
return
S_OK
;
/* Unblock all of our streams. */
unix_funcs
->
wg_parser_disconnect
(
This
->
wg_parser
);
pthread_mutex_lock
(
&
parser
->
mutex
);
for
(
i
=
0
;
i
<
parser
->
stream_count
;
++
i
)
{
parser
->
streams
[
i
]
->
flushing
=
true
;
pthread_cond_signal
(
&
parser
->
streams
[
i
]
->
event_empty_cond
);
}
pthread_mutex_unlock
(
&
parser
->
mutex
);
gst_element_set_state
(
parser
->
container
,
GST_STATE_NULL
);
gst_pad_unlink
(
parser
->
my_src
,
parser
->
their_sink
);
gst_object_unref
(
parser
->
my_src
);
gst_object_unref
(
parser
->
their_sink
);
parser
->
my_src
=
parser
->
their_sink
=
NULL
;
/* read_thread() needs to stay alive to service any read requests GStreamer
/* read_thread() needs to stay alive to service any read requests GStreamer
* sends, so we can only shut it down after GStreamer stops. */
* sends, so we can only shut it down after GStreamer stops. */
This
->
sink_connected
=
false
;
This
->
sink_connected
=
false
;
pthread_mutex_lock
(
&
parser
->
mutex
);
parser
->
sink_connected
=
false
;
pthread_mutex_unlock
(
&
parser
->
mutex
);
pthread_cond_signal
(
&
parser
->
read_cond
);
WaitForSingleObject
(
This
->
read_thread
,
INFINITE
);
WaitForSingleObject
(
This
->
read_thread
,
INFINITE
);
CloseHandle
(
This
->
read_thread
);
CloseHandle
(
This
->
read_thread
);
...
@@ -1671,12 +1627,7 @@ static HRESULT GST_RemoveOutputPins(struct parser *This)
...
@@ -1671,12 +1627,7 @@ static HRESULT GST_RemoveOutputPins(struct parser *This)
This
->
source_count
=
0
;
This
->
source_count
=
0
;
heap_free
(
This
->
sources
);
heap_free
(
This
->
sources
);
This
->
sources
=
NULL
;
This
->
sources
=
NULL
;
parser
->
stream_count
=
0
;
free
(
parser
->
streams
);
parser
->
streams
=
NULL
;
gst_element_set_bus
(
parser
->
container
,
NULL
);
gst_object_unref
(
parser
->
container
);
parser
->
container
=
NULL
;
BaseFilterImpl_IncrementPinVersion
(
&
This
->
filter
);
BaseFilterImpl_IncrementPinVersion
(
&
This
->
filter
);
return
S_OK
;
return
S_OK
;
}
}
...
...
dlls/winegstreamer/wg_parser.c
View file @
507ba18d
...
@@ -1127,6 +1127,66 @@ static HRESULT CDECL wg_parser_connect(struct wg_parser *parser, uint64_t file_s
...
@@ -1127,6 +1127,66 @@ static HRESULT CDECL wg_parser_connect(struct wg_parser *parser, uint64_t file_s
return
S_OK
;
return
S_OK
;
}
}
static
void
free_stream
(
struct
wg_parser_stream
*
stream
)
{
if
(
stream
->
their_src
)
{
if
(
stream
->
post_sink
)
{
gst_pad_unlink
(
stream
->
their_src
,
stream
->
post_sink
);
gst_pad_unlink
(
stream
->
post_src
,
stream
->
my_sink
);
gst_object_unref
(
stream
->
post_src
);
gst_object_unref
(
stream
->
post_sink
);
stream
->
post_src
=
stream
->
post_sink
=
NULL
;
}
else
gst_pad_unlink
(
stream
->
their_src
,
stream
->
my_sink
);
gst_object_unref
(
stream
->
their_src
);
}
gst_object_unref
(
stream
->
my_sink
);
pthread_cond_destroy
(
&
stream
->
event_cond
);
pthread_cond_destroy
(
&
stream
->
event_empty_cond
);
free
(
stream
);
}
static
void
CDECL
wg_parser_disconnect
(
struct
wg_parser
*
parser
)
{
unsigned
int
i
;
/* Unblock all of our streams. */
pthread_mutex_lock
(
&
parser
->
mutex
);
for
(
i
=
0
;
i
<
parser
->
stream_count
;
++
i
)
{
parser
->
streams
[
i
]
->
flushing
=
true
;
pthread_cond_signal
(
&
parser
->
streams
[
i
]
->
event_empty_cond
);
}
pthread_mutex_unlock
(
&
parser
->
mutex
);
gst_element_set_state
(
parser
->
container
,
GST_STATE_NULL
);
gst_pad_unlink
(
parser
->
my_src
,
parser
->
their_sink
);
gst_object_unref
(
parser
->
my_src
);
gst_object_unref
(
parser
->
their_sink
);
parser
->
my_src
=
parser
->
their_sink
=
NULL
;
pthread_mutex_lock
(
&
parser
->
mutex
);
parser
->
sink_connected
=
false
;
pthread_mutex_unlock
(
&
parser
->
mutex
);
pthread_cond_signal
(
&
parser
->
read_cond
);
for
(
i
=
0
;
i
<
parser
->
stream_count
;
++
i
)
free_stream
(
parser
->
streams
[
i
]);
parser
->
stream_count
=
0
;
free
(
parser
->
streams
);
parser
->
streams
=
NULL
;
gst_element_set_bus
(
parser
->
container
,
NULL
);
gst_object_unref
(
parser
->
container
);
parser
->
container
=
NULL
;
}
static
BOOL
decodebin_parser_init_gst
(
struct
wg_parser
*
parser
)
static
BOOL
decodebin_parser_init_gst
(
struct
wg_parser
*
parser
)
{
{
GstElement
*
element
=
gst_element_factory_make
(
"decodebin"
,
NULL
);
GstElement
*
element
=
gst_element_factory_make
(
"decodebin"
,
NULL
);
...
@@ -1406,6 +1466,7 @@ static const struct unix_funcs funcs =
...
@@ -1406,6 +1466,7 @@ static const struct unix_funcs funcs =
wg_parser_destroy
,
wg_parser_destroy
,
wg_parser_connect
,
wg_parser_connect
,
wg_parser_disconnect
,
};
};
NTSTATUS
CDECL
__wine_init_unix_lib
(
HMODULE
module
,
DWORD
reason
,
const
void
*
ptr_in
,
void
*
ptr_out
)
NTSTATUS
CDECL
__wine_init_unix_lib
(
HMODULE
module
,
DWORD
reason
,
const
void
*
ptr_in
,
void
*
ptr_out
)
...
...
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