35#define RAW_PACKET_SIZE 1024
45#define DEC AV_OPT_FLAG_DECODING_PARAM
46#define OFFSET(x) offsetof(EVCDemuxContext, x)
54 .class_name =
"EVC Annex B demuxer",
64 int got_sps = 0, got_pps = 0, got_idr = 0, got_nonidr = 0;
65 const unsigned char *
bits = p->buf;
66 int bytes_to_read = p->buf_size;
71 if (nalu_size == 0)
break;
76 if(bytes_to_read < nalu_size)
break;
90 bytes_to_read -= nalu_size;
93 if (got_sps && got_pps && (got_idr || got_nonidr > 3))
149 int au_end_found = 0;
152 while(!au_end_found) {
169 if (!nalu_size || nalu_size > INT_MAX)
184 "evc_frame_merge filter\n");
191 "send output packet\n");
211 .p.extensions =
"evc",
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
int avio_feof(AVIOContext *s)
Similar to feof() but also returns nonzero on read errors.
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
int ffio_ensure_seekback(AVIOContext *s, int64_t buf_size)
Ensures that the requested seekback buffer size will be available.
int avcodec_parameters_copy(AVCodecParameters *dst, const AVCodecParameters *src)
#define FF_INFMT_FLAG_INIT_CLEANUP
For an FFInputFormat with this flag set read_close() needs to be called by the caller upon read_heade...
static uint32_t evc_read_nal_unit_length(const uint8_t *bits, int bits_size, void *logctx)
static int evc_read_packet(AVFormatContext *s, AVPacket *pkt)
static const AVOption evc_options[]
static const AVClass evc_demuxer_class
static int evc_read_close(AVFormatContext *s)
static int evc_read_header(AVFormatContext *s)
static int annexb_probe(const AVProbeData *p)
static const uint8_t bits[8]
@ AV_OPT_TYPE_VIDEO_RATE
Underlying C type is AVRational.
void av_bsf_free(AVBSFContext **pctx)
Free a bitstream filter context and everything associated with it; write NULL into the supplied point...
int av_bsf_init(AVBSFContext *ctx)
Prepare the filter for use, after all the parameters and options have been set.
int av_bsf_alloc(const AVBitStreamFilter *filter, AVBSFContext **pctx)
Allocate a context for a given bitstream filter.
int av_bsf_receive_packet(AVBSFContext *ctx, AVPacket *pkt)
Retrieve a filtered packet.
int av_bsf_send_packet(AVBSFContext *ctx, AVPacket *pkt)
Submit a packet for filtering.
const AVBitStreamFilter * av_bsf_get_by_name(const char *name)
AVStream * avformat_new_stream(AVFormatContext *s, const struct AVCodec *c)
Add a new stream to a media file.
#define AVERROR_BUG
Internal bug, also see AVERROR_BUG2.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define AVERROR_EOF
End of file.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
const char * av_default_item_name(void *ptr)
Return the context name.
#define LIBAVUTIL_VERSION_INT
#define EVC_NALU_LENGTH_PREFIX_SIZE
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
The bitstream filter state.
Describe the class of an AVClass context structure.
enum AVMediaType codec_type
General type of the encoded data.
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
This structure stores compressed data.
This structure contains the data a format has to probe a file.
Rational number (pair of numerator and denominator).
AVCodecParameters * codecpar
Codec parameters associated with this stream.
AVRational avg_frame_rate
Average framerate.
enum AVStreamParseType need_parsing
void(* filter)(uint8_t *src, ptrdiff_t stride, int qscale)