#include "avformat.h"
#include "url.h"
Go to the source code of this file.
Data Structures | |
struct | RTMPPacket |
structure for holding RTMP packets More... | |
Defines | |
#define | RTMP_CHANNELS 65599 |
maximum possible number of different RTMP channels | |
Enumerations | |
enum | RTMPChannel { RTMP_NETWORK_CHANNEL = 2, RTMP_SYSTEM_CHANNEL, RTMP_SOURCE_CHANNEL, RTMP_VIDEO_CHANNEL = 8, RTMP_AUDIO_CHANNEL } |
channels used to for RTMP packets with different purposes (i.e. More... | |
enum | RTMPPacketType { RTMP_PT_CHUNK_SIZE = 1, RTMP_PT_BYTES_READ = 3, RTMP_PT_PING, RTMP_PT_SERVER_BW, RTMP_PT_CLIENT_BW, RTMP_PT_AUDIO = 8, RTMP_PT_VIDEO, RTMP_PT_FLEX_STREAM = 15, RTMP_PT_FLEX_OBJECT, RTMP_PT_FLEX_MESSAGE, RTMP_PT_NOTIFY, RTMP_PT_SHARED_OBJ, RTMP_PT_INVOKE, RTMP_PT_METADATA = 22 } |
known RTMP packet types More... | |
enum | RTMPPacketSize { RTMP_PS_TWELVEBYTES = 0, RTMP_PS_EIGHTBYTES, RTMP_PS_FOURBYTES, RTMP_PS_ONEBYTE } |
possible RTMP packet header sizes More... | |
Functions | |
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_rtmp_packet_read (URLContext *h, RTMPPacket *p, int chunk_size, RTMPPacket *prev_pkt) |
Read RTMP packet sent by the server. | |
int | ff_rtmp_packet_write (URLContext *h, RTMPPacket *p, int chunk_size, RTMPPacket *prev_pkt) |
Send RTMP packet to the server. | |
void | ff_rtmp_packet_dump (void *ctx, RTMPPacket *p) |
Print information and contents of RTMP packet. | |
Functions used to work with the AMF format (which is also used in .flv) | |
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. | |
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. | |
void | ff_amf_write_bool (uint8_t **dst, int val) |
Write boolean value in AMF format to buffer. | |
void | ff_amf_write_number (uint8_t **dst, double num) |
Write number in AMF format to buffer. | |
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. | |
void | ff_amf_write_object_start (uint8_t **dst) |
Write marker for 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. | |
void | ff_amf_write_object_end (uint8_t **dst) |
Write marker for end of AMF object to buffer. |
#define RTMP_CHANNELS 65599 |
enum RTMPChannel |
channels used to for RTMP packets with different purposes (i.e.
data, network control, remote procedure calls, etc.)
enum RTMPPacketSize |
enum RTMPPacketType |
known RTMP packet types
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.
data | AMF object data | |
data_end | input buffer end | |
name | name of field to retrieve | |
dst | buffer for storing result | |
dst_size | output buffer size |
Definition at line 296 of file rtmppkt.c.
Referenced by rtmp_parse_result().
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.
data | input data | |
data_end | input buffer end |
Definition at line 260 of file rtmppkt.c.
Referenced by ff_amf_get_field_value(), ff_amf_tag_contents(), ff_amf_tag_size(), ff_rtmp_packet_dump(), and rtmp_parse_result().
void ff_amf_write_bool | ( | uint8_t ** | dst, | |
int | val | |||
) |
Write boolean value in AMF format to buffer.
dst | pointer to the input buffer (will be modified) | |
val | value to write |
Definition at line 31 of file rtmppkt.c.
Referenced by gen_connect().
void ff_amf_write_field_name | ( | uint8_t ** | dst, | |
const char * | str | |||
) |
Write string used as field name in AMF object to buffer.
dst | pointer to the input buffer (will be modified) | |
str | string to write |
Definition at line 60 of file rtmppkt.c.
Referenced by gen_connect().
void ff_amf_write_null | ( | uint8_t ** | dst | ) |
Write AMF NULL value to buffer.
dst | pointer to the input buffer (will be modified) |
Definition at line 50 of file rtmppkt.c.
Referenced by gen_create_stream(), gen_delete_stream(), gen_fcpublish_stream(), gen_fcunpublish_stream(), gen_play(), gen_publish(), and gen_release_stream().
void ff_amf_write_number | ( | uint8_t ** | dst, | |
double | num | |||
) |
Write number in AMF format to buffer.
dst | pointer to the input buffer (will be modified) | |
num | value to write |
Definition at line 37 of file rtmppkt.c.
Referenced by gen_connect(), gen_create_stream(), gen_delete_stream(), gen_fcpublish_stream(), gen_fcunpublish_stream(), gen_play(), gen_publish(), and gen_release_stream().
void ff_amf_write_object_end | ( | uint8_t ** | dst | ) |
Write marker for end of AMF object to buffer.
dst | pointer to the input buffer (will be modified) |
Definition at line 66 of file rtmppkt.c.
Referenced by gen_connect().
void ff_amf_write_object_start | ( | uint8_t ** | dst | ) |
Write marker for AMF object to buffer.
dst | pointer to the input buffer (will be modified) |
Definition at line 55 of file rtmppkt.c.
Referenced by gen_connect().
void ff_amf_write_string | ( | uint8_t ** | dst, | |
const char * | str | |||
) |
Write string in AMF format to buffer.
dst | pointer to the input buffer (will be modified) | |
str | string to write |
Definition at line 43 of file rtmppkt.c.
Referenced by gen_connect(), gen_create_stream(), gen_delete_stream(), gen_fcpublish_stream(), gen_fcunpublish_stream(), gen_play(), gen_publish(), gen_release_stream(), and rtmp_write().
int ff_rtmp_packet_create | ( | RTMPPacket * | pkt, | |
int | channel_id, | |||
RTMPPacketType | type, | |||
int | timestamp, | |||
int | size | |||
) |
Create new RTMP packet with given attributes.
pkt | packet | |
channel_id | packet channel ID | |
type | packet type | |
timestamp | packet timestamp | |
size | packet size |
Definition at line 234 of file rtmppkt.c.
Referenced by ff_rtmp_packet_read(), gen_bytes_read(), gen_connect(), gen_create_stream(), gen_delete_stream(), gen_fcpublish_stream(), gen_fcunpublish_stream(), gen_play(), gen_pong(), gen_publish(), gen_release_stream(), and rtmp_write().
void ff_rtmp_packet_destroy | ( | RTMPPacket * | pkt | ) |
Free RTMP packet.
pkt | packet |
Definition at line 252 of file rtmppkt.c.
Referenced by ff_rtmp_packet_read(), gen_bytes_read(), gen_connect(), gen_create_stream(), gen_delete_stream(), gen_fcpublish_stream(), gen_fcunpublish_stream(), gen_play(), gen_pong(), gen_publish(), gen_release_stream(), get_packet(), rtmp_close(), and rtmp_write().
void ff_rtmp_packet_dump | ( | void * | ctx, | |
RTMPPacket * | p | |||
) |
Print information and contents of RTMP packet.
ctx | output context | |
p | packet to dump |
Definition at line 426 of file rtmppkt.c.
Referenced by rtmp_parse_result().
int ff_rtmp_packet_read | ( | URLContext * | h, | |
RTMPPacket * | p, | |||
int | chunk_size, | |||
RTMPPacket * | prev_pkt | |||
) |
Read RTMP packet sent by the server.
h | reader context | |
p | packet | |
chunk_size | current chunk size | |
prev_pkt | previously read packet headers for all channels (may be needed for restoring incomplete packet header) |
Definition at line 74 of file rtmppkt.c.
Referenced by get_packet().
int ff_rtmp_packet_write | ( | URLContext * | h, | |
RTMPPacket * | p, | |||
int | chunk_size, | |||
RTMPPacket * | prev_pkt | |||
) |
Send RTMP packet to the server.
h | reader context | |
p | packet to send | |
chunk_size | current chunk size | |
prev_pkt | previously sent packet headers for all channels (may be used for packet header compressing) |
Definition at line 161 of file rtmppkt.c.
Referenced by gen_bytes_read(), gen_connect(), gen_create_stream(), gen_delete_stream(), gen_fcpublish_stream(), gen_fcunpublish_stream(), gen_play(), gen_pong(), gen_publish(), gen_release_stream(), rtmp_parse_result(), and rtmp_write().