{
GESPipeline *pipeline = GES_PIPELINE (overlay);
- gst_video_overlay_set_render_rectangle (GST_VIDEO_OVERLAY (pipeline->
- priv->playsink), x, y, width, height);
+ gst_video_overlay_set_render_rectangle (GST_VIDEO_OVERLAY (pipeline->priv->
+ playsink), x, y, width, height);
}
static void
{
GESPipeline *pipeline = GES_PIPELINE (overlay);
- gst_video_overlay_set_window_handle (GST_VIDEO_OVERLAY (pipeline->priv->
- playsink), handle);
+ gst_video_overlay_set_window_handle (GST_VIDEO_OVERLAY (pipeline->
+ priv->playsink), handle);
}
static void
_timeline_track_added_cb (GESTimeline * timeline, GESTrack * track,
GESPipeline * pipeline)
{
+ track_disable_last_gap (track,
+ ! !(pipeline->priv->mode & (GES_PIPELINE_MODE_RENDER |
+ GES_PIPELINE_MODE_SMART_RENDER)));
_link_track (pipeline, track);
}
}
/* Connect to encodebin */
- if (self->priv->
- mode & (GES_PIPELINE_MODE_RENDER | GES_PIPELINE_MODE_SMART_RENDER)) {
+ if (self->
+ priv->mode & (GES_PIPELINE_MODE_RENDER | GES_PIPELINE_MODE_SMART_RENDER))
+ {
GstPad *tmppad;
GST_DEBUG_OBJECT (self, "Connecting to encodebin");
gboolean
ges_pipeline_set_mode (GESPipeline * pipeline, GESPipelineFlags mode)
{
+
+ GList *tmp;
g_return_val_if_fail (GES_IS_PIPELINE (pipeline), FALSE);
- GST_DEBUG_OBJECT (pipeline, "current mode : %d, mode : %d",
+ GST_ERROR_OBJECT (pipeline, "current mode : %d, mode : %d",
pipeline->priv->mode, mode);
/* fast-path, nothing to change */
/* Switch pipeline to NULL since we're changing the configuration */
gst_element_set_state (GST_ELEMENT_CAST (pipeline), GST_STATE_NULL);
+
+ if (pipeline->priv->timeline) {
+ gboolean disabled =
+ ! !(mode & (GES_PIPELINE_MODE_RENDER | GES_PIPELINE_MODE_SMART_RENDER));
+
+ for (tmp = pipeline->priv->timeline->tracks; tmp; tmp = tmp->next)
+ track_disable_last_gap (GES_TRACK (tmp->data), disabled);
+ }
+
/* remove no-longer needed components */
if (pipeline->priv->mode & GES_PIPELINE_MODE_PREVIEW &&
!(mode & GES_PIPELINE_MODE_PREVIEW)) {
(mode & GES_PIPELINE_MODE_PREVIEW)) {
/* Add playsink */
GST_DEBUG ("Adding playsink");
-
if (!gst_bin_add (GST_BIN_CAST (pipeline), pipeline->priv->playsink)) {
GST_ERROR_OBJECT (pipeline, "Couldn't add playsink");
return FALSE;
GSequence *trackelements_by_start;
GHashTable *trackelements_iter;
GList *gaps;
+ gboolean last_gap_disabled;
guint64 duration;
}
}
- GST_DEBUG_OBJECT (track, "Adding a one second gap at the end");
- gap = gap_new (track, timeline_duration, 1);
- priv->gaps = g_list_prepend (priv->gaps, gap);
+ if (!track->priv->last_gap_disabled) {
+ GST_DEBUG_OBJECT (track, "Adding a one second gap at the end");
+ gap = gap_new (track, timeline_duration, 1);
+ priv->gaps = g_list_prepend (priv->gaps, gap);
+ }
/* 4- Remove old gaps */
g_list_free_full (gaps, (GDestroyNotify) free_gap);
}
void
+track_disable_last_gap (GESTrack * track, gboolean disabled)
+{
+ track->priv->last_gap_disabled = disabled;
+ update_gaps (track);
+}
+
+void
track_resort_and_fill_gaps (GESTrack * track)
{
g_sequence_sort (track->priv->trackelements_by_start,