00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef AVFORMAT_RTPENC_H
00022 #define AVFORMAT_RTPENC_H
00023
00024 #include "avformat.h"
00025 #include "rtp.h"
00026
00027 struct RTPMuxContext {
00028 const AVClass *av_class;
00029 AVFormatContext *ic;
00030 AVStream *st;
00031 int payload_type;
00032 uint32_t ssrc;
00033 uint16_t seq;
00034 uint32_t timestamp;
00035 uint32_t base_timestamp;
00036 uint32_t cur_timestamp;
00037 int max_payload_size;
00038 int num_frames;
00039
00040
00041 int64_t last_rtcp_ntp_time;
00042 int64_t first_rtcp_ntp_time;
00043
00044
00045 unsigned int packet_count;
00046 unsigned int octet_count;
00047 unsigned int last_octet_count;
00048 int first_packet;
00049
00050 uint8_t *buf;
00051 uint8_t *buf_ptr;
00052
00053 int max_frames_per_packet;
00054
00059 int nal_length_size;
00060
00061 int flags;
00062 };
00063
00064 typedef struct RTPMuxContext RTPMuxContext;
00065
00066 #define FF_RTP_FLAG_MP4A_LATM 1
00067
00068 #define FF_RTP_FLAG_OPTS(ctx, fieldname) \
00069 { "rtpflags", "RTP muxer flags", offsetof(ctx, fieldname), AV_OPT_TYPE_FLAGS, {.dbl = 0}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "rtpflags" }, \
00070 { "latm", "Use MP4A-LATM packetization instead of MPEG4-GENERIC for AAC", 0, AV_OPT_TYPE_CONST, {.dbl = FF_RTP_FLAG_MP4A_LATM}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "rtpflags" } \
00071
00072 void ff_rtp_send_data(AVFormatContext *s1, const uint8_t *buf1, int len, int m);
00073
00074 void ff_rtp_send_h264(AVFormatContext *s1, const uint8_t *buf1, int size);
00075 void ff_rtp_send_h263(AVFormatContext *s1, const uint8_t *buf1, int size);
00076 void ff_rtp_send_aac(AVFormatContext *s1, const uint8_t *buff, int size);
00077 void ff_rtp_send_latm(AVFormatContext *s1, const uint8_t *buff, int size);
00078 void ff_rtp_send_amr(AVFormatContext *s1, const uint8_t *buff, int size);
00079 void ff_rtp_send_mpegvideo(AVFormatContext *s1, const uint8_t *buf1, int size);
00080 void ff_rtp_send_xiph(AVFormatContext *s1, const uint8_t *buff, int size);
00081 void ff_rtp_send_vp8(AVFormatContext *s1, const uint8_t *buff, int size);
00082
00083 #endif