Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
gst-editing-services
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
77
Issues
77
List
Boards
Labels
Service Desk
Milestones
Merge Requests
11
Merge Requests
11
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
GStreamer
gst-editing-services
Commits
93289ac4
Commit
93289ac4
authored
Jun 06, 2019
by
Thibault Saunier
🌵
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gesdemux: Properly combine flows
parent
cf43d9b6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
3 deletions
+37
-3
plugins/ges/gesdemux.c
plugins/ges/gesdemux.c
+37
-3
No files found.
plugins/ges/gesdemux.c
View file @
93289ac4
...
...
@@ -73,6 +73,7 @@ struct _GESDemux
GstPad
*
sinkpad
;
GstAdapter
*
input_adapter
;
GstFlowCombiner
*
flow_combiner
;
};
G_DEFINE_TYPE
(
GESDemux
,
ges_demux
,
GST_TYPE_BIN
);
...
...
@@ -87,6 +88,24 @@ enum
static
GParamSpec
*
properties
[
PROP_LAST
];
static
GstFlowReturn
gst_demux_src_chain
(
GstPad
*
pad
,
GstObject
*
parent
,
GstBuffer
*
buffer
)
{
GstFlowReturn
result
,
chain_result
;
GESDemux
*
self
=
GES_DEMUX
(
GST_OBJECT_PARENT
(
parent
));
chain_result
=
gst_proxy_pad_chain_default
(
pad
,
GST_OBJECT
(
self
),
buffer
);
result
=
gst_flow_combiner_update_pad_flow
(
self
->
flow_combiner
,
pad
,
chain_result
);
if
(
result
==
GST_FLOW_FLUSHING
)
{
return
chain_result
;
}
return
result
;
}
static
gboolean
ges_demux_set_timeline
(
GESDemux
*
self
,
GESTimeline
*
timeline
)
{
...
...
@@ -110,12 +129,13 @@ ges_demux_set_timeline (GESDemux * self, GESTimeline * timeline)
return
FALSE
;
}
for
(
tmp
=
self
->
timeline
->
tracks
;
tmp
;
tmp
=
tmp
->
next
)
{
GstPad
*
gpad
;
gchar
*
name
=
NULL
;
GstElement
*
queue
;
GESTrack
*
track
=
GES_TRACK
(
tmp
->
data
);
GstPad
*
tmppad
,
*
pad
=
GstPad
*
proxy_pad
,
*
tmppad
,
*
pad
=
ges_timeline_get_pad_for_track
(
self
->
timeline
,
track
);
GstStaticPadTemplate
*
template
;
...
...
@@ -159,6 +179,12 @@ ges_demux_set_timeline (GESDemux * self, GESTimeline * timeline)
gst_pad_set_active
(
gpad
,
TRUE
);
gst_element_add_pad
(
GST_ELEMENT
(
self
),
gpad
);
proxy_pad
=
GST_PAD
(
gst_proxy_pad_get_internal
(
GST_PROXY_PAD
(
gpad
)));
gst_flow_combiner_add_pad
(
self
->
flow_combiner
,
proxy_pad
);
gst_pad_set_chain_function
(
proxy_pad
,
(
GstPadChainFunction
)
gst_demux_src_chain
);
gst_object_unref
(
proxy_pad
);
GST_DEBUG_OBJECT
(
self
,
"Adding pad: %"
GST_PTR_FORMAT
,
gpad
);
}
...
...
@@ -201,6 +227,14 @@ ges_demux_dispose (GObject * object)
gst_clear_object
(
&
self
->
timeline
);
}
static
void
ges_demux_finalize
(
GObject
*
object
)
{
GESDemux
*
self
=
GES_DEMUX
(
object
);
gst_flow_combiner_free
(
self
->
flow_combiner
);
}
static
void
ges_demux_class_init
(
GESDemuxClass
*
self_class
)
{
...
...
@@ -212,6 +246,7 @@ ges_demux_class_init (GESDemuxClass * self_class)
gclass
->
get_property
=
ges_demux_get_property
;
gclass
->
set_property
=
ges_demux_set_property
;
gclass
->
dispose
=
ges_demux_dispose
;
gclass
->
finalize
=
ges_demux_finalize
;
/**
* GESDemux:timeline:
...
...
@@ -377,7 +412,6 @@ ges_demux_sink_event (GstPad * pad, GstObject * parent, GstEvent * event)
gint
f
=
g_file_open_tmp
(
NULL
,
&
filename
,
&
err
);
GMainContext
*
main_context
=
g_main_context_default
();
GST_ERROR
(
"Loading %s"
,
filename
);
if
(
err
)
{
GST_ELEMENT_ERROR
(
self
,
RESOURCE
,
OPEN_WRITE
,
(
"Could not open temporary file to write timeline description"
),
...
...
@@ -432,7 +466,6 @@ ges_demux_sink_event (GstPad * pad, GstObject * parent, GstEvent * event)
(
"Could not map buffer containing timeline description"
),
(
"Not info"
));
}
GST_ERROR_OBJECT
(
xges_buffer
,
":YAY"
);
}
default:
break
;
...
...
@@ -462,6 +495,7 @@ ges_demux_init (GESDemux * self)
gst_element_add_pad
(
GST_ELEMENT
(
self
),
self
->
sinkpad
);
self
->
input_adapter
=
gst_adapter_new
();
self
->
flow_combiner
=
gst_flow_combiner_new
();
gst_pad_set_chain_function
(
self
->
sinkpad
,
GST_DEBUG_FUNCPTR
(
ges_demux_sink_chain
));
...
...
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