projects
/
platform
/
upstream
/
gstreamer.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
tee: Check for the removed pad flag also in the slow pushing path
[platform/upstream/gstreamer.git]
/
gst
/
gstformat.c
diff --git
a/gst/gstformat.c
b/gst/gstformat.c
index
24c3d0f
..
130fc77
100644
(file)
--- a/
gst/gstformat.c
+++ b/
gst/gstformat.c
@@
-17,12
+17,13
@@
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
- * Free Software Foundation, Inc., 5
9 Temple Place - Suite 330
,
- * Boston, MA 0211
1-1307
, USA.
+ * Free Software Foundation, Inc., 5
1 Franklin St, Fifth Floor
,
+ * Boston, MA 0211
0-1301
, USA.
*/
/**
* SECTION:gstformat
*/
/**
* SECTION:gstformat
+ * @title: GstFormat
* @short_description: Dynamically register new data formats
* @see_also: #GstPad, #GstElement
*
* @short_description: Dynamically register new data formats
* @see_also: #GstPad, #GstElement
*
@@
-37,7
+38,7
@@
#include "gstformat.h"
#include "gstenumtypes.h"
#include "gstformat.h"
#include "gstenumtypes.h"
-static G
StaticMutex mutex = G_STATIC_MUTEX_INIT
;
+static G
Mutex mutex
;
static GList *_gst_formats = NULL;
static GHashTable *_nick_to_format = NULL;
static GHashTable *_format_to_nick = NULL;
static GList *_gst_formats = NULL;
static GHashTable *_nick_to_format = NULL;
static GHashTable *_format_to_nick = NULL;
@@
-57,7
+58,7
@@
_priv_gst_format_initialize (void)
{
GstFormatDefinition *standards = standard_definitions;
{
GstFormatDefinition *standards = standard_definitions;
- g_
static_
mutex_lock (&mutex);
+ g_mutex_lock (&mutex);
if (_nick_to_format == NULL) {
_nick_to_format = g_hash_table_new (g_str_hash, g_str_equal);
_format_to_nick = g_hash_table_new (NULL, NULL);
if (_nick_to_format == NULL) {
_nick_to_format = g_hash_table_new (g_str_hash, g_str_equal);
_format_to_nick = g_hash_table_new (NULL, NULL);
@@
-76,7
+77,7
@@
_priv_gst_format_initialize (void)
}
/* getting the type registers the enum */
g_type_class_ref (gst_format_get_type ());
}
/* getting the type registers the enum */
g_type_class_ref (gst_format_get_type ());
- g_
static_
mutex_unlock (&mutex);
+ g_mutex_unlock (&mutex);
}
/**
}
/**
@@
-85,8
+86,8
@@
_priv_gst_format_initialize (void)
*
* Get a printable name for the given format. Do not modify or free.
*
*
* Get a printable name for the given format. Do not modify or free.
*
- * Returns:
a reference to the static name of the format or NULL if
- * the format is unknown.
+ * Returns:
(nullable): a reference to the static name of the format
+ *
or %NULL if
the format is unknown.
*/
const gchar *
gst_format_get_name (GstFormat format)
*/
const gchar *
gst_format_get_name (GstFormat format)
@@
-151,7
+152,7
@@
gst_format_register (const gchar * nick, const gchar * description)
if (query != GST_FORMAT_UNDEFINED)
return query;
if (query != GST_FORMAT_UNDEFINED)
return query;
- g_
static_
mutex_lock (&mutex);
+ g_mutex_lock (&mutex);
format = g_slice_new (GstFormatDefinition);
format->value = (GstFormat) _n_values;
format->nick = g_strdup (nick);
format = g_slice_new (GstFormatDefinition);
format->value = (GstFormat) _n_values;
format->nick = g_strdup (nick);
@@
-163,7
+164,7
@@
gst_format_register (const gchar * nick, const gchar * description)
format);
_gst_formats = g_list_append (_gst_formats, format);
_n_values++;
format);
_gst_formats = g_list_append (_gst_formats, format);
_n_values++;
- g_
static_
mutex_unlock (&mutex);
+ g_mutex_unlock (&mutex);
return format->value;
}
return format->value;
}
@@
-184,9
+185,9
@@
gst_format_get_by_nick (const gchar * nick)
g_return_val_if_fail (nick != NULL, GST_FORMAT_UNDEFINED);
g_return_val_if_fail (nick != NULL, GST_FORMAT_UNDEFINED);
- g_
static_
mutex_lock (&mutex);
+ g_mutex_lock (&mutex);
format = g_hash_table_lookup (_nick_to_format, nick);
format = g_hash_table_lookup (_nick_to_format, nick);
- g_
static_
mutex_unlock (&mutex);
+ g_mutex_unlock (&mutex);
if (format != NULL)
return format->value;
if (format != NULL)
return format->value;
@@
-196,12
+197,12
@@
gst_format_get_by_nick (const gchar * nick)
/**
* gst_formats_contains:
/**
* gst_formats_contains:
- * @formats: The format array to search
+ * @formats:
(array zero-terminated=1):
The format array to search
* @format: the format to find
*
* See if the given format is inside the format array.
*
* @format: the format to find
*
* See if the given format is inside the format array.
*
- * Returns: TRUE if the format is found inside the array
+ * Returns:
%
TRUE if the format is found inside the array
*/
gboolean
gst_formats_contains (const GstFormat * formats, GstFormat format)
*/
gboolean
gst_formats_contains (const GstFormat * formats, GstFormat format)
@@
-225,7
+226,8
@@
gst_formats_contains (const GstFormat * formats, GstFormat format)
*
* Get details about the given format.
*
*
* Get details about the given format.
*
- * Returns: The #GstFormatDefinition for @format or NULL on failure.
+ * Returns: (nullable): The #GstFormatDefinition for @format or %NULL
+ * on failure.
*
* MT safe.
*/
*
* MT safe.
*/
@@
-234,9
+236,9
@@
gst_format_get_details (GstFormat format)
{
const GstFormatDefinition *result;
{
const GstFormatDefinition *result;
- g_
static_
mutex_lock (&mutex);
+ g_mutex_lock (&mutex);
result = g_hash_table_lookup (_format_to_nick, GINT_TO_POINTER (format));
result = g_hash_table_lookup (_format_to_nick, GINT_TO_POINTER (format));
- g_
static_
mutex_unlock (&mutex);
+ g_mutex_unlock (&mutex);
return result;
}
return result;
}
@@
-254,11
+256,11
@@
gst_format_iterate_definitions (void)
{
GstIterator *result;
{
GstIterator *result;
- g_
static_
mutex_lock (&mutex);
+ g_mutex_lock (&mutex);
/* FIXME: register a boxed type for GstFormatDefinition */
result = gst_iterator_new_list (G_TYPE_POINTER,
/* FIXME: register a boxed type for GstFormatDefinition */
result = gst_iterator_new_list (G_TYPE_POINTER,
-
g_static_mutex_get_mutex (&mutex)
, &_n_values, &_gst_formats, NULL, NULL);
- g_
static_
mutex_unlock (&mutex);
+
&mutex
, &_n_values, &_gst_formats, NULL, NULL);
+ g_mutex_unlock (&mutex);
return result;
}
return result;
}