tizen 2.3 release
[framework/multimedia/gst-plugins-base0.10.git] / gst-libs / gst / pbutils / pbutils.c
1 /* GStreamer base utils library
2  * Copyright (C) 2006 Tim-Philipp Müller <tim centricular net>
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19
20 /**
21  * SECTION:gstpbutils
22  * @short_description: General Application and Plugin Utility Library
23  *
24  * <refsect2>
25  * <para>
26  * libgstpbutils is a general utility library for plugins and applications,
27  * available since gst-plugins-base 0.10.12. It currently provides the
28  * following:
29  * </para>
30  * <itemizedlist>
31  * <listitem>
32  * <para>
33  * human-readable description strings of codecs, elements, sources, decoders,
34  * encoders, or sinks from decoder/encoder caps, element names, or protocol
35  * names.
36  * </para>
37  * </listitem>
38  * <listitem>
39  * <para>
40  * support for applications to initiate installation of missing plugins (if
41  * this is supported by the distribution or operating system used)
42  * </para>
43  * </listitem>
44  * <listitem>
45  * <para>
46  * API for GStreamer elements to create missing-plugin messages in order to
47  * communicate to the application that a certain type of plugin is missing
48  * (decoder, encoder, URI protocol source, URI protocol sink, named element)
49  * </para>
50  * </listitem>
51  * <listitem>
52  * <para>
53  * API for applications to recognise and handle missing-plugin messages
54  * </para>
55  * </listitem>
56  * </itemizedlist>
57  * <title>Linking to this library</title>
58  * <para>
59  * You should obtain the required CFLAGS and LIBS using pkg-config on the
60  * gstreamer-plugins-base-0.10 module. You will then also need to add
61  * '-lgstpbutils-0.10' manually to your LIBS line.
62  * </para>
63  * <title>Library initialisation</title>
64  * <para>
65  * Before using any of its functions, applications and plugins must call
66  * gst_pb_utils_init() to initialise the library.
67  * </para>
68  * </refsect2>
69  */
70
71 #ifdef HAVE_CONFIG_H
72 # include "config.h"
73 #endif
74
75 #include "pbutils.h"
76
77 #include "gst/gst-i18n-plugin.h"
78
79 /**
80  * gst_pb_utils_init:
81  *
82  * Initialises the base utils support library. This function is not
83  * thread-safe. Applications should call it after calling gst_init(),
84  * plugins should call it from their plugin_init function.
85  *
86  * This function may be called multiple times. It will do nothing if the
87  * library has already been initialised.
88  *
89  * Since: 0.10.12
90  */
91 void
92 gst_pb_utils_init (void)
93 {
94   static gboolean inited;       /* FALSE */
95
96   if (inited) {
97     GST_LOG ("already initialised");
98     return;
99   }
100 #ifdef ENABLE_NLS
101   GST_DEBUG ("binding text domain %s to locale dir %s", GETTEXT_PACKAGE,
102       LOCALEDIR);
103   bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
104   bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
105 #endif
106
107   inited = TRUE;
108 }