<commit_before>#ifndef __rtmp_h
#define __rtmp_h

#include <gst/gst.h>

#define DEFAULT_CHUNK_SIZE 128      /* 5.4.1 */
#define DEFAULT_WINDOW_SIZE 128000

#define HANDSHAKE_PLAINTEXT	0x03

#define RANDOM_LEN		(1536 - 8)

#define MSG_SET_CHUNK       0x01
#define MSG_ACK             0x03
#define MSG_USER_CONTROL    0x04
#define MSG_WINDOW_ACK_SIZE 0x05
#define MSG_SET_PEER_BW     0x06
#define MSG_AUDIO           0x08
#define MSG_VIDEO           0x09
#define MSG_DATA            0x0F    /* AMF0 */
#define MSG_INVOKE3         0x11    /* AMF3 */
#define MSG_NOTIFY          0x12
#define MSG_OBJECT          0x13
#define MSG_INVOKE          0x14    /* AMF0 */
#define MSG_FLASH_VIDEO     0x16
#define MSG_DATA3           0x18    /* AMF3 */

#define CONTROL_CLEAR_STREAM    0x00
#define CONTROL_CLEAR_BUFFER    0x01
#define CONTROL_STREAM_DRY      0x02
#define CONTROL_BUFFER_TIME     0x03
#define CONTROL_RESET_STREAM    0x04
#define CONTROL_PING            0x06
#define CONTROL_REQUEST_VERIFY  0x1a
#define CONTROL_RESPOND_VERIFY  0x1b
#define CONTROL_BUFFER_EMPTY    0x1f
#define CONTROL_BUFFER_READY    0x20

#define MSG_STREAM_ID_CONTROL    0

#define CHUNK_STREAM_ID_CONTROL  2
#define CHUNK_STREAM_ID_RESULT   3
#define CHUNK_STREAM_ID_STREAM   4

#define FLV_KEY_FRAME		0x01
#define FLV_INTER_FRAME		0x02

#define SUPPORT_SND_AAC   0x0400
#define SUPPORT_SND_SPEEX 0x0800
#define SUPPORT_VID_H264  0x0080

#define PACKED	__attribute__((packed))

struct _Handshake
{
  guint8 flags[8];
  guint8 random[RANDOM_LEN];
} PACKED;

/* Chunk Message Header sizes based on "fmt" sizes, see 5.3.1.2 in spec */
static const size_t CHUNK_MSG_HEADER_LENGTH[] = { 12, 8, 4, 1 };

/* This is the Chunk Message Header FIXME: rename? */
struct _RTMP_Header
{
  guint8 flags;
  gchar timestamp[3];
  gchar msg_len[3];
  guint8 msg_type;
  gchar msg_stream_id[4];   /* Note, this is little-endian while others are BE */
} PACKED;

typedef struct _Handshake Handshake;
typedef struct _RTMP_Header RTMP_Header;

#endif
<commit_msg>rtmpserver: more small cleanups<commit_after>#ifndef __rtmp_h
#define __rtmp_h

#include <gst/gst.h>

#define DEFAULT_CHUNK_SIZE 128      /* 5.4.1 */
#define DEFAULT_WINDOW_SIZE 128000

#define HANDSHAKE_PLAINTEXT 0x03
#define HANDSHAKE_CRYPTO    0x06

#define RANDOM_LEN    (1536 - 8)

#define MSG_SET_CHUNK       0x01
#define MSG_ACK             0x03
#define MSG_USER_CONTROL    0x04
#define MSG_WINDOW_ACK_SIZE 0x05
#define MSG_SET_PEER_BW     0x06
#define MSG_AUDIO           0x08
#define MSG_VIDEO           0x09
#define MSG_DATA            0x0F    /* AMF0 */
#define MSG_INVOKE3         0x11    /* AMF3 */
#define MSG_NOTIFY          0x12
#define MSG_OBJECT          0x13
#define MSG_INVOKE          0x14    /* AMF0 */
#define MSG_FLASH_VIDEO     0x16
#define MSG_DATA3           0x18    /* AMF3 */

#define CONTROL_CLEAR_STREAM    0x00
#define CONTROL_CLEAR_BUFFER    0x01
#define CONTROL_STREAM_DRY      0x02
#define CONTROL_BUFFER_TIME     0x03
#define CONTROL_RESET_STREAM    0x04
#define CONTROL_PING            0x06
#define CONTROL_REQUEST_VERIFY  0x1a
#define CONTROL_RESPOND_VERIFY  0x1b
#define CONTROL_BUFFER_EMPTY    0x1f
#define CONTROL_BUFFER_READY    0x20

#define MSG_STREAM_ID_CONTROL    0

#define CHUNK_STREAM_ID_CONTROL  2
#define CHUNK_STREAM_ID_RESULT   3
#define CHUNK_STREAM_ID_STREAM   4

#define FLV_KEY_FRAME		0x01
#define FLV_INTER_FRAME		0x02

#define SUPPORT_SND_AAC   0x0400
#define SUPPORT_SND_SPEEX 0x0800
#define SUPPORT_VID_H264  0x0080

#define PACKED	__attribute__((packed))

struct _Handshake
{
  guint8 flags[8];
  guint8 random[RANDOM_LEN];
} PACKED;

/* Chunk Message Header sizes based on "fmt" sizes, see 5.3.1.2 in spec */
static const size_t CHUNK_MSG_HEADER_LENGTH[] = { 12, 8, 4, 1 };

/* This is the Chunk Message Header FIXME: rename? */
struct _RTMP_Header
{
  guint8 flags;
  guint8 timestamp[3];
  guint8 msg_len[3];
  guint8 msg_type;
  guint8 msg_stream_id[4]; /* Note, this is little-endian while others are BE */
} PACKED;

typedef struct _Handshake Handshake;
typedef struct _RTMP_Header RTMP_Header;

#endif

{'fraction_non_alphanumeric': 0.06604696673189824, 'fraction_numerical': 0.06947162426614481, 'mean_word_length': 3.5433333333333334, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7494427', 'n_tokens_mistral': 1757, 'n_tokens_neox': 1627, 'n_words': 388}