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
This commit is contained in:
Sebastian Dröge 2017-12-03 12:57:25 +02:00
parent dfc6962eb8
commit 6cf853997a
2 changed files with 3 additions and 7 deletions

View file

@ -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

View file

@ -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!
It has been a pleasure having you here, and see you soon!