diff options
author | Edward Hervey <edward.hervey@collabora.co.uk> | 2011-01-03 19:07:45 +0100 |
---|---|---|
committer | Edward Hervey <bilboed@bilboed.com> | 2011-01-05 20:54:21 +0100 |
commit | 5a8858b3bcba9f45b02c37785f813d1820c7f8f6 (patch) | |
tree | 0092846d5ae310973257625e971a067a18d928a7 | |
parent | 777f816ff162aa7c2d6bd2dbf3b123615e8f91e5 (diff) |
encoding-profile: Give a better usage example
-rw-r--r-- | gst-libs/gst/pbutils/encoding-profile.c | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/gst-libs/gst/pbutils/encoding-profile.c b/gst-libs/gst/pbutils/encoding-profile.c index 00a7f38cb..1e7b52544 100644 --- a/gst-libs/gst/pbutils/encoding-profile.c +++ b/gst-libs/gst/pbutils/encoding-profile.c @@ -85,27 +85,36 @@ * </para> * </refsect2> * <refsect2> - * <title>Example: Loading a profile from disk</title> + * <title>Example: Listing categories, targets and profiles</title> * <para> * |[ * #include <gst/pbutils/encoding-profile.h> * ... - *GstEncodingProfile * - *get_ogg_theora_profile(const gchar *path, const gchar *profilename) - *{ - * GstEncodingProfile *prof = NULL; - * GstEncodingTarget *target = NULL; + * GstEncodingProfile *prof; + * GList *categories, *tmpc; + * GList *targets, *tmpt; + * ... + * categories = gst_encoding_target_list_available_categories(); * - * target = gst_encoding_target_load_from (path); - * if (target == NULL) - * return NULL; + * ... Show available categories to user ... * - * prof = gst_encoding_target_get_profile (target, profilename); + * for (tmpc = categories; tmpc; tmpc = tmpc->next) { + * gchar *category = (gchar *) tmpc->data; * - * gst_encoding_target_unref (target); + * ... and we can list all targets within that category ... + * + * targets = gst_encoding_target_list_all (category); * - * return prof; - *} + * ... and show a list to our users ... + * + * g_list_foreach (targets, (GFunc) gst_encoding_target_unref, NULL); + * g_list_free (targets); + * } + * + * g_list_foreach (categories, (GFunc) g_free, NULL); + * g_list_free (categories); + * + * ... * ]| * </para> * </refsect2> |