Go to the documentation of this file.
40 if (
s->buf_ptr !=
s->buf) {
43 if (
s->buffered_nals == 1) {
62 if (size <= s->max_payload_size) {
63 int buffered_size =
s->buf_ptr -
s->buf;
65 int skip_aggregate = 0;
75 if (buffered_size + 2 +
size >
s->max_payload_size) {
83 if (buffered_size + 2 + header_size + size <= s->max_payload_size &&
85 if (buffered_size == 0) {
89 *
s->buf_ptr++ = 48 << 1;
95 memcpy(
s->buf_ptr, buf,
size);
103 int flag_byte, header_size;
107 "NAL size %d > %d, try -slice-max-size %d\n",
size,
108 s->max_payload_size,
s->max_payload_size);
113 uint8_t
type = buf[0] & 0x1F;
114 uint8_t nri = buf[0] & 0x60;
126 uint8_t nal_type = (buf[0] >> 1) & 0x3F;
156 s->buf[2] = nal_type;
168 while (
size + header_size >
s->max_payload_size) {
169 memcpy(&
s->buf[header_size], buf,
s->max_payload_size - header_size);
171 buf +=
s->max_payload_size - header_size;
172 size -=
s->max_payload_size - header_size;
173 s->buf[flag_byte] &= ~(1 << 7);
175 s->buf[flag_byte] |= 1 << 6;
176 memcpy(&
s->buf[header_size], buf,
size);
183 const uint8_t *
r, *end = buf1 +
size;
186 s->timestamp =
s->cur_timestamp;
188 if (
s->nal_length_size)
195 if (
s->nal_length_size) {
199 r +=
s->nal_length_size;
void ff_rtp_send_h264_hevc(AVFormatContext *s1, const uint8_t *buf1, int size)
AVStream ** streams
A list of all streams in the file.
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.
const uint8_t * ff_nal_mp4_find_startcode(const uint8_t *start, const uint8_t *end, int nal_length_size)
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
AVCodecParameters * codecpar
Codec parameters associated with this stream.
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)
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
const uint8_t * ff_nal_find_startcode(const uint8_t *p, const uint8_t *end)
void * priv_data
Format private data.