mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 19:51:11 +00:00
Use GLib's type for GError instead of our own
We introduced our own when GLib didn't want to add a GType for GError. But now that there is one, we can use GLib's unconditionally and remove our version.
This commit is contained in:
parent
58a4d806d1
commit
1654b7f1d7
8 changed files with 12 additions and 27 deletions
|
@ -876,13 +876,11 @@ GST_STREAM_ERROR
|
||||||
GST_ERROR_SYSTEM
|
GST_ERROR_SYSTEM
|
||||||
gst_error_get_message
|
gst_error_get_message
|
||||||
<SUBSECTION Standard>
|
<SUBSECTION Standard>
|
||||||
GST_TYPE_G_ERROR
|
|
||||||
GST_TYPE_CORE_ERROR
|
GST_TYPE_CORE_ERROR
|
||||||
GST_TYPE_LIBRARY_ERROR
|
GST_TYPE_LIBRARY_ERROR
|
||||||
GST_TYPE_RESOURCE_ERROR
|
GST_TYPE_RESOURCE_ERROR
|
||||||
GST_TYPE_STREAM_ERROR
|
GST_TYPE_STREAM_ERROR
|
||||||
<SUBSECTION Private>
|
<SUBSECTION Private>
|
||||||
gst_g_error_get_type
|
|
||||||
gst_core_error_get_type
|
gst_core_error_get_type
|
||||||
gst_library_error_get_type
|
gst_library_error_get_type
|
||||||
gst_resource_error_get_type
|
gst_resource_error_get_type
|
||||||
|
|
|
@ -474,3 +474,8 @@ The 0.11 porting guide
|
||||||
GST_VALUE_HOLDS_DATE(value) -> G_VALUE_HOLDS(value,G_TYPE_DATE)
|
GST_VALUE_HOLDS_DATE(value) -> G_VALUE_HOLDS(value,G_TYPE_DATE)
|
||||||
gst_value_set_date() -> g_value_set_boxed()
|
gst_value_set_date() -> g_value_set_boxed()
|
||||||
gst_value_get_date() -> g_value_get_boxed()
|
gst_value_get_date() -> g_value_get_boxed()
|
||||||
|
|
||||||
|
* GError/GstGError
|
||||||
|
|
||||||
|
GstGError -> GError
|
||||||
|
GST_TYPE_G_ERROR / gst_g_error_get_type() -> G_TYPE_ERROR
|
||||||
|
|
|
@ -746,8 +746,6 @@ init_post (GOptionContext * context, GOptionGroup * group, gpointer data,
|
||||||
|
|
||||||
_priv_gst_plugin_initialize ();
|
_priv_gst_plugin_initialize ();
|
||||||
|
|
||||||
gst_g_error_get_type ();
|
|
||||||
|
|
||||||
/* register core plugins */
|
/* register core plugins */
|
||||||
gst_plugin_register_static (GST_VERSION_MAJOR, GST_VERSION_MINOR,
|
gst_plugin_register_static (GST_VERSION_MAJOR, GST_VERSION_MINOR,
|
||||||
"staticelements", "core elements linked into the GStreamer library",
|
"staticelements", "core elements linked into the GStreamer library",
|
||||||
|
|
|
@ -122,14 +122,6 @@ GQuark gst_ ## string ## _error_quark (void) { \
|
||||||
quark = g_quark_from_static_string ("gst-" # string "-error-quark"); \
|
quark = g_quark_from_static_string ("gst-" # string "-error-quark"); \
|
||||||
return quark; }
|
return quark; }
|
||||||
|
|
||||||
/* FIXME: Deprecate when we depend on GLib 2.26 */
|
|
||||||
/* FIXME 0.11: remove gst_g_error_get_type() */
|
|
||||||
GType
|
|
||||||
gst_g_error_get_type (void)
|
|
||||||
{
|
|
||||||
return g_error_get_type ();
|
|
||||||
}
|
|
||||||
|
|
||||||
#define FILE_A_BUG " Please file a bug at " PACKAGE_BUGREPORT "."
|
#define FILE_A_BUG " Please file a bug at " PACKAGE_BUGREPORT "."
|
||||||
|
|
||||||
static const gchar *
|
static const gchar *
|
||||||
|
|
|
@ -197,8 +197,6 @@ typedef enum
|
||||||
GST_STREAM_ERROR_NUM_ERRORS
|
GST_STREAM_ERROR_NUM_ERRORS
|
||||||
} GstStreamError;
|
} GstStreamError;
|
||||||
|
|
||||||
#define GST_TYPE_G_ERROR (gst_g_error_get_type ())
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GST_LIBRARY_ERROR:
|
* GST_LIBRARY_ERROR:
|
||||||
*
|
*
|
||||||
|
@ -240,11 +238,6 @@ typedef enum
|
||||||
*/
|
*/
|
||||||
#define GST_ERROR_SYSTEM ("system error: %s", g_strerror (errno))
|
#define GST_ERROR_SYSTEM ("system error: %s", g_strerror (errno))
|
||||||
|
|
||||||
/* Hide this compatibility type from introspection */
|
|
||||||
#ifndef __GI_SCANNER__
|
|
||||||
GType gst_g_error_get_type (void);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
gchar *gst_error_get_message (GQuark domain, gint code);
|
gchar *gst_error_get_message (GQuark domain, gint code);
|
||||||
GQuark gst_stream_error_quark (void);
|
GQuark gst_stream_error_quark (void);
|
||||||
GQuark gst_core_error_quark (void);
|
GQuark gst_core_error_quark (void);
|
||||||
|
|
|
@ -386,7 +386,7 @@ gst_message_new_error (GstObject * src, GError * error, const gchar * debug)
|
||||||
GstStructure *structure;
|
GstStructure *structure;
|
||||||
|
|
||||||
structure = gst_structure_new_id (GST_QUARK (MESSAGE_ERROR),
|
structure = gst_structure_new_id (GST_QUARK (MESSAGE_ERROR),
|
||||||
GST_QUARK (GERROR), GST_TYPE_G_ERROR, error,
|
GST_QUARK (GERROR), G_TYPE_ERROR, error,
|
||||||
GST_QUARK (DEBUG), G_TYPE_STRING, debug, NULL);
|
GST_QUARK (DEBUG), G_TYPE_STRING, debug, NULL);
|
||||||
message = gst_message_new_custom (GST_MESSAGE_ERROR, src, structure);
|
message = gst_message_new_custom (GST_MESSAGE_ERROR, src, structure);
|
||||||
|
|
||||||
|
@ -413,7 +413,7 @@ gst_message_new_warning (GstObject * src, GError * error, const gchar * debug)
|
||||||
GstStructure *structure;
|
GstStructure *structure;
|
||||||
|
|
||||||
structure = gst_structure_new_id (GST_QUARK (MESSAGE_WARNING),
|
structure = gst_structure_new_id (GST_QUARK (MESSAGE_WARNING),
|
||||||
GST_QUARK (GERROR), GST_TYPE_G_ERROR, error,
|
GST_QUARK (GERROR), G_TYPE_ERROR, error,
|
||||||
GST_QUARK (DEBUG), G_TYPE_STRING, debug, NULL);
|
GST_QUARK (DEBUG), G_TYPE_STRING, debug, NULL);
|
||||||
message = gst_message_new_custom (GST_MESSAGE_WARNING, src, structure);
|
message = gst_message_new_custom (GST_MESSAGE_WARNING, src, structure);
|
||||||
|
|
||||||
|
@ -442,7 +442,7 @@ gst_message_new_info (GstObject * src, GError * error, const gchar * debug)
|
||||||
GstStructure *structure;
|
GstStructure *structure;
|
||||||
|
|
||||||
structure = gst_structure_new_id (GST_QUARK (MESSAGE_INFO),
|
structure = gst_structure_new_id (GST_QUARK (MESSAGE_INFO),
|
||||||
GST_QUARK (GERROR), GST_TYPE_G_ERROR, error,
|
GST_QUARK (GERROR), G_TYPE_ERROR, error,
|
||||||
GST_QUARK (DEBUG), G_TYPE_STRING, debug, NULL);
|
GST_QUARK (DEBUG), G_TYPE_STRING, debug, NULL);
|
||||||
message = gst_message_new_custom (GST_MESSAGE_INFO, src, structure);
|
message = gst_message_new_custom (GST_MESSAGE_INFO, src, structure);
|
||||||
|
|
||||||
|
@ -1335,7 +1335,7 @@ gst_message_parse_error (GstMessage * message, GError ** gerror, gchar ** debug)
|
||||||
structure = GST_MESSAGE_STRUCTURE (message);
|
structure = GST_MESSAGE_STRUCTURE (message);
|
||||||
error_gvalue = gst_structure_id_get_value (structure, GST_QUARK (GERROR));
|
error_gvalue = gst_structure_id_get_value (structure, GST_QUARK (GERROR));
|
||||||
g_return_if_fail (error_gvalue != NULL);
|
g_return_if_fail (error_gvalue != NULL);
|
||||||
g_return_if_fail (G_VALUE_TYPE (error_gvalue) == GST_TYPE_G_ERROR);
|
g_return_if_fail (G_VALUE_TYPE (error_gvalue) == G_TYPE_ERROR);
|
||||||
|
|
||||||
error_val = (GError *) g_value_get_boxed (error_gvalue);
|
error_val = (GError *) g_value_get_boxed (error_gvalue);
|
||||||
if (error_val)
|
if (error_val)
|
||||||
|
@ -1375,7 +1375,7 @@ gst_message_parse_warning (GstMessage * message, GError ** gerror,
|
||||||
structure = GST_MESSAGE_STRUCTURE (message);
|
structure = GST_MESSAGE_STRUCTURE (message);
|
||||||
error_gvalue = gst_structure_id_get_value (structure, GST_QUARK (GERROR));
|
error_gvalue = gst_structure_id_get_value (structure, GST_QUARK (GERROR));
|
||||||
g_return_if_fail (error_gvalue != NULL);
|
g_return_if_fail (error_gvalue != NULL);
|
||||||
g_return_if_fail (G_VALUE_TYPE (error_gvalue) == GST_TYPE_G_ERROR);
|
g_return_if_fail (G_VALUE_TYPE (error_gvalue) == G_TYPE_ERROR);
|
||||||
|
|
||||||
error_val = (GError *) g_value_get_boxed (error_gvalue);
|
error_val = (GError *) g_value_get_boxed (error_gvalue);
|
||||||
if (error_val)
|
if (error_val)
|
||||||
|
@ -1416,7 +1416,7 @@ gst_message_parse_info (GstMessage * message, GError ** gerror, gchar ** debug)
|
||||||
structure = GST_MESSAGE_STRUCTURE (message);
|
structure = GST_MESSAGE_STRUCTURE (message);
|
||||||
error_gvalue = gst_structure_id_get_value (structure, GST_QUARK (GERROR));
|
error_gvalue = gst_structure_id_get_value (structure, GST_QUARK (GERROR));
|
||||||
g_return_if_fail (error_gvalue != NULL);
|
g_return_if_fail (error_gvalue != NULL);
|
||||||
g_return_if_fail (G_VALUE_TYPE (error_gvalue) == GST_TYPE_G_ERROR);
|
g_return_if_fail (G_VALUE_TYPE (error_gvalue) == G_TYPE_ERROR);
|
||||||
|
|
||||||
error_val = (GError *) g_value_get_boxed (error_gvalue);
|
error_val = (GError *) g_value_get_boxed (error_gvalue);
|
||||||
if (error_val)
|
if (error_val)
|
||||||
|
|
|
@ -317,7 +317,7 @@ GST_START_TEST (test_structure_new)
|
||||||
|
|
||||||
domain = g_quark_from_static_string ("test");
|
domain = g_quark_from_static_string ("test");
|
||||||
e = g_error_new (domain, 0, "a test error");
|
e = g_error_new (domain, 0, "a test error");
|
||||||
s = gst_structure_new ("name", "key", GST_TYPE_G_ERROR, e, NULL);
|
s = gst_structure_new ("name", "key", G_TYPE_ERROR, e, NULL);
|
||||||
g_error_free (e);
|
g_error_free (e);
|
||||||
gst_structure_free (s);
|
gst_structure_free (s);
|
||||||
|
|
||||||
|
|
|
@ -451,7 +451,6 @@ EXPORTS
|
||||||
gst_formats_contains
|
gst_formats_contains
|
||||||
gst_fraction_get_type
|
gst_fraction_get_type
|
||||||
gst_fraction_range_get_type
|
gst_fraction_range_get_type
|
||||||
gst_g_error_get_type
|
|
||||||
gst_ghost_pad_activate_mode_default
|
gst_ghost_pad_activate_mode_default
|
||||||
gst_ghost_pad_construct
|
gst_ghost_pad_construct
|
||||||
gst_ghost_pad_get_target
|
gst_ghost_pad_get_target
|
||||||
|
|
Loading…
Reference in a new issue