Go to the documentation of this file.
22 #ifndef AVFORMAT_RTMPPKT_H
23 #define AVFORMAT_RTMPPKT_H
30 #define RTMP_CHANNELS 65599
100 int timestamp,
int size);
198 const uint8_t *
name, uint8_t *dst,
int dst_size);
286 int strsize,
int *length);
301 int strsize,
int *length);
@ RTMP_PT_METADATA
FLV metadata.
@ RTMP_PT_FLEX_MESSAGE
Flex shared message.
@ RTMP_PT_FLEX_OBJECT
Flex shared object.
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default minimum maximum flags name is the option name
@ RTMP_PT_SHARED_OBJ
shared object
@ RTMP_NETWORK_CHANNEL
channel for network-related messages (bandwidth report, ping, etc)
@ RTMP_PT_BYTES_READ
number of bytes read
RTMPPacketType type
packet payload type
void ff_amf_write_object_end(uint8_t **dst)
Write marker for end of AMF object to buffer.
void ff_amf_write_bool(uint8_t **dst, int val)
Write boolean value in AMF format to buffer.
@ RTMP_PT_NOTIFY
some notification
void ff_amf_write_null(uint8_t **dst)
Write AMF NULL value to buffer.
int ff_amf_get_string(GetByteContext *bc, uint8_t *str, int strsize, int *length)
Get AMF string value.
@ RTMP_PT_WINDOW_ACK_SIZE
window acknowledgement size
int ff_amf_read_string(GetByteContext *gbc, uint8_t *str, int strsize, int *length)
Read AMF string value.
uint32_t extra
probably an additional channel ID used during streaming data
@ RTMP_VIDEO_CHANNEL
channel for video data
void ff_amf_write_number(uint8_t **dst, double num)
Write number in AMF format to buffer.
int ff_amf_read_number(GetByteContext *gbc, double *val)
Read AMF number value.
static double val(void *priv, double ch)
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
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.
@ RTMP_SYSTEM_CHANNEL
channel for sending server control messages
int read
amount read, including headers
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_read_null(GetByteContext *gbc)
Read AMF NULL value.
void ff_amf_write_string(uint8_t **dst, const char *str)
Write string in AMF format to buffer.
structure for holding RTMP packets
RTMPPacketType
known RTMP packet types
void ff_amf_write_field_name(uint8_t **dst, const char *str)
Write string used as field name in AMF object 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.
@ RTMP_PT_USER_CONTROL
user control
int size
packet payload size
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
@ RTMP_PT_INVOKE
invoke some stream action
uint32_t ts_field
24-bit timestamp or increment to the previous one, in milliseconds (latter only for media packets)....
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_rtmp_packet_dump(void *ctx, RTMPPacket *p)
Print information and contents of RTMP packet.
RTMPPacketSize
possible RTMP packet header sizes
void ff_amf_write_object_start(uint8_t **dst)
Write marker for AMF object to buffer.
uint32_t timestamp
packet full timestamp
int ff_amf_match_string(const uint8_t *data, int size, const char *str)
Match AMF string with a NULL-terminated string.
@ RTMP_PT_SET_PEER_BW
peer bandwidth
int offset
amount of data read so far
int channel_id
RTMP channel ID (nothing to do with audio/video channels though)
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.
@ RTMP_PS_EIGHTBYTES
packet has 8-byte header
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.
uint8_t * data
packet payload
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.
RTMPChannel
channels used to for RTMP packets with different purposes (i.e.
@ RTMP_PS_ONEBYTE
packet is really a next chunk of a packet
@ RTMP_AUDIO_CHANNEL
channel for audio data
@ RTMP_PT_AUDIO
audio packet
@ RTMP_PS_TWELVEBYTES
packet has 12-byte header
@ RTMP_PT_VIDEO
video packet
@ RTMP_SOURCE_CHANNEL
channel for a/v invokes
void ff_rtmp_packet_destroy(RTMPPacket *pkt)
Free RTMP packet.
@ RTMP_PS_FOURBYTES
packet has 4-byte header
@ RTMP_PT_FLEX_STREAM
Flex shared stream.
int ff_rtmp_packet_create(RTMPPacket *pkt, int channel_id, RTMPPacketType type, int timestamp, int size)
Create new RTMP packet with given attributes.
@ RTMP_PT_CHUNK_SIZE
chunk size change