pipeline: stop setting the track caps

Stop setting the track 'caps' property. The previous code could
overwrite a users own setting of the caps for video and audio caps.
Moreover, the 'caps' property is listed as construct only, and users
will likely expect it to stay the same after a track has been added to a
timeline.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/198>
This commit is contained in:
Henry Wilkes 2020-01-13 13:08:24 +00:00 committed by Thibault Saunier
parent 5bb0b46809
commit c2532a48c2
3 changed files with 2 additions and 47 deletions

View file

@ -475,7 +475,6 @@ G_GNUC_INTERNAL GstElement* ges_source_create_topbin (GESSource *source,
const gchar* bin_name,
GstElement* sub_element,
GPtrArray* elements);
G_GNUC_INTERNAL void ges_track_set_caps (GESTrack* track, const GstCaps* caps);
G_GNUC_INTERNAL GstElement * ges_track_get_composition (GESTrack *track);

View file

@ -442,37 +442,8 @@ static gboolean
_track_is_compatible_with_profile (GESPipeline * self, GESTrack * track,
GstEncodingProfile * prof)
{
if (TRACK_COMPATIBLE_PROFILE (track->type, prof)) {
if (self->priv->mode == GES_PIPELINE_MODE_SMART_RENDER) {
GstCaps *ocaps, *rcaps;
GST_DEBUG ("Smart Render mode, setting input caps");
ocaps = gst_encoding_profile_get_input_caps (prof);
ocaps = gst_caps_make_writable (ocaps);
if (track->type == GES_TRACK_TYPE_AUDIO)
rcaps = gst_caps_new_empty_simple ("audio/x-raw");
else
rcaps = gst_caps_new_empty_simple ("video/x-raw");
gst_caps_append (ocaps, rcaps);
ges_track_set_caps (track, ocaps);
gst_caps_unref (ocaps);
} else {
GstCaps *caps = NULL;
/* Raw preview or rendering mode */
if (track->type == GES_TRACK_TYPE_VIDEO)
caps = gst_caps_new_empty_simple ("video/x-raw");
else if (track->type == GES_TRACK_TYPE_AUDIO)
caps = gst_caps_new_empty_simple ("audio/x-raw");
if (caps) {
ges_track_set_caps (track, caps);
gst_caps_unref (caps);
}
}
if (TRACK_COMPATIBLE_PROFILE (track->type, prof))
return TRUE;
}
return FALSE;
}
@ -1253,22 +1224,6 @@ ges_pipeline_set_mode (GESPipeline * pipeline, GESPipelineFlags mode)
if ((pipeline->priv->mode &
(GES_PIPELINE_MODE_RENDER | GES_PIPELINE_MODE_SMART_RENDER)) &&
!(mode & (GES_PIPELINE_MODE_RENDER | GES_PIPELINE_MODE_SMART_RENDER))) {
GList *tmp;
GstCaps *caps;
for (tmp = pipeline->priv->timeline->tracks; tmp; tmp = tmp->next) {
GESTrackType type = GES_TRACK (tmp->data)->type;
if (type == GES_TRACK_TYPE_AUDIO)
caps = gst_caps_new_empty_simple ("audio/x-raw");
else if (type == GES_TRACK_TYPE_VIDEO)
caps = gst_caps_new_empty_simple ("video/x-raw");
else
continue;
ges_track_set_caps (GES_TRACK (tmp->data), caps);
gst_caps_unref (caps);
}
/* Disable render bin */
GST_DEBUG ("Disabling rendering bin");

View file

@ -129,6 +129,7 @@ G_DEFINE_TYPE_WITH_CODE (GESTrack, ges_track, GST_TYPE_BIN,
static void composition_duration_cb (GstElement * composition, GParamSpec * arg
G_GNUC_UNUSED, GESTrack * obj);
static void ges_track_set_caps (GESTrack * track, const GstCaps * caps);
/* Private methods/functions/callbacks */
static void