Go to the documentation of this file.
   41 #define MLV_VERSION "v2.0" 
   43 #define MLV_VIDEO_CLASS_RAW  1 
   44 #define MLV_VIDEO_CLASS_YUV  2 
   45 #define MLV_VIDEO_CLASS_JPEG 3 
   46 #define MLV_VIDEO_CLASS_H264 4 
   48 #define MLV_AUDIO_CLASS_WAV  1 
   50 #define MLV_CLASS_FLAG_LJ92  0x20 
   51 #define MLV_CLASS_FLAG_DELTA 0x40 
   52 #define MLV_CLASS_FLAG_LZMA  0x80 
   61     int color_matrix1[9][2];
 
  147             unsigned bits_per_coded_sample;
 
  155             if (bits_per_coded_sample > (INT_MAX - 7) / (
width * 
height)) {
 
  157                        "invalid bits_per_coded_sample %u (size: %ux%u)\n",
 
  170             for (
int i = 0; 
i < 9; 
i++) {
 
  178         } 
else if (ast && 
type == 
MKTAG(
'W', 
'A', 
'V', 
'I') && 
size >= 16) {
 
  183         } 
else if (
type == 
MKTAG(
'I',
'N',
'F',
'O')) {
 
  189             read_uint32(avctx, pb, 
"cameraModel", 
"0x%"PRIx32);
 
  199             read_uint8(avctx, pb, 
"stabilizerMode", 
"%i");
 
  209         } 
else if (vst && 
type == 
MKTAG(
'V', 
'I', 
'D', 
'F') && 
size >= 4) {
 
  215         } 
else if (ast && 
type == 
MKTAG(
'A', 
'U', 
'D', 
'F') && 
size >= 4) {
 
  218                                &asti->index_entries_allocated_size,
 
  221         } 
else if (vst && 
type == 
MKTAG(
'W',
'B',
'A',
'L') && 
size >= 28) {
 
  232             struct tm time = { 0 };
 
  243             if (strftime(str, 
sizeof(str), 
"%Y-%m-%d %H:%M:%S", &time))
 
  268         } 
else if (
type == 
MKTAG(
'D',
'A',
'R',
'K')) {
 
  269         } 
else if (
type == 
MKTAG(
'D',
'I',
'S',
'O')) {
 
  270         } 
else if (
type == 
MKTAG(
'M',
'A',
'R',
'K')) {
 
  271         } 
else if (
type == 
MKTAG(
'N',
'U',
'L',
'L')) {
 
  272         } 
else if (
type == 
MKTAG(
'M',
'L',
'V',
'I')) { 
 
  273         } 
else if (
type == 
MKTAG(
'R',
'A',
'W',
'C')) {
 
  290     unsigned nb_video_frames, nb_audio_frames;
 
  302     snprintf(guidstr, 
sizeof(guidstr), 
"0x%"PRIx64, guid);
 
  313     if (nb_video_frames && mlv->
class[0]) {
 
  349     if (nb_audio_frames && mlv->
class[1]) {
 
  355         ast->nb_frames = nb_audio_frames;
 
  376     mlv->
pb[100] = avctx->
pb;
 
  382     if (strlen(avctx->
url) > 2) {
 
  389         for (
i = 0; 
i < 100; 
i++) {
 
  390             snprintf(filename + strlen(filename) - 2, 3, 
"%02d", 
i);
 
  412         ast->duration = asti->nb_index_entries;
 
  431     bytestream2_put_le16(pb, 
tag);
 
  433     bytestream2_put_le32(pb, 1);
 
  434     bytestream2_put_le16(pb, 
value);
 
  435     bytestream2_put_le16(pb, 0);
 
  440     bytestream2_put_le16(pb, 
tag);
 
  442     bytestream2_put_le32(pb, 2);
 
  443     bytestream2_put_le16(pb, v1);
 
  444     bytestream2_put_le16(pb, v2);
 
  449     bytestream2_put_le16(pb, 
tag);
 
  451     bytestream2_put_le32(pb, 1);
 
  452     bytestream2_put_le32(pb, 
value);
 
  457     bytestream2_put_le16(pb, 
tag);
 
  459     bytestream2_put_le32(pb, 4);
 
  460     bytestream2_put_byte(pb, v1);
 
  461     bytestream2_put_byte(pb, v2);
 
  462     bytestream2_put_byte(pb, v3);
 
  463     bytestream2_put_byte(pb, v4);
 
  470     int ret, header_size;
 
  471     uint8_t *stripofs, *matrixofs;
 
  473 #define MAX_HEADER_SIZE 2048 
  482     bytestream2_put_le16(pb, 0x4949);
 
  483     bytestream2_put_le16(pb, 42);
 
  484     bytestream2_put_le32(pb, 8);
 
  486     bytestream2_put_le16(pb, 18); 
 
  496     stripofs = pb->
buffer - 4;
 
  510     bytestream2_put_le32(pb, 9);
 
  511     bytestream2_put_le32(pb, 0); 
 
  512     matrixofs = pb->
buffer - 4;
 
  513     bytestream2_put_le32(pb, 0);
 
  516     for (
int i = 0; 
i < 9; 
i++) {
 
  523     AV_WL32(stripofs, header_size);
 
  616     mlv->
pts = timestamp;
 
  624     for (
i = 0; 
i < 100; 
i++)
 
  
#define AV_LOG_WARNING
Something somehow does not look correct.
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
#define MLV_VIDEO_CLASS_RAW
enum AVMediaType codec_type
General type of the encoded data.
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated space
#define MLV_AUDIO_CLASS_WAV
AVStream * avformat_new_stream(AVFormatContext *s, const struct AVCodec *c)
Add a new stream to a media file.
#define AVERROR_EOF
End of file.
static void read_uint64(AVFormatContext *avctx, AVIOContext *pb, const char *tag, const char *fmt)
AVStream ** streams
A list of all streams in the file.
static void read_string(AVFormatContext *avctx, AVIOContext *pb, const char *tag, unsigned size)
const FFInputFormat ff_mlv_demuxer
static void read_uint32(AVFormatContext *avctx, AVIOContext *pb, const char *tag, const char *fmt)
static void write_tiff_short(PutByteContext *pb, int tag, int value)
uint32_t codec_tag
Additional information about the codec (corresponds to the AVI FOURCC).
static int scan_file(AVFormatContext *avctx, AVStream *vst, AVStream *ast, int file)
unsigned int index_entries_allocated_size
int64_t pos
position in the file of the current buffer
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
int64_t duration
Decoding: duration of the stream, in stream time base.
static int read_header(AVFormatContext *avctx)
unsigned int avio_rl16(AVIOContext *s)
#define AV_DICT_DONT_STRDUP_VAL
Take ownership of a value that's been allocated with av_malloc() or another memory allocation functio...
static void write_tiff_long(PutByteContext *pb, int tag, int value)
static int read_seek(AVFormatContext *avctx, int stream_index, int64_t timestamp, int flags)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
AVDictionary * metadata
Metadata that applies to the whole file.
static void read_uint16(AVFormatContext *avctx, AVIOContext *pb, const char *tag, const char *fmt)
static av_always_inline void bytestream2_init_writer(PutByteContext *p, uint8_t *buf, int buf_size)
static void read_uint8(AVFormatContext *avctx, AVIOContext *pb, const char *tag, const char *fmt)
int av_new_packet(AVPacket *pkt, int size)
Allocate the payload of a packet and initialize its fields with default values.
@ AV_PIX_FMT_BAYER_RGGB16LE
bayer, RGRG..(odd line), GBGB..(even line), 16-bit samples, little-endian
static av_always_inline int bytestream2_tell_p(const PutByteContext *p)
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
#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...
AVCodecParameters * codecpar
Codec parameters associated with this stream.
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
static int read_close(AVFormatContext *s)
#define MLV_VIDEO_CLASS_JPEG
Rational number (pair of numerator and denominator).
AVIOContext * pb
I/O context.
static int read_packet(AVFormatContext *avctx, AVPacket *pkt)
This structure contains the data a format has to probe a file.
int64_t nb_frames
number of frames in this stream if known or 0
static void write_tiff_short2(PutByteContext *pb, int tag, int v1, int v2)
unsigned int nb_streams
Number of elements in AVFormatContext.streams.
unsigned int avio_rl32(AVIOContext *s)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
int seekable
A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable.
#define av_err2str(errnum)
Convenience macro, the return value should be used only directly in function arguments but never stan...
char * url
input or output URL.
int avio_r8(AVIOContext *s)
#define MLV_VIDEO_CLASS_YUV
#define AV_LOG_INFO
Standard information.
#define FFERROR_REDO
Returned by demuxers to indicate that data was consumed but discarded (ignored streams or junk data).
static int check_file_header(AVIOContext *pb, uint64_t guid)
#define i(width, name, range_min, range_max)
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default value
int ff_get_wav_header(AVFormatContext *s, AVIOContext *pb, AVCodecParameters *par, int size, int big_endian)
int ff_add_index_entry(AVIndexEntry **index_entries, int *nb_index_entries, unsigned int *index_entries_allocated_size, int64_t pos, int64_t timestamp, int size, int distance, int flags)
Internal version of av_add_index_entry.
static int get_packet_lj92(AVFormatContext *avctx, AVStream *st, AVIOContext *pbio, AVPacket *pkt, int64_t size)
#define MLV_VIDEO_CLASS_H264
int id
Format-specific stream ID.
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_RL32
#define AVIO_SEEKABLE_NORMAL
Seeking works like for a local file.
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
int(* io_open)(struct AVFormatContext *s, AVIOContext **pb, const char *url, int flags, AVDictionary **options)
A callback for opening new IO streams.
#define MLV_CLASS_FLAG_DELTA
IDirect3DDxgiInterfaceAccess _COM_Outptr_ void ** p
int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
AVIndexEntry * index_entries
Only used if the format does not support seeking natively.
int av_dict_set_int(AVDictionary **pm, const char *key, int64_t value, int flags)
Convenience wrapper for av_dict_set() that converts the value to a string and stores it.
#define AVIO_FLAG_READ
read-only
char * av_strdup(const char *s)
Duplicate a string.
static int read_probe(const AVProbeData *p)
int bits_per_coded_sample
The number of bits per sample in the codedwords.
#define avpriv_request_sample(...)
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
This structure stores compressed data.
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
uint64_t avio_rl64(AVIOContext *s)
#define MLV_CLASS_FLAG_LJ92
#define MLV_CLASS_FLAG_LZMA
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define MKTAG(a, b, c, d)
static int probe(const AVProbeData *p)
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...
void * priv_data
Format private data.
static void write_tiff_byte4(PutByteContext *pb, int tag, int v1, int v2, int v3, int v4)
#define av_fourcc2str(fourcc)
int av_index_search_timestamp(AVStream *st, int64_t timestamp, int flags)
Get the index for a specific timestamp.
int avio_feof(AVIOContext *s)
Similar to feof() but also returns nonzero on read errors.