mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-30 20:59:44 +00:00
GESTrackParseLaunchEffect: better create_element implementation
This commit is contained in:
parent
d6945879a0
commit
a1f11bed79
1 changed files with 24 additions and 5 deletions
|
@ -136,18 +136,37 @@ static GstElement *
|
||||||
ges_track_parse_launch_effect_create_element (GESTrackObject * object)
|
ges_track_parse_launch_effect_create_element (GESTrackObject * object)
|
||||||
{
|
{
|
||||||
GstElement *effect;
|
GstElement *effect;
|
||||||
|
gchar *bin_desc;
|
||||||
|
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
GESTrackParseLaunchEffect *self = GES_TRACK_PARSE_LAUNCH_EFFECT (object);
|
GESTrackParseLaunchEffect *self = GES_TRACK_PARSE_LAUNCH_EFFECT (object);
|
||||||
|
GESTrack *track = ges_track_object_get_track (object);
|
||||||
|
|
||||||
effect =
|
if (!track) {
|
||||||
gst_parse_bin_from_description (self->priv->bin_description, TRUE,
|
GST_WARNING
|
||||||
&error);
|
("The object %p should be in a Track for the element to be created");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (track->type == GES_TRACK_TYPE_VIDEO) {
|
||||||
|
bin_desc = g_strconcat ("ffmpegcolorspace !",
|
||||||
|
self->priv->bin_description, " ! ffmpegcolorspace", NULL);
|
||||||
|
} else if (track->type == GES_TRACK_TYPE_AUDIO) {
|
||||||
|
bin_desc = g_strconcat ("audioconvert ! audioresample !", self->priv->bin_description, NULL);
|
||||||
|
} else {
|
||||||
|
GST_DEBUG ("We don not suppoort this track type here");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
effect = gst_parse_bin_from_description (bin_desc, TRUE, &error);
|
||||||
|
|
||||||
|
g_free (bin_desc);
|
||||||
|
|
||||||
if (error != NULL) {
|
if (error != NULL) {
|
||||||
g_error_free (error);
|
GST_DEBUG ("%s accured while creating the GstElement", error->message);
|
||||||
|
g_error_free (error);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_DEBUG ("Created %p", effect);
|
GST_DEBUG ("Created %p", effect);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue