examples: reuse variables in encoding example

This commit is contained in:
Luis de Bethencourt 2015-04-09 11:23:25 +01:00
parent a21795260f
commit 0915cb0e78

View file

@ -1,4 +1,7 @@
/* Example application for using GstProfile and encodebin
/* GStreamer
*
* encoding.c: example application for using GstProfile and encodebin
*
* Copyright (C) 2009 Edward Hervey <edward.hervey@collabora.co.uk>
*
* This library is free software; you can redistribute it and/or
@ -34,9 +37,10 @@ static gboolean silent = FALSE;
static void
list_codecs (void)
{
GstCaps *l;
GstCaps *caps;
GstCaps *l, *caps;
GstStructure *st;
guint i, len;
gchar *tmpstr, *desc;
caps = gst_caps_new_empty ();
@ -44,9 +48,7 @@ list_codecs (void)
l = gst_caps_list_container_formats (GST_RANK_NONE);
len = gst_caps_get_size (l);
for (i = 0; i < len; i++) {
GstStructure *st = gst_caps_steal_structure (l, 0);
gchar *tmpstr, *desc;
st = gst_caps_steal_structure (l, 0);
gst_caps_append_structure (caps, st);
tmpstr = gst_caps_to_string (caps);
@ -64,9 +66,7 @@ list_codecs (void)
l = gst_caps_list_video_encoding_formats (GST_RANK_NONE);
len = gst_caps_get_size (l);
for (i = 0; i < len; i++) {
GstStructure *st = gst_caps_steal_structure (l, 0);
gchar *tmpstr, *desc;
st = gst_caps_steal_structure (l, 0);
gst_caps_append_structure (caps, st);
tmpstr = gst_caps_to_string (caps);
@ -84,9 +84,7 @@ list_codecs (void)
l = gst_caps_list_audio_encoding_formats (GST_RANK_NONE);
len = gst_caps_get_size (l);
for (i = 0; i < len; i++) {
GstStructure *st = gst_caps_steal_structure (l, 0);
gchar *tmpstr, *desc;
st = gst_caps_steal_structure (l, 0);
gst_caps_append_structure (caps, st);
tmpstr = gst_caps_to_string (caps);