mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 04:01:08 +00:00
rtmp2: Add gst_rtmp_chunk_stream_serialize_all
Serializes an RTMP message into a series of chunks, all in one buffer. Similar to what gst_rtmp_connection_queue_message does to serialize into a GByteArray.
This commit is contained in:
parent
cb7f0c4be7
commit
b03780233e
2 changed files with 19 additions and 0 deletions
|
@ -666,6 +666,23 @@ gst_rtmp_chunk_stream_serialize_next (GstRtmpChunkStream * cstream,
|
|||
return serialize_next (cstream, chunk_size, CHUNK_TYPE_3);
|
||||
}
|
||||
|
||||
GstBuffer *
|
||||
gst_rtmp_chunk_stream_serialize_all (GstRtmpChunkStream * cstream,
|
||||
GstBuffer * buffer, guint32 chunk_size)
|
||||
{
|
||||
GstBuffer *outbuf, *nextbuf;
|
||||
|
||||
outbuf = gst_rtmp_chunk_stream_serialize_start (cstream, buffer, chunk_size);
|
||||
nextbuf = gst_rtmp_chunk_stream_serialize_next (cstream, chunk_size);
|
||||
|
||||
while (nextbuf) {
|
||||
outbuf = gst_buffer_append (outbuf, nextbuf);
|
||||
nextbuf = gst_rtmp_chunk_stream_serialize_next (cstream, chunk_size);
|
||||
}
|
||||
|
||||
return outbuf;
|
||||
}
|
||||
|
||||
GstRtmpChunkStreams *
|
||||
gst_rtmp_chunk_streams_new (void)
|
||||
{
|
||||
|
|
|
@ -45,6 +45,8 @@ GstBuffer * gst_rtmp_chunk_stream_serialize_start (GstRtmpChunkStream * cstream,
|
|||
GstBuffer * buffer, guint32 chunk_size);
|
||||
GstBuffer * gst_rtmp_chunk_stream_serialize_next (GstRtmpChunkStream * cstream,
|
||||
guint32 chunk_size);
|
||||
GstBuffer * gst_rtmp_chunk_stream_serialize_all (GstRtmpChunkStream * cstream,
|
||||
GstBuffer * buffer, guint32 chunk_size);
|
||||
|
||||
GstRtmpChunkStreams * gst_rtmp_chunk_streams_new (void);
|
||||
void gst_rtmp_chunk_streams_free (gpointer ptr);
|
||||
|
|
Loading…
Reference in a new issue