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
b496a354
Commit
b496a354
authored
Nov 09, 2023
by
Ziqing Hui
Committed by
Alexandre Julliard
Nov 27, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winegstreamer: Implement wg_muxer_finalize.
parent
e36547d2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
2 deletions
+31
-2
wg_muxer.c
dlls/winegstreamer/wg_muxer.c
+31
-2
No files found.
dlls/winegstreamer/wg_muxer.c
View file @
b496a354
...
@@ -63,6 +63,9 @@ struct wg_muxer
...
@@ -63,6 +63,9 @@ struct wg_muxer
GstBuffer
*
buffer
;
GstBuffer
*
buffer
;
pthread_mutex_t
mutex
;
pthread_mutex_t
mutex
;
pthread_cond_t
cond
;
bool
eos
;
guint64
offset
;
/* Write offset of the output buffer generated by muxer. */
guint64
offset
;
/* Write offset of the output buffer generated by muxer. */
struct
list
streams
;
struct
list
streams
;
...
@@ -175,6 +178,13 @@ static gboolean muxer_sink_event_cb(GstPad *pad, GstObject *parent, GstEvent *ev
...
@@ -175,6 +178,13 @@ static gboolean muxer_sink_event_cb(GstPad *pad, GstObject *parent, GstEvent *ev
switch
(
event
->
type
)
switch
(
event
->
type
)
{
{
case
GST_EVENT_EOS
:
pthread_mutex_lock
(
&
muxer
->
mutex
);
muxer
->
eos
=
true
;
pthread_mutex_unlock
(
&
muxer
->
mutex
);
pthread_cond_signal
(
&
muxer
->
cond
);
break
;
case
GST_EVENT_SEGMENT
:
case
GST_EVENT_SEGMENT
:
pthread_mutex_lock
(
&
muxer
->
mutex
);
pthread_mutex_lock
(
&
muxer
->
mutex
);
...
@@ -248,6 +258,7 @@ NTSTATUS wg_muxer_create(void *args)
...
@@ -248,6 +258,7 @@ NTSTATUS wg_muxer_create(void *args)
list_init
(
&
muxer
->
streams
);
list_init
(
&
muxer
->
streams
);
muxer
->
offset
=
GST_BUFFER_OFFSET_NONE
;
muxer
->
offset
=
GST_BUFFER_OFFSET_NONE
;
pthread_mutex_init
(
&
muxer
->
mutex
,
NULL
);
pthread_mutex_init
(
&
muxer
->
mutex
,
NULL
);
pthread_cond_init
(
&
muxer
->
cond
,
NULL
);
if
(
!
(
muxer
->
container
=
gst_bin_new
(
"wg_muxer"
)))
if
(
!
(
muxer
->
container
=
gst_bin_new
(
"wg_muxer"
)))
goto
out
;
goto
out
;
if
(
!
(
muxer
->
output_queue
=
gst_atomic_queue_new
(
8
)))
if
(
!
(
muxer
->
output_queue
=
gst_atomic_queue_new
(
8
)))
...
@@ -287,6 +298,7 @@ out:
...
@@ -287,6 +298,7 @@ out:
gst_atomic_queue_unref
(
muxer
->
output_queue
);
gst_atomic_queue_unref
(
muxer
->
output_queue
);
if
(
muxer
->
container
)
if
(
muxer
->
container
)
gst_object_unref
(
muxer
->
container
);
gst_object_unref
(
muxer
->
container
);
pthread_cond_destroy
(
&
muxer
->
cond
);
pthread_mutex_destroy
(
&
muxer
->
mutex
);
pthread_mutex_destroy
(
&
muxer
->
mutex
);
free
(
muxer
);
free
(
muxer
);
...
@@ -317,6 +329,7 @@ NTSTATUS wg_muxer_destroy(void *args)
...
@@ -317,6 +329,7 @@ NTSTATUS wg_muxer_destroy(void *args)
gst_element_set_state
(
muxer
->
container
,
GST_STATE_NULL
);
gst_element_set_state
(
muxer
->
container
,
GST_STATE_NULL
);
gst_object_unref
(
muxer
->
container
);
gst_object_unref
(
muxer
->
container
);
pthread_cond_destroy
(
&
muxer
->
cond
);
pthread_mutex_destroy
(
&
muxer
->
mutex
);
pthread_mutex_destroy
(
&
muxer
->
mutex
);
free
(
muxer
);
free
(
muxer
);
...
@@ -526,6 +539,22 @@ NTSTATUS wg_muxer_read_data(void *args)
...
@@ -526,6 +539,22 @@ NTSTATUS wg_muxer_read_data(void *args)
NTSTATUS
wg_muxer_finalize
(
void
*
args
)
NTSTATUS
wg_muxer_finalize
(
void
*
args
)
{
{
GST_FIXME
(
"Not implemented."
);
struct
wg_muxer
*
muxer
=
get_muxer
(
*
(
wg_muxer_t
*
)
args
);
return
STATUS_NOT_IMPLEMENTED
;
struct
wg_muxer_stream
*
stream
;
/* Notify each stream of EOS. */
LIST_FOR_EACH_ENTRY
(
stream
,
&
muxer
->
streams
,
struct
wg_muxer_stream
,
entry
)
{
if
(
!
push_event
(
stream
->
my_src
,
gst_event_new_segment_done
(
GST_FORMAT_BYTES
,
-
1
))
||
!
push_event
(
stream
->
my_src
,
gst_event_new_eos
()))
return
STATUS_UNSUCCESSFUL
;
}
/* Wait for muxer EOS. */
pthread_mutex_lock
(
&
muxer
->
mutex
);
while
(
!
muxer
->
eos
)
pthread_cond_wait
(
&
muxer
->
cond
,
&
muxer
->
mutex
);
pthread_mutex_unlock
(
&
muxer
->
mutex
);
return
STATUS_SUCCESS
;
}
}
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