Merging gst-plugins-bad
[platform/upstream/gstreamer.git] / gst / rtmp2 / rtmp / rtmpchunkstream.h
1 /* GStreamer RTMP Library
2  * Copyright (C) 2017 Make.TV, Inc. <info@make.tv>
3  *   Contact: Jan Alexander Steffens (heftig) <jsteffens@make.tv>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Library General Public License for more details.
14  *
15  * You should have received a copy of the GNU Library General Public
16  * License along with this library; if not, write to the
17  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
18  * Boston, MA 02110-1301, USA.
19  */
20
21 #ifndef _GST_RTMP_CHUNK_STREAM_H_
22 #define _GST_RTMP_CHUNK_STREAM_H_
23
24 #include "rtmpmessage.h"
25
26 G_BEGIN_DECLS
27
28 #define GST_RTMP_CHUNK_STREAM_PROTOCOL 2
29
30 typedef struct _GstRtmpChunkStream GstRtmpChunkStream;
31 typedef struct _GstRtmpChunkStreams GstRtmpChunkStreams;
32
33 void gst_rtmp_chunk_stream_clear (GstRtmpChunkStream * cstream);
34
35 guint32 gst_rtmp_chunk_stream_parse_id (const guint8 * data, gsize size);
36 guint32 gst_rtmp_chunk_stream_parse_header (GstRtmpChunkStream * cstream,
37     const guint8 * data, gsize size);
38 guint32 gst_rtmp_chunk_stream_parse_payload (GstRtmpChunkStream * cstream,
39     guint32 chunk_size, guint8 ** data);
40 guint32 gst_rtmp_chunk_stream_wrote_payload (GstRtmpChunkStream * cstream,
41     guint32 chunk_size);
42 GstBuffer * gst_rtmp_chunk_stream_parse_finish (GstRtmpChunkStream * cstream);
43
44 GstBuffer * gst_rtmp_chunk_stream_serialize_start (GstRtmpChunkStream * cstream,
45     GstBuffer * buffer, guint32 chunk_size);
46 GstBuffer * gst_rtmp_chunk_stream_serialize_next (GstRtmpChunkStream * cstream,
47     guint32 chunk_size);
48 GstBuffer * gst_rtmp_chunk_stream_serialize_all (GstRtmpChunkStream * cstream,
49     GstBuffer * buffer, guint32 chunk_size);
50
51 GstRtmpChunkStreams * gst_rtmp_chunk_streams_new (void);
52 void gst_rtmp_chunk_streams_free (gpointer ptr);
53
54 GstRtmpChunkStream *
55 gst_rtmp_chunk_streams_get (GstRtmpChunkStreams * cstreams, guint32 id);
56
57
58 G_END_DECLS
59
60 #endif