29 #define LXF_MAX_PACKET_HEADER_SIZE 256 30 #define LXF_HEADER_DATA_SIZE 120 31 #define LXF_IDENT "LEITCH\0" 32 #define LXF_IDENT_LENGTH 8 33 #define LXF_SAMPLERATE 48000 74 for (x = 0; x <
size; x += 4)
116 int track_size, samples, ret;
123 if ((ret =
lxf_sync(s, header)) < 0)
126 ret =
avio_read(pb, header + LXF_IDENT_LENGTH, 8);
130 version = bytestream_get_le32(&p);
131 header_size = bytestream_get_le32(&p);
135 if (header_size < (version ? 72 : 60) ||
143 if ((ret =
avio_read(pb, header + (p - header),
144 header_size - (p - header))) !=
145 header_size - (p - header))
152 p += version ? 20 : 12;
159 ret = bytestream_get_le32(&p);
173 audio_format = bytestream_get_le32(&p);
174 channels = bytestream_get_le32(&p);
175 track_size = bytestream_get_le32(&p);
208 "video doesn't seem to be PAL or NTSC. guessing PAL\n");
213 if (av_popcount(channels) * (uint64_t)track_size > INT_MAX)
216 ret = av_popcount(channels) * track_size;
220 tmp = bytestream_get_le32(&p);
221 ret = bytestream_get_le32(&p);
237 uint32_t video_params, disk_params;
238 uint16_t record_date, expiration_date;
256 video_params =
AV_RL32(&header_data[40]);
257 record_date =
AV_RL16(&header_data[56]);
258 expiration_date =
AV_RL16(&header_data[58]);
259 disk_params =
AV_RL32(&header_data[116]);
268 record_date, 1900 + (record_date & 0x7F), (record_date >> 7) & 0xF,
269 (record_date >> 11) & 0x1F);
272 expiration_date, 1900 + (expiration_date & 0x7F), (expiration_date >> 7) & 0xF,
273 (expiration_date >> 11) & 0x1F);
275 if ((video_params >> 22) & 1)
278 if ((lxf->
channels = 1 << (disk_params >> 4 & 3) + 1)) {
308 "got packet with illegal stream index %"PRIu32
"\n", stream);
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
int frame_number
current video frame
#define AV_LOG_WARNING
Something somehow does not look correct.
static int lxf_sync(AVFormatContext *s, uint8_t *header)
Read input until we find the next ident.
#define avpriv_request_sample(...)
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
static int check_checksum(const uint8_t *header, int size)
Verify the checksum of an LXF packet header.
int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
AVInputFormat ff_lxf_demuxer
int channels
number of audio channels. zero means no audio
enum AVStreamParseType need_parsing
static int lxf_read_header(AVFormatContext *s)
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
AVStream ** streams
A list of all streams in the file.
#define AVERROR_EOF
End of file.
static const uint8_t header[24]
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
int64_t bit_rate
The average bitrate of the encoded data (in bits per second).
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
int av_new_packet(AVPacket *pkt, int size)
Allocate the payload of a packet and initialize its fields with default values.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
enum AVMediaType codec_type
General type of the encoded data.
int flags
A combination of AV_PKT_FLAG values.
int avio_r8(AVIOContext *s)
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
unsigned int nb_streams
Number of elements in AVFormatContext.streams.
preferred ID for MPEG-1/2 video decoding
#define LXF_MAX_PACKET_HEADER_SIZE
static int read_header(FFV1Context *f)
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
#define LXF_HEADER_DATA_SIZE
static int lxf_probe(const AVProbeData *p)
#define AV_LOG_INFO
Standard information.
AVIOContext * pb
I/O context.
static int lxf_read_packet(AVFormatContext *s, AVPacket *pkt)
static int get_packet_header(AVFormatContext *s)
Read and checksum the next packet header.
This structure contains the data a format has to probe a file.
static const AVCodecTag lxf_tags[]
void avpriv_report_missing_feature(void *avc, const char *msg,...) av_printf_format(2
Log a generic warning message about a missing feature.
int64_t duration
Decoding: duration of the stream, in stream time base.
int sample_rate
Audio only.
void * priv_data
Format private data.
int bits_per_coded_sample
The number of bits per sample in the codedwords.
int64_t dts
Decompression timestamp in AVStream->time_base units; the time at which the packet is decompressed...
AVCodecParameters * codecpar
Codec parameters associated with this stream.
int avio_feof(AVIOContext *s)
Similar to feof() but also returns nonzero on read errors.
uint32_t codec_tag
Additional information about the codec (corresponds to the AVI FOURCC).
This structure stores compressed data.