diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2017-12-03 12:57:25 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2017-12-03 12:57:25 +0200 |
commit | 6cf853997a30aaae673814a87bc133c94e1398ca (patch) | |
tree | c0db9b153ad69bd4333fb826675b0cb37c60142c | |
parent | dfc6962eb852a0205ccb42869f1b9d2a596ec590 (diff) |
Remove audio_caps_text in the tutorials
The caps are created from a GstAudioInfo, not from a string.
https://bugzilla.gnome.org/show_bug.cgi?id=791157
-rw-r--r-- | markdown/tutorials/basic/short-cutting-the-pipeline.md | 6 | ||||
-rw-r--r-- | markdown/tutorials/playback/short-cutting-the-pipeline.md | 4 |
2 files changed, 3 insertions, 7 deletions
diff --git a/markdown/tutorials/basic/short-cutting-the-pipeline.md b/markdown/tutorials/basic/short-cutting-the-pipeline.md index b15fdf3..b3e7cf8 100644 --- a/markdown/tutorials/basic/short-cutting-the-pipeline.md +++ b/markdown/tutorials/basic/short-cutting-the-pipeline.md @@ -263,7 +263,6 @@ int main(int argc, char *argv[]) { g_object_set (data.app_sink, "emit-signals", TRUE, "caps", audio_caps, NULL); g_signal_connect (data.app_sink, "new-sample", G_CALLBACK (new_sample), &data); gst_caps_unref (audio_caps); - g_free (audio_caps_text); /* Link all elements that can be automatically linked because they have "Always" pads */ gst_bin_add_many (GST_BIN (data.pipeline), data.app_source, data.tee, data.audio_queue, data.audio_convert1, data.audio_resample, @@ -352,8 +351,8 @@ Regarding the configuration of the `appsrc` and `appsink` elements: ``` c /* Configure appsrc */ -audio_caps_text = g_strdup_printf (AUDIO_CAPS, SAMPLE_RATE); -audio_caps = gst_caps_from_string (audio_caps_text); +gst_audio_info_set_format (&info, GST_AUDIO_FORMAT_S16, SAMPLE_RATE, 1, NULL); +audio_caps = gst_audio_info_to_caps (&info); g_object_set (data.app_source, "caps", audio_caps, NULL); g_signal_connect (data.app_source, "need-data", G_CALLBACK (start_feed), &data); g_signal_connect (data.app_source, "enough-data", G_CALLBACK (stop_feed), &data); @@ -376,7 +375,6 @@ almost full, respectively. We will use these signals to start and stop g_object_set (data.app_sink, "emit-signals", TRUE, "caps", audio_caps, NULL); g_signal_connect (data.app_sink, "new-sample", G_CALLBACK (new_sample), &data); gst_caps_unref (audio_caps); -g_free (audio_caps_text); ``` Regarding the `appsink` configuration, we connect to the diff --git a/markdown/tutorials/playback/short-cutting-the-pipeline.md b/markdown/tutorials/playback/short-cutting-the-pipeline.md index be7e41e..00f6803 100644 --- a/markdown/tutorials/playback/short-cutting-the-pipeline.md +++ b/markdown/tutorials/playback/short-cutting-the-pipeline.md @@ -137,7 +137,6 @@ static void source_setup (GstElement *pipeline, GstElement *source, CustomData * g_signal_connect (source, "need-data", G_CALLBACK (start_feed), data); g_signal_connect (source, "enough-data", G_CALLBACK (stop_feed), data); gst_caps_unref (audio_caps); - g_free (audio_caps_text); } int main(int argc, char *argv[]) { @@ -214,7 +213,6 @@ static void source_setup (GstElement *pipeline, GstElement *source, CustomData * g_signal_connect (source, "need-data", G_CALLBACK (start_feed), data); g_signal_connect (source, "enough-data", G_CALLBACK (stop_feed), data); gst_caps_unref (audio_caps); - g_free (audio_caps_text); } ``` @@ -242,4 +240,4 @@ This tutorial applies the concepts shown in URI `appsrc://` - How to configure the `appsrc` using the `source-setup` signal -It has been a pleasure having you here, and see you soon!
\ No newline at end of file +It has been a pleasure having you here, and see you soon! |