56 if (!strncmp(
data->sampling,
"YCbCr-4:2:2", 11)) {
60 if (
data->depth == 8) {
64 }
else if (
data->depth == 10) {
71 }
else if (!strncmp(
data->sampling,
"YCbCr-4:2:0", 11)) {
75 if (
data->depth == 8) {
82 }
else if (!strncmp(
data->sampling,
"RGB", 3)) {
84 if (
data->depth == 8) {
92 }
else if (!strncmp(
data->sampling,
"BGR", 3)) {
94 if (
data->depth == 8) {
112 if (
data->interlaced)
117 if (
data->framerate.den > 0) {
129 if (!strncmp(attr,
"width", 5))
131 else if (!strncmp(attr,
"height", 6))
133 else if (
data->sampling ==
NULL && !strncmp(attr,
"sampling", 8))
135 else if (!strncmp(attr,
"depth", 5))
137 else if (!strncmp(attr,
"interlace", 9))
138 data->interlaced = 1;
139 else if (!strncmp(attr,
"exactframerate", 14)) {
142 }
else if (!strncmp(attr,
"TCS", 3)) {
143 if (!strncmp(
value,
"SDR", 3))
145 else if (!strncmp(
value,
"PQ", 2))
147 else if (!strncmp(
value,
"HLG", 3))
149 else if (!strncmp(
value,
"LINEAR", 6))
151 else if (!strncmp(
value,
"ST428-1", 7))
155 }
else if (!strncmp(attr,
"colorimetry", 11)) {
156 if (!strncmp(
value,
"BT601", 5)) {
159 }
else if (!strncmp(
value,
"BT709", 5)) {
162 }
else if (!strncmp(
value,
"BT2020", 6)) {
166 }
else if (!strncmp(attr,
"RANGE", 5)) {
167 if (!strncmp(
value,
"NARROW", 6))
169 else if (!strncmp(
value,
"FULL", 4))
221 pkt->stream_index = stream_index;
222 if (!
data->interlaced ||
data->field) {
237 const uint8_t * buf,
int len,
238 uint16_t seq,
int flags)
241 const uint8_t *headers = buf + 2;
242 const uint8_t *payload = buf + 2;
243 int payload_len =
len - 2;
244 int missed_last_packet = 0;
248 if (*timestamp !=
data->timestamp) {
249 if (
data->frame && (!
data->interlaced ||
data->field)) {
258 missed_last_packet = 1;
265 data->timestamp = *timestamp;
281 cont = payload[4] & 0x80;
290 if (payload_len < data->pgroup)
293 length = (headers[0] << 8) | headers[1];
294 field = (headers[2] & 0x80) >> 7;
295 line = ((headers[2] & 0x7f) << 8) | headers[3];
296 offset = ((headers[4] & 0x7f) << 8) | headers[5];
297 cont = headers[4] & 0x80;
301 if (!
data->pgroup || length %
data->pgroup)
304 if (length > payload_len)
305 length = payload_len;
307 if (
data->interlaced)
315 if (copy_offset + length >
data->frame_size || !
data->frame)
318 dest =
data->frame + copy_offset;
319 memcpy(dest, payload, length);
322 payload_len -= length;
327 }
else if (missed_last_packet) {
simple assert() macros that are a bit more flexible than ISO C assert().
#define av_assert0(cond)
assert() equivalent, that is always enabled.
#define flags(name, subs,...)
@ AV_FIELD_TT
Top coded_first, top displayed first.
static int parse_packet(AVFormatContext *s, AVPacket *pkt, int stream_index, int flush)
Parse a packet, add all split parts to parse_queue.
int av_packet_from_data(AVPacket *pkt, uint8_t *data, int size)
Initialize a reference-counted packet from av_malloc()ed data.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static double av_q2d(AVRational a)
Convert an AVRational to a double.
int av_image_check_size(unsigned int w, unsigned int h, int log_offset, void *log_ctx)
Check if the given dimension of an image is valid, meaning that all bytes of the image can be address...
int av_strstart(const char *str, const char *pfx, const char **ptr)
Return non-zero if pfx is a prefix of str.
enum AVPixelFormat pixfmt
#define MKTAG(a, b, c, d)
Memory handling functions.
int av_parse_video_rate(AVRational *rate, const char *arg)
Parse str and store the detected values in *rate.
int av_get_bits_per_pixel(const AVPixFmtDescriptor *pixdesc)
Return the number of bits per pixel used by the pixel format described by pixdesc.
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
@ AVCOL_RANGE_MPEG
Narrow or limited range content.
@ AVCOL_RANGE_JPEG
Full range content.
#define AV_PIX_FMT_YUV422P10
AVPixelFormat
Pixel format.
@ AV_PIX_FMT_RGB24
packed RGB 8:8:8, 24bpp, RGBRGB...
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
@ AV_PIX_FMT_UYVY422
packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
@ AV_PIX_FMT_BGR24
packed RGB 8:8:8, 24bpp, BGRBGR...
@ AVCOL_PRI_BT470BG
also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM
@ AVCOL_PRI_BT709
also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP 177 Annex B
@ AVCOL_PRI_BT2020
ITU-R BT2020.
@ AVCOL_TRC_SMPTE2084
SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems.
@ AVCOL_TRC_LINEAR
"Linear transfer characteristics"
@ AVCOL_TRC_ARIB_STD_B67
ARIB STD-B67, known as "Hybrid log-gamma".
@ AVCOL_TRC_BT709
also ITU-R BT1361
@ AVCOL_SPC_BT709
also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / derived in SMPTE RP 177 Annex B
@ AVCOL_SPC_BT470BG
also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601
@ AVCOL_SPC_BT2020_NCL
ITU-R BT2020 non-constant luminance system.
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))
#define RTP_FLAG_MARKER
RTP marker bit was set for this packet.
static int rfc4175_parse_fmtp(AVFormatContext *s, AVStream *stream, PayloadContext *data, const char *attr, const char *value)
static int rfc4175_finalize_packet(PayloadContext *data, AVPacket *pkt, int stream_index)
static int rfc4175_parse_sdp_line(AVFormatContext *s, int st_index, PayloadContext *data_arg, const char *line)
static int rfc4175_handle_packet(AVFormatContext *ctx, PayloadContext *data, AVStream *st, AVPacket *pkt, uint32_t *timestamp, const uint8_t *buf, int len, uint16_t seq, int flags)
static int rfc4175_parse_format(AVStream *stream, PayloadContext *data)
enum AVColorSpace color_space
enum AVFieldOrder field_order
The order of the fields in interlaced video.
int height
The height of the video frame in pixels.
int bits_per_coded_sample
The number of bits per sample in the codedwords.
int width
The width of the video frame in pixels.
int64_t bit_rate
The average bitrate of the encoded data (in bits per second).
uint32_t codec_tag
Additional information about the codec (corresponds to the AVI FOURCC).
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
enum AVColorPrimaries color_primaries
enum AVColorTransferCharacteristic color_trc
enum AVColorRange color_range
Additional colorspace characteristics.
This structure stores compressed data.
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
Rational number (pair of numerator and denominator).
AVCodecParameters * codecpar
Codec parameters associated with this stream.
int index
stream index in AVFormatContext
AVRational avg_frame_rate
Average framerate.
RTP/AV1 specific private data.
AVIOContext * frame
current frame buffer
uint32_t timestamp
last received timestamp for frame
static AVFormatContext * ctx