message: fix annotation of parse_device_{added,removed}

gst_structure_id_get() returns a new reference so the returned device is
actually (transfer full).

The code using this API was already correct but the code example in
comments was not.

https://bugzilla.gnome.org/show_bug.cgi?id=768776
This commit is contained in:
Guillaume Desmottes 2016-07-13 15:43:21 +02:00 committed by Tim-Philipp Müller
parent 2a0bba69e1
commit 514beb7d60
2 changed files with 4 additions and 2 deletions

View file

@ -49,12 +49,14 @@
* name = gst_device_get_display_name (device); * name = gst_device_get_display_name (device);
* g_print("Device added: %s\n", name); * g_print("Device added: %s\n", name);
* g_free (name); * g_free (name);
* gst_object_unref (device);
* break; * break;
* case GST_MESSAGE_DEVICE_REMOVED: * case GST_MESSAGE_DEVICE_REMOVED:
* gst_message_parse_device_removed (message, &device); * gst_message_parse_device_removed (message, &device);
* name = gst_device_get_display_name (device); * name = gst_device_get_display_name (device);
* g_print("Device removed: %s\n", name); * g_print("Device removed: %s\n", name);
* g_free (name); * g_free (name);
* gst_object_unref (device);
* break; * break;
* default: * default:
* break; * break;

View file

@ -2383,7 +2383,7 @@ gst_message_new_device_added (GstObject * src, GstDevice * device)
/** /**
* gst_message_parse_device_added: * gst_message_parse_device_added:
* @message: a #GstMessage of type %GST_MESSAGE_DEVICE_ADDED * @message: a #GstMessage of type %GST_MESSAGE_DEVICE_ADDED
* @device: (out) (allow-none) (transfer none): A location where to store a * @device: (out) (allow-none) (transfer full): A location where to store a
* pointer to the new #GstDevice, or %NULL * pointer to the new #GstDevice, or %NULL
* *
* Parses a device-added message. The device-added message is produced by * Parses a device-added message. The device-added message is produced by
@ -2435,7 +2435,7 @@ gst_message_new_device_removed (GstObject * src, GstDevice * device)
/** /**
* gst_message_parse_device_removed: * gst_message_parse_device_removed:
* @message: a #GstMessage of type %GST_MESSAGE_DEVICE_REMOVED * @message: a #GstMessage of type %GST_MESSAGE_DEVICE_REMOVED
* @device: (out) (allow-none) (transfer none): A location where to store a * @device: (out) (allow-none) (transfer full): A location where to store a
* pointer to the removed #GstDevice, or %NULL * pointer to the removed #GstDevice, or %NULL
* *
* Parses a device-removed message. The device-removed message is produced by * Parses a device-removed message. The device-removed message is produced by