27 #define RTP_VP9_DESC_REQUIRED_SIZE 1
38 "RTP/VP9 support is still experimental\n");
48 int has_pic_id, has_layer_idc, has_ref_idc, has_ss_data;
49 av_unused int pic_id = 0, non_key_frame = 0, inter_picture_layer_frame;
50 av_unused int layer_temporal = -1, layer_spatial = -1, layer_quality = -1;
51 int ref_fields = 0, has_ref_field_ext_pic_id = 0;
52 int first_fragment, last_fragment;
57 if (rtp_vp9_ctx->
buf && rtp_vp9_ctx->
timestamp != *timestamp)
82 has_pic_id = !!(buf[0] & 0x80);
83 inter_picture_layer_frame = !!(buf[0] & 0x40);
84 has_layer_idc = !!(buf[0] & 0x20);
85 has_ref_idc = !!(buf[0] & 0x10);
86 first_fragment = !!(buf[0] & 0x08);
87 last_fragment = !!(buf[0] & 0x04);
88 has_ss_data = !!(buf[0] & 0x02);
93 if (last_fragment != rtp_m) {
94 av_log(ctx,
AV_LOG_ERROR,
"Invalid combination of B and M marker (%d != %d)\n", last_fragment, rtp_m);
122 pic_id =
AV_RB16(buf) & 0x7fff;
126 pic_id = buf[0] & 0x7f;
149 layer_temporal = buf[0] & 0xC0;
150 layer_spatial = buf[0] & 0x30;
151 layer_quality = buf[0] & 0x0C;
153 ref_fields = buf[0] & 0x03;
182 has_ref_field_ext_pic_id = buf[0] & 0x10;
185 if (has_ref_field_ext_pic_id) {
231 y = !!(buf[0] & 0x10);
232 g = !!(buf[0] & 0x08);
240 if (len < 4 * (n_s + 1)) {
244 for (i = 0; i < n_s + 1; i++) {
261 for (i = 0; i < n_g; i++) {
268 u = !!(buf[0] & 0x10);
269 r = (buf[0] >> 2) & 0x03;
276 for (j = 0; j <
r; j++) {
299 if (!rtp_vp9_ctx->
buf) {
301 if (first_fragment) {
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
ptrdiff_t const GLvoid * data
#define AV_LOG_WARNING
Something somehow does not look correct.
static av_cold int init(AVCodecContext *avctx)
RTP/JPEG specific private data.
int index
stream index in AVFormatContext
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_WB64 unsigned int_TMPL AV_WB32 unsigned int_TMPL AV_WB24 unsigned int_TMPL AV_RB16
int avio_open_dyn_buf(AVIOContext **s)
Open a write only memory stream.
void avio_write(AVIOContext *s, const unsigned char *buf, int size)
uint32_t timestamp
current frame timestamp
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define RTP_FLAG_MARKER
RTP marker bit was set for this packet.
static void vp9_close_context(PayloadContext *vp9)
RTPDynamicProtocolHandler ff_vp9_dynamic_handler
static int vp9_handle_packet(AVFormatContext *ctx, PayloadContext *rtp_vp9_ctx, AVStream *st, AVPacket *pkt, uint32_t *timestamp, const uint8_t *buf, int len, uint16_t seq, int flags)
void ffio_free_dyn_buf(AVIOContext **s)
Free a dynamic buffer.
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
static av_cold int vp9_init(AVFormatContext *ctx, int st_index, PayloadContext *data)
uint8_t * buf
the temporary storage buffer
void avpriv_report_missing_feature(void *avc, const char *msg,...) av_printf_format(2
Log a generic warning message about a missing feature.
#define RTP_VP9_DESC_REQUIRED_SIZE
int ff_rtp_finalize_packet(AVPacket *pkt, AVIOContext **dyn_buf, int stream_idx)
Close the dynamic buffer and make a packet from it.
This structure stores compressed data.