mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-25 09:40:37 +00:00
event/message: Don't allow setting invalid group ids
They are optional on STREAM_START messages/events but if available should have at least a valid value. For STREAM_GROUP_DONE events don't allow creating it with an invalid group id as this does not make any sense.
This commit is contained in:
parent
48f14c5e5e
commit
1b2f968efc
2 changed files with 4 additions and 0 deletions
|
@ -690,6 +690,8 @@ gst_event_new_stream_group_done (guint group_id)
|
||||||
{
|
{
|
||||||
GstStructure *s;
|
GstStructure *s;
|
||||||
|
|
||||||
|
g_return_val_if_fail (group_id != GST_GROUP_ID_INVALID, NULL);
|
||||||
|
|
||||||
s = gst_structure_new_id (GST_QUARK (EVENT_STREAM_GROUP_DONE),
|
s = gst_structure_new_id (GST_QUARK (EVENT_STREAM_GROUP_DONE),
|
||||||
GST_QUARK (GROUP_ID), G_TYPE_UINT, group_id, NULL);
|
GST_QUARK (GROUP_ID), G_TYPE_UINT, group_id, NULL);
|
||||||
|
|
||||||
|
@ -1810,6 +1812,7 @@ gst_event_set_group_id (GstEvent * event, guint group_id)
|
||||||
g_return_if_fail (event != NULL);
|
g_return_if_fail (event != NULL);
|
||||||
g_return_if_fail (GST_EVENT_TYPE (event) == GST_EVENT_STREAM_START);
|
g_return_if_fail (GST_EVENT_TYPE (event) == GST_EVENT_STREAM_START);
|
||||||
g_return_if_fail (gst_event_is_writable (event));
|
g_return_if_fail (gst_event_is_writable (event));
|
||||||
|
g_return_if_fail (group_id != GST_GROUP_ID_INVALID);
|
||||||
|
|
||||||
gst_structure_id_set (GST_EVENT_STRUCTURE (event),
|
gst_structure_id_set (GST_EVENT_STRUCTURE (event),
|
||||||
GST_QUARK (GROUP_ID), G_TYPE_UINT, group_id, NULL);
|
GST_QUARK (GROUP_ID), G_TYPE_UINT, group_id, NULL);
|
||||||
|
|
|
@ -2436,6 +2436,7 @@ gst_message_set_group_id (GstMessage * message, guint group_id)
|
||||||
g_return_if_fail (GST_IS_MESSAGE (message));
|
g_return_if_fail (GST_IS_MESSAGE (message));
|
||||||
g_return_if_fail (GST_MESSAGE_TYPE (message) == GST_MESSAGE_STREAM_START);
|
g_return_if_fail (GST_MESSAGE_TYPE (message) == GST_MESSAGE_STREAM_START);
|
||||||
g_return_if_fail (gst_message_is_writable (message));
|
g_return_if_fail (gst_message_is_writable (message));
|
||||||
|
g_return_if_fail (group_id != GST_GROUP_ID_INVALID);
|
||||||
|
|
||||||
structure = GST_MESSAGE_STRUCTURE (message);
|
structure = GST_MESSAGE_STRUCTURE (message);
|
||||||
gst_structure_id_set (structure, GST_QUARK (GROUP_ID), G_TYPE_UINT, group_id,
|
gst_structure_id_set (structure, GST_QUARK (GROUP_ID), G_TYPE_UINT, group_id,
|
||||||
|
|
Loading…
Reference in a new issue