32 #define RTP_HEVC_PAYLOAD_HEADER_SIZE 2
33 #define RTP_HEVC_FU_HEADER_SIZE 1
34 #define RTP_HEVC_DONL_FIELD_SIZE 2
35 #define RTP_HEVC_DOND_FIELD_SIZE 1
36 #define RTP_HEVC_AP_NALU_LENGTH_FIELD_SIZE 2
37 #define HEVC_SPECIFIED_NAL_UNIT_TYPES 48
52 const char *attr,
const char *
value)
56 if (!strcmp(attr,
"profile-id")) {
73 if (!strcmp(attr,
"sprop-vps") || !strcmp(attr,
"sprop-sps") ||
74 !strcmp(attr,
"sprop-pps") || !strcmp(attr,
"sprop-sei")) {
77 if (!strcmp(attr,
"sprop-vps")) {
78 data_ptr = &hevc_data->
vps;
80 }
else if (!strcmp(attr,
"sprop-sps")) {
81 data_ptr = &hevc_data->
sps;
83 }
else if (!strcmp(attr,
"sprop-pps")) {
84 data_ptr = &hevc_data->
pps;
86 }
else if (!strcmp(attr,
"sprop-sei")) {
87 data_ptr = &hevc_data->
sei;
106 if (!strcmp(attr,
"sprop-max-don-diff")) {
114 if (!strcmp(attr,
"sprop-depack-buf-nalus")) {
117 av_log(s,
AV_LOG_TRACE,
"Found sprop-depack-buf-nalus in SDP, DON field usage is: %d\n",
136 const char *sdp_line_ptr = line;
141 current_stream = ctx->
streams[st_index];
142 codec = current_stream->
codec;
144 if (
av_strstart(sdp_line_ptr,
"framesize:", &sdp_line_ptr)) {
146 }
else if (
av_strstart(sdp_line_ptr,
"fmtp:", &sdp_line_ptr)) {
147 int ret =
ff_parse_fmtp(ctx, current_stream, hevc_data, sdp_line_ptr,
193 int tid, lid, nal_type;
194 int first_fragment, last_fragment, fu_type;
218 nal_type = (buf[0] >> 1) & 0x3f;
219 lid = ((buf[0] << 5) & 0x20) | ((buf[1] >> 3) & 0x1f);
298 first_fragment = buf[0] & 0x80;
299 last_fragment = buf[0] & 0x40;
300 fu_type = buf[0] & 0x3f;
318 "Too short RTP/HEVC packet, got %d bytes of NAL unit type %d\n",
326 if (first_fragment && last_fragment) {
331 new_nal_header[0] = (rtp_pl[0] & 0x81) | (fu_type << 1);
332 new_nal_header[1] = rtp_pl[1];
335 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
static av_cold int hevc_parse_sdp_line(AVFormatContext *ctx, int st_index, PayloadContext *hevc_data, const char *line)
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.
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
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().
AVCodecContext * codec
Codec context associated with this stream.
GLsizei GLboolean const GLfloat * value
RTPDynamicProtocolHandler ff_hevc_dynamic_handler
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
main external API structure.
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.
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...
#define RTP_HEVC_DONL_FIELD_SIZE
This structure stores compressed data.