Go to the documentation of this file.
39 if (
s->buf_ptr !=
s->buf) {
42 if (
s->buffered_nals == 1) {
43 enum AVCodecID codec =
s1->streams[0]->codecpar->codec_id;
58 enum AVCodecID codec =
s1->streams[0]->codecpar->codec_id;
61 if (size <= s->max_payload_size) {
62 int buffered_size =
s->buf_ptr -
s->buf;
64 int skip_aggregate = 0;
74 if (buffered_size + 2 +
size >
s->max_payload_size) {
82 if (buffered_size + 2 + header_size + size <= s->max_payload_size &&
84 if (buffered_size == 0) {
88 *
s->buf_ptr++ = 48 << 1;
102 int flag_byte, header_size;
106 "NAL size %d > %d, try -slice-max-size %d\n",
size,
107 s->max_payload_size,
s->max_payload_size);
155 s->buf[2] = nal_type;
167 while (
size + header_size >
s->max_payload_size) {
168 memcpy(&
s->buf[header_size],
buf,
s->max_payload_size - header_size);
170 buf +=
s->max_payload_size - header_size;
171 size -=
s->max_payload_size - header_size;
172 s->buf[flag_byte] &= ~(1 << 7);
174 s->buf[flag_byte] |= 1 << 6;
175 memcpy(&
s->buf[header_size],
buf,
size);
185 s->timestamp =
s->cur_timestamp;
187 if (
s->nal_length_size)
194 if (
s->nal_length_size) {
198 r +=
s->nal_length_size;
void ff_rtp_send_h264_hevc(AVFormatContext *s1, const uint8_t *buf1, int size)
static av_cold int end(AVCodecContext *avctx)
void ff_rtp_send_data(AVFormatContext *s1, const uint8_t *buf1, int len, int m)
#define FF_RTP_FLAG_H264_MODE0
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
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
AVCodecID
Identify the syntax and semantics of the bitstream.
static void nal_send(AVFormatContext *s1, const uint8_t *buf, int size, int last)
static void flush_buffered(AVFormatContext *s1, int last)
const uint8_t * ff_avc_mp4_find_startcode(const uint8_t *start, const uint8_t *end, int nal_length_size)
const uint8_t * ff_avc_find_startcode(const uint8_t *p, const uint8_t *end)