diff --git a/gst-sdk/tutorials/basic-tutorial-5.c b/gst-sdk/tutorials/basic-tutorial-5.c index 639cc25d19..83e0a88eb6 100644 --- a/gst-sdk/tutorials/basic-tutorial-5.c +++ b/gst-sdk/tutorials/basic-tutorial-5.c @@ -224,88 +224,88 @@ static void state_changed_cb (GstBus *bus, GstMessage *msg, CustomData *data) { } } -/* Extract metadata from all the streams and write it to the text widget in the GUI */ -static void analyze_streams (CustomData *data) { - gint i; - GstTagList *tags; - gchar *str, *total_str; - guint rate; +/* Extract metadata from all the streams and write it to the text widget in the GUI */ +static void analyze_streams (CustomData *data) { + gint i; + GstTagList *tags; + gchar *str, *total_str; + guint rate; gint n_video, n_audio, n_text; - GtkTextBuffer *text; + GtkTextBuffer *text; /* Clean current contents of the widget */ - text = gtk_text_view_get_buffer (GTK_TEXT_VIEW (data->streams_list)); - gtk_text_buffer_set_text (text, "", -1); - - /* Read some properties */ - g_object_get (data->playbin2, "n-video", &n_video, NULL); - g_object_get (data->playbin2, "n-audio", &n_audio, NULL); - g_object_get (data->playbin2, "n-text", &n_text, NULL); - - for (i = 0; i < n_video; i++) { - tags = NULL; - /* Retrieve the stream's video tags */ - g_signal_emit_by_name (data->playbin2, "get-video-tags", i, &tags); - if (tags) { - total_str = g_strdup_printf ("video stream %d:\n", i); - gtk_text_buffer_insert_at_cursor (text, total_str, -1); - g_free (total_str); - gst_tag_list_get_string (tags, GST_TAG_VIDEO_CODEC, &str); - total_str = g_strdup_printf (" codec: %s\n", str ? str : "unknown"); - gtk_text_buffer_insert_at_cursor (text, total_str, -1); - g_free (total_str); - g_free (str); - gst_tag_list_free (tags); - } - } - - for (i = 0; i < n_audio; i++) { - tags = NULL; - /* Retrieve the stream's audio tags */ - g_signal_emit_by_name (data->playbin2, "get-audio-tags", i, &tags); - if (tags) { - total_str = g_strdup_printf ("\naudio stream %d:\n", i); - gtk_text_buffer_insert_at_cursor (text, total_str, -1); - g_free (total_str); - if (gst_tag_list_get_string (tags, GST_TAG_AUDIO_CODEC, &str)) { - total_str = g_strdup_printf (" codec: %s\n", str); - gtk_text_buffer_insert_at_cursor (text, total_str, -1); - g_free (total_str); - g_free (str); - } - if (gst_tag_list_get_string (tags, GST_TAG_LANGUAGE_CODE, &str)) { - total_str = g_strdup_printf (" language: %s\n", str); - gtk_text_buffer_insert_at_cursor (text, total_str, -1); - g_free (total_str); - g_free (str); - } - if (gst_tag_list_get_uint (tags, GST_TAG_BITRATE, &rate)) { - total_str = g_strdup_printf (" bitrate: %d\n", rate); - gtk_text_buffer_insert_at_cursor (text, total_str, -1); - g_free (total_str); - } - gst_tag_list_free (tags); - } - } - - for (i = 0; i < n_text; i++) { - tags = NULL; - /* Retrieve the stream's subtitle tags */ - g_signal_emit_by_name (data->playbin2, "get-text-tags", i, &tags); - if (tags) { - total_str = g_strdup_printf ("\nsubtitle stream %d:\n", i); - gtk_text_buffer_insert_at_cursor (text, total_str, -1); - g_free (total_str); - if (gst_tag_list_get_string (tags, GST_TAG_LANGUAGE_CODE, &str)) { - total_str = g_strdup_printf (" language: %s\n", str); - gtk_text_buffer_insert_at_cursor (text, total_str, -1); - g_free (total_str); - g_free (str); - } - gst_tag_list_free (tags); - } - } -} + text = gtk_text_view_get_buffer (GTK_TEXT_VIEW (data->streams_list)); + gtk_text_buffer_set_text (text, "", -1); + + /* Read some properties */ + g_object_get (data->playbin2, "n-video", &n_video, NULL); + g_object_get (data->playbin2, "n-audio", &n_audio, NULL); + g_object_get (data->playbin2, "n-text", &n_text, NULL); + + for (i = 0; i < n_video; i++) { + tags = NULL; + /* Retrieve the stream's video tags */ + g_signal_emit_by_name (data->playbin2, "get-video-tags", i, &tags); + if (tags) { + total_str = g_strdup_printf ("video stream %d:\n", i); + gtk_text_buffer_insert_at_cursor (text, total_str, -1); + g_free (total_str); + gst_tag_list_get_string (tags, GST_TAG_VIDEO_CODEC, &str); + total_str = g_strdup_printf (" codec: %s\n", str ? str : "unknown"); + gtk_text_buffer_insert_at_cursor (text, total_str, -1); + g_free (total_str); + g_free (str); + gst_tag_list_free (tags); + } + } + + for (i = 0; i < n_audio; i++) { + tags = NULL; + /* Retrieve the stream's audio tags */ + g_signal_emit_by_name (data->playbin2, "get-audio-tags", i, &tags); + if (tags) { + total_str = g_strdup_printf ("\naudio stream %d:\n", i); + gtk_text_buffer_insert_at_cursor (text, total_str, -1); + g_free (total_str); + if (gst_tag_list_get_string (tags, GST_TAG_AUDIO_CODEC, &str)) { + total_str = g_strdup_printf (" codec: %s\n", str); + gtk_text_buffer_insert_at_cursor (text, total_str, -1); + g_free (total_str); + g_free (str); + } + if (gst_tag_list_get_string (tags, GST_TAG_LANGUAGE_CODE, &str)) { + total_str = g_strdup_printf (" language: %s\n", str); + gtk_text_buffer_insert_at_cursor (text, total_str, -1); + g_free (total_str); + g_free (str); + } + if (gst_tag_list_get_uint (tags, GST_TAG_BITRATE, &rate)) { + total_str = g_strdup_printf (" bitrate: %d\n", rate); + gtk_text_buffer_insert_at_cursor (text, total_str, -1); + g_free (total_str); + } + gst_tag_list_free (tags); + } + } + + for (i = 0; i < n_text; i++) { + tags = NULL; + /* Retrieve the stream's subtitle tags */ + g_signal_emit_by_name (data->playbin2, "get-text-tags", i, &tags); + if (tags) { + total_str = g_strdup_printf ("\nsubtitle stream %d:\n", i); + gtk_text_buffer_insert_at_cursor (text, total_str, -1); + g_free (total_str); + if (gst_tag_list_get_string (tags, GST_TAG_LANGUAGE_CODE, &str)) { + total_str = g_strdup_printf (" language: %s\n", str); + gtk_text_buffer_insert_at_cursor (text, total_str, -1); + g_free (total_str); + g_free (str); + } + gst_tag_list_free (tags); + } + } +} /* This function is called when an "application" message is posted on the bus. * Here we retrieve the message posted by the tags_cb callback */ diff --git a/vs/2010/tutorials/basic-tutorial-1/basic-tutorial-1.vcxproj b/vs/2010/tutorials/basic-tutorial-1/basic-tutorial-1.vcxproj index b5a2dabcc5..25c6579848 100644 --- a/vs/2010/tutorials/basic-tutorial-1/basic-tutorial-1.vcxproj +++ b/vs/2010/tutorials/basic-tutorial-1/basic-tutorial-1.vcxproj @@ -33,10 +33,12 @@ + + @@ -56,6 +58,8 @@ Console true + %(AdditionalDependencies) + %(AdditionalLibraryDirectories) diff --git a/vs/2010/tutorials/basic-tutorial-2/basic-tutorial-2.vcxproj b/vs/2010/tutorials/basic-tutorial-2/basic-tutorial-2.vcxproj index 2a77d025a4..fc4093d47c 100644 --- a/vs/2010/tutorials/basic-tutorial-2/basic-tutorial-2.vcxproj +++ b/vs/2010/tutorials/basic-tutorial-2/basic-tutorial-2.vcxproj @@ -33,10 +33,12 @@ + + diff --git a/vs/2010/tutorials/basic-tutorial-3/basic-tutorial-3.vcxproj b/vs/2010/tutorials/basic-tutorial-3/basic-tutorial-3.vcxproj index 46ebf02ec8..b0840ca31d 100644 --- a/vs/2010/tutorials/basic-tutorial-3/basic-tutorial-3.vcxproj +++ b/vs/2010/tutorials/basic-tutorial-3/basic-tutorial-3.vcxproj @@ -33,10 +33,12 @@ + + diff --git a/vs/2010/tutorials/basic-tutorial-4/basic-tutorial-4.vcxproj b/vs/2010/tutorials/basic-tutorial-4/basic-tutorial-4.vcxproj index bbbeb80fca..86e2da936e 100644 --- a/vs/2010/tutorials/basic-tutorial-4/basic-tutorial-4.vcxproj +++ b/vs/2010/tutorials/basic-tutorial-4/basic-tutorial-4.vcxproj @@ -33,10 +33,12 @@ + + diff --git a/vs/2010/tutorials/basic-tutorial-5/basic-tutorial-5.vcxproj b/vs/2010/tutorials/basic-tutorial-5/basic-tutorial-5.vcxproj index 610d0542d2..86837c6958 100644 --- a/vs/2010/tutorials/basic-tutorial-5/basic-tutorial-5.vcxproj +++ b/vs/2010/tutorials/basic-tutorial-5/basic-tutorial-5.vcxproj @@ -35,12 +35,14 @@ + + diff --git a/vs/2010/tutorials/playback-tutorial-1/playback-tutorial-1.vcxproj b/vs/2010/tutorials/playback-tutorial-1/playback-tutorial-1.vcxproj index c27a6ad244..79bed35685 100644 --- a/vs/2010/tutorials/playback-tutorial-1/playback-tutorial-1.vcxproj +++ b/vs/2010/tutorials/playback-tutorial-1/playback-tutorial-1.vcxproj @@ -33,10 +33,12 @@ + +