streamcollection: Use upstream-id as name

It is more coherent, in the same vein as  08dc5d29

Fixes #2640

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4911>
This commit is contained in:
Edward Hervey 2023-06-21 13:44:40 +02:00 committed by Edward Hervey
parent 92c13ea3b5
commit 8081c22a73
3 changed files with 12 additions and 2 deletions

View file

@ -1,7 +1,7 @@
event stream-start: GstEventStreamStart, flags=(GstStreamFlags)GST_STREAM_FLAG_NONE, group-id=(uint)1, stream=(GstStream)"\(GstStream\)\ ecf1ea12b198caea123f05f4fcb08daa35ee5045577d2be98f3424c0ce90757a/video-0";
event caps: video/x-raw, colorimetry=(string)2:4:0:0, format=(string)I420, framerate=(fraction)0/1, height=(int)446, interlace-mode=(string)progressive, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, width=(int)928;
event segment: format=TIME, start=0:00:00.000000000, offset=0:00:00.000000000, stop=none, time=0:00:00.000000000, base=0:00:00.000000000, position=0:00:00.000000000
event stream-collection: stream-collection, collection=(GstStreamCollection)"\(GstStreamCollection\)\ streamcollection0";
event stream-collection: stream-collection, collection=(GstStreamCollection)"\(GstStreamCollection\)\ adaptivedemux";
buffer: content-id=0, pts=0:00:00.014000000, flags=discont, meta=GstVideoMeta
event flush-start: (no structure)
event flush-stop: GstEventFlushStop, reset-time=(boolean)true;

View file

@ -1,5 +1,5 @@
event stream-start: GstEventStreamStart, flags=(GstStreamFlags)GST_STREAM_FLAG_NONE, group-id=(uint)1, stream=(GstStream)"\(GstStream\)\ videotestsrc_stream_0";
event caps: video/x-raw, format=(string)ABGR64_LE, framerate=(fraction)30/1, height=(int)1080, interlace-mode=(string)progressive, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, width=(int)1920;
event stream-collection: stream-collection, collection=(GstStreamCollection)"\(GstStreamCollection\)\ streamcollection0";
event stream-collection: stream-collection, collection=(GstStreamCollection)"\(GstStreamCollection\)\ unparented";
event segment: format=TIME, start=0:00:00.000000000, offset=0:00:00.000000000, stop=none, time=0:00:00.000000000, base=0:00:00.000000000, position=0:00:00.000000000
event eos: (no structure)

View file

@ -189,6 +189,7 @@ gst_stream_collection_set_upstream_id (GstStreamCollection * collection,
{
g_return_if_fail (collection->upstream_id == NULL);
GST_OBJECT_LOCK (collection);
/* Upstream ID should only be set once on construction, but let's
* not leak in case someone does something silly */
if (collection->upstream_id)
@ -196,6 +197,15 @@ gst_stream_collection_set_upstream_id (GstStreamCollection * collection,
if (upstream_id)
collection->upstream_id = g_strdup (upstream_id);
/* We hold the object lock, replace directly */
g_free (GST_OBJECT_NAME (collection));
if (upstream_id)
GST_OBJECT_NAME (collection) = g_strdup (upstream_id);
else
GST_OBJECT_NAME (collection) = g_strdup ("unparented");
GST_OBJECT_UNLOCK (collection);
}
/**