31 #define RTP_HEVC_PAYLOAD_HEADER_SIZE 2
32 #define RTP_HEVC_FU_HEADER_SIZE 1
33 #define RTP_HEVC_DONL_FIELD_SIZE 2
34 #define RTP_HEVC_DOND_FIELD_SIZE 1
35 #define RTP_HEVC_AP_NALU_LENGTH_FIELD_SIZE 2
36 #define HEVC_SPECIFIED_NAL_UNIT_TYPES 48
51 const char *attr,
const char *
value)
55 if (!strcmp(attr,
"profile-id")) {
72 if (!strcmp(attr,
"sprop-vps") || !strcmp(attr,
"sprop-sps") ||
73 !strcmp(attr,
"sprop-pps") || !strcmp(attr,
"sprop-sei")) {
76 if (!strcmp(attr,
"sprop-vps")) {
77 data_ptr = &hevc_data->
vps;
79 }
else if (!strcmp(attr,
"sprop-sps")) {
80 data_ptr = &hevc_data->
sps;
82 }
else if (!strcmp(attr,
"sprop-pps")) {
83 data_ptr = &hevc_data->
pps;
85 }
else if (!strcmp(attr,
"sprop-sei")) {
86 data_ptr = &hevc_data->
sei;
105 if (!strcmp(attr,
"sprop-max-don-diff")) {
113 if (!strcmp(attr,
"sprop-depack-buf-nalus")) {
116 av_log(s,
AV_LOG_TRACE,
"Found sprop-depack-buf-nalus in SDP, DON field usage is: %d\n",
135 const char *sdp_line_ptr = line;
140 current_stream = ctx->
streams[st_index];
143 if (
av_strstart(sdp_line_ptr,
"framesize:", &sdp_line_ptr)) {
145 }
else if (
av_strstart(sdp_line_ptr,
"fmtp:", &sdp_line_ptr)) {
146 int ret =
ff_parse_fmtp(ctx, current_stream, hevc_data, sdp_line_ptr,
192 int tid, lid, nal_type;
193 int first_fragment, last_fragment, fu_type;
217 nal_type = (buf[0] >> 1) & 0x3f;
218 lid = ((buf[0] << 5) & 0x20) | ((buf[1] >> 3) & 0x1f);
297 first_fragment = buf[0] & 0x80;
298 last_fragment = buf[0] & 0x40;
299 fu_type = buf[0] & 0x3f;
317 "Too short RTP/HEVC packet, got %d bytes of NAL unit type %d\n",
325 if (first_fragment && last_fragment) {
330 new_nal_header[0] = (rtp_pl[0] & 0x81) | (fu_type << 1);
331 new_nal_header[1] = rtp_pl[1];
334 new_nal_header,
sizeof(new_nal_header));
#define RTP_HEVC_DOND_FIELD_SIZE
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
static const uint8_t start_sequence[]
RTP/JPEG specific private data.
int index
stream index in AVFormatContext
const RTPDynamicProtocolHandler ff_hevc_dynamic_handler
static av_cold int hevc_parse_sdp_line(AVFormatContext *ctx, int st_index, PayloadContext *hevc_data, const char *line)
This struct describes the properties of an encoded stream.
static av_cold int hevc_sdp_parse_fmtp_config(AVFormatContext *s, AVStream *stream, PayloadContext *hevc_data, const char *attr, const char *value)
#define av_assert0(cond)
assert() equivalent, that is always enabled.
#define AV_LOG_TRACE
Extremely verbose debugging, useful for libav* development.
AVStream ** streams
A list of all streams in the file.
bitstream reader API header.
int av_new_packet(AVPacket *pkt, int size)
Allocate the payload of a packet and initialize its fields with default values.
#define RTP_HEVC_FU_HEADER_SIZE
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
simple assert() macros that are a bit more flexible than ISO C assert().
int extradata_size
Size of the extradata content in bytes.
GLsizei GLboolean const GLfloat * value
static int hevc_handle_packet(AVFormatContext *ctx, PayloadContext *rtp_hevc_ctx, AVStream *st, AVPacket *pkt, uint32_t *timestamp, const uint8_t *buf, int len, uint16_t seq, int flags)
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
#define RTP_HEVC_PAYLOAD_HEADER_SIZE
int ff_parse_fmtp(AVFormatContext *s, AVStream *stream, PayloadContext *data, const char *p, int(*parse_fmtp)(AVFormatContext *s, AVStream *stream, PayloadContext *data, const char *attr, const char *value))
void avpriv_report_missing_feature(void *avc, const char *msg,...) av_printf_format(2
Log a generic warning message about a missing feature.
#define flags(name, subs,...)
int av_strstart(const char *str, const char *pfx, const char **ptr)
Return non-zero if pfx is a prefix of str.
#define AV_INPUT_BUFFER_PADDING_SIZE
Required number of additionally allocated bytes at the end of the input bitstream for decoding...
uint8_t * extradata
Extra binary data needed for initializing the decoder, codec-dependent.
#define RTP_HEVC_DONL_FIELD_SIZE
AVCodecParameters * codecpar
Codec parameters associated with this stream.
This structure stores compressed data.