mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
rtcpbuffer: provide a WRITE map with maximum available size
... which allows adding additional packets and may be needed to counteract the shrink that implicitly occurred during a map/unmap cycle when adding a previous packet.
This commit is contained in:
parent
6be16ad773
commit
06557739ab
1 changed files with 7 additions and 0 deletions
|
@ -260,6 +260,13 @@ gst_rtcp_buffer_map (GstBuffer * buffer, GstMapFlags flags,
|
||||||
rtcp->flags = flags;
|
rtcp->flags = flags;
|
||||||
rtcp->data = gst_buffer_map (buffer, &rtcp->size, &rtcp->maxsize, flags);
|
rtcp->data = gst_buffer_map (buffer, &rtcp->size, &rtcp->maxsize, flags);
|
||||||
|
|
||||||
|
/* allow for expansion, e.g. adding packets, if needed */
|
||||||
|
if ((flags & GST_MAP_WRITE) != 0) {
|
||||||
|
/* unmap and adjust to max available, and remap */
|
||||||
|
gst_buffer_unmap (buffer, rtcp->data, rtcp->maxsize);
|
||||||
|
rtcp->data = gst_buffer_map (buffer, &rtcp->size, &rtcp->maxsize, flags);
|
||||||
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue