22 #ifndef AVFORMAT_RTMPPKT_H
23 #define AVFORMAT_RTMPPKT_H
30 #define RTMP_CHANNELS 65599
100 int timestamp,
int size);
286 int strsize,
int *length);
301 int strsize,
int *length);
static double val(void *priv, double ch)
channel
Use these values when setting the channel map with ebur128_set_channel().
int ff_rtmp_packet_write(URLContext *h, RTMPPacket *p, int chunk_size, RTMPPacket **prev_pkt, int *nb_prev_pkt)
Send RTMP packet to the server.
void ff_amf_write_string(uint8_t **dst, const char *str)
Write string in AMF format to buffer.
void ff_amf_write_null(uint8_t **dst)
Write AMF NULL value to buffer.
int ff_rtmp_packet_read(URLContext *h, RTMPPacket *p, int chunk_size, RTMPPacket **prev_pkt, int *nb_prev_pkt)
Read RTMP packet sent by the server.
int ff_amf_read_number(GetByteContext *gbc, double *val)
Read AMF number value.
void ff_amf_write_object_start(uint8_t **dst)
Write marker for AMF object to buffer.
int ff_amf_read_null(GetByteContext *gbc)
Read AMF NULL value.
RTMPPacketSize
possible RTMP packet header sizes
@ RTMP_PS_TWELVEBYTES
packet has 12-byte header
@ RTMP_PS_EIGHTBYTES
packet has 8-byte header
@ RTMP_PS_FOURBYTES
packet has 4-byte header
@ RTMP_PS_ONEBYTE
packet is really a next chunk of a packet
void ff_amf_write_string2(uint8_t **dst, const char *str1, const char *str2)
Write a string consisting of two parts in AMF format to a buffer.
int ff_amf_get_string(GetByteContext *bc, uint8_t *str, int strsize, int *length)
Get AMF string value.
int ff_rtmp_check_alloc_array(RTMPPacket **prev_pkt, int *nb_prev_pkt, int channel)
Enlarge the prev_pkt array to fit the given channel.
RTMPChannel
channels used to for RTMP packets with different purposes (i.e.
@ RTMP_AUDIO_CHANNEL
channel for audio data
@ RTMP_NETWORK_CHANNEL
channel for network-related messages (bandwidth report, ping, etc)
@ RTMP_VIDEO_CHANNEL
channel for video data
@ RTMP_SYSTEM_CHANNEL
channel for sending server control messages
@ RTMP_SOURCE_CHANNEL
channel for a/v invokes
int ff_amf_tag_size(const uint8_t *data, const uint8_t *data_end)
Calculate number of bytes taken by first AMF entry in data.
void ff_amf_write_bool(uint8_t **dst, int val)
Write boolean value in AMF format to buffer.
int ff_amf_get_field_value(const uint8_t *data, const uint8_t *data_end, const uint8_t *name, uint8_t *dst, int dst_size)
Retrieve value of given AMF object field in string form.
int ff_amf_read_string(GetByteContext *gbc, uint8_t *str, int strsize, int *length)
Read AMF string value.
int ff_rtmp_packet_create(RTMPPacket *pkt, int channel_id, RTMPPacketType type, int timestamp, int size)
Create new RTMP packet with given attributes.
void ff_rtmp_packet_destroy(RTMPPacket *pkt)
Free RTMP packet.
int ff_amf_match_string(const uint8_t *data, int size, const char *str)
Match AMF string with a NULL-terminated string.
void ff_amf_write_number(uint8_t **dst, double num)
Write number in AMF format to buffer.
int ff_rtmp_packet_read_internal(URLContext *h, RTMPPacket *p, int chunk_size, RTMPPacket **prev_pkt, int *nb_prev_pkt, uint8_t c)
Read internal RTMP packet sent by the server.
void ff_rtmp_packet_dump(void *ctx, RTMPPacket *p)
Print information and contents of RTMP packet.
void ff_amf_write_object_end(uint8_t **dst)
Write marker for end of AMF object to buffer.
void ff_amf_write_field_name(uint8_t **dst, const char *str)
Write string used as field name in AMF object to buffer.
RTMPPacketType
known RTMP packet types
@ RTMP_PT_FLEX_OBJECT
Flex shared object.
@ RTMP_PT_USER_CONTROL
user control
@ RTMP_PT_NOTIFY
some notification
@ RTMP_PT_SHARED_OBJ
shared object
@ RTMP_PT_CHUNK_SIZE
chunk size change
@ RTMP_PT_INVOKE
invoke some stream action
@ RTMP_PT_BYTES_READ
number of bytes read
@ RTMP_PT_SET_PEER_BW
peer bandwidth
@ RTMP_PT_WINDOW_ACK_SIZE
window acknowledgement size
@ RTMP_PT_VIDEO
video packet
@ RTMP_PT_FLEX_STREAM
Flex shared stream.
@ RTMP_PT_METADATA
FLV metadata.
@ RTMP_PT_AUDIO
audio packet
@ RTMP_PT_FLEX_MESSAGE
Flex shared message.
structure for holding RTMP packets
int size
packet payload size
uint32_t extra
probably an additional channel ID used during streaming data
RTMPPacketType type
packet payload type
uint32_t ts_field
24-bit timestamp or increment to the previous one, in milliseconds (latter only for media packets)....
uint32_t timestamp
packet full timestamp
uint8_t * data
packet payload
int channel_id
RTMP channel ID (nothing to do with audio/video channels though)
int read
amount read, including headers
int offset
amount of data read so far
unbuffered private I/O API