FFmpeg
Data Structures | Macros | Functions | Variables
lxfdec.c File Reference
#include <inttypes.h>
#include "libavutil/intreadwrite.h"
#include "libavcodec/bytestream.h"
#include "avformat.h"
#include "demux.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  LXFDemuxContext
 

Macros

#define LXF_MAX_PACKET_HEADER_SIZE   256
 
#define LXF_HEADER_DATA_SIZE   120
 
#define LXF_IDENT   "LEITCH\0"
 
#define LXF_IDENT_LENGTH   8
 
#define LXF_SAMPLERATE   48000
 

Functions

static int lxf_probe (const AVProbeData *p)
 
static int check_checksum (const uint8_t *header, int size)
 Verify the checksum of an LXF packet header. More...
 
static int lxf_sync (AVFormatContext *s, uint8_t *header)
 Read input until we find the next ident. More...
 
static int get_packet_header (AVFormatContext *s)
 Read and checksum the next packet header. More...
 
static int lxf_read_header (AVFormatContext *s)
 
static int lxf_read_packet (AVFormatContext *s, AVPacket *pkt)
 

Variables

static const AVCodecTag lxf_tags []
 
const AVInputFormat ff_lxf_demuxer
 

Macro Definition Documentation

◆ LXF_MAX_PACKET_HEADER_SIZE

#define LXF_MAX_PACKET_HEADER_SIZE   256

Definition at line 30 of file lxfdec.c.

◆ LXF_HEADER_DATA_SIZE

#define LXF_HEADER_DATA_SIZE   120

Definition at line 31 of file lxfdec.c.

◆ LXF_IDENT

#define LXF_IDENT   "LEITCH\0"

Definition at line 32 of file lxfdec.c.

◆ LXF_IDENT_LENGTH

#define LXF_IDENT_LENGTH   8

Definition at line 33 of file lxfdec.c.

◆ LXF_SAMPLERATE

#define LXF_SAMPLERATE   48000

Definition at line 34 of file lxfdec.c.

Function Documentation

◆ lxf_probe()

static int lxf_probe ( const AVProbeData p)
static

Definition at line 56 of file lxfdec.c.

◆ check_checksum()

static int check_checksum ( const uint8_t *  header,
int  size 
)
static

Verify the checksum of an LXF packet header.

Parameters
[in]headerthe packet header to check
Returns
zero if the checksum is OK, non-zero otherwise

Definition at line 70 of file lxfdec.c.

Referenced by get_packet_header().

◆ lxf_sync()

static int lxf_sync ( AVFormatContext s,
uint8_t *  header 
)
static

Read input until we find the next ident.

If found, copy it to the header buffer

Parameters
[out]headerwhere to copy the ident to
Returns
0 if an ident was found, < 0 on I/O error

Definition at line 87 of file lxfdec.c.

Referenced by get_packet_header().

◆ get_packet_header()

static int get_packet_header ( AVFormatContext s)
static

Read and checksum the next packet header.

Returns
the size of the payload following the header or < 0 on failure

Definition at line 113 of file lxfdec.c.

Referenced by lxf_read_header(), and lxf_read_packet().

◆ lxf_read_header()

static int lxf_read_header ( AVFormatContext s)
static

Definition at line 231 of file lxfdec.c.

◆ lxf_read_packet()

static int lxf_read_packet ( AVFormatContext s,
AVPacket pkt 
)
static

Definition at line 295 of file lxfdec.c.

Variable Documentation

◆ lxf_tags

const AVCodecTag lxf_tags[]
static
Initial value:

Definition at line 36 of file lxfdec.c.

Referenced by lxf_read_header().

◆ ff_lxf_demuxer

const AVInputFormat ff_lxf_demuxer
Initial value:
= {
.name = "lxf",
.long_name = NULL_IF_CONFIG_SMALL("VR native stream (LXF)"),
.priv_data_size = sizeof(LXFDemuxContext),
.codec_tag = (const AVCodecTag* const []){lxf_tags, 0},
}

Definition at line 338 of file lxfdec.c.

AV_CODEC_ID_RAWVIDEO
@ AV_CODEC_ID_RAWVIDEO
Definition: codec_id.h:63
AVCodecTag
Definition: internal.h:50
lxf_read_packet
static int lxf_read_packet(AVFormatContext *s, AVPacket *pkt)
Definition: lxfdec.c:295
read_header
static int read_header(FFV1Context *f)
Definition: ffv1dec.c:532
read_probe
static int read_probe(const AVProbeData *pd)
Definition: jvdec.c:55
AV_CODEC_ID_MPEG1VIDEO
@ AV_CODEC_ID_MPEG1VIDEO
Definition: codec_id.h:51
LXFDemuxContext
Definition: lxfdec.c:50
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:117
lxf_tags
static const AVCodecTag lxf_tags[]
Definition: lxfdec.c:36
AV_CODEC_ID_MJPEG
@ AV_CODEC_ID_MJPEG
Definition: codec_id.h:57
AV_CODEC_ID_NONE
@ AV_CODEC_ID_NONE
Definition: codec_id.h:48
AV_CODEC_ID_DVVIDEO
@ AV_CODEC_ID_DVVIDEO
Definition: codec_id.h:74
read_packet
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
Definition: avio_reading.c:42
lxf_read_header
static int lxf_read_header(AVFormatContext *s)
Definition: lxfdec.c:231
lxf_probe
static int lxf_probe(const AVProbeData *p)
Definition: lxfdec.c:56
AV_CODEC_ID_MPEG2VIDEO
@ AV_CODEC_ID_MPEG2VIDEO
preferred ID for MPEG-1/2 video decoding
Definition: codec_id.h:52