lxfdec.c File Reference
#include "libavutil/intreadwrite.h"
#include "avformat.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  LXFDemuxContext
 

Macros

#define LXF_PACKET_HEADER_SIZE   60
 
#define LXF_HEADER_DATA_SIZE   120
 
#define LXF_IDENT   "LEITCH\0"
 
#define LXF_IDENT_LENGTH   8
 
#define LXF_SAMPLERATE   48000
 
#define LXF_MAX_AUDIO_PACKET   (8008*15*4)
 15-channel 32-bit NTSC audio frame More...
 

Functions

static int lxf_probe (AVProbeData *p)
 
static int check_checksum (const uint8_t *header)
 Verify the checksum of an LXF packet header. More...
 
static int sync (AVFormatContext *s, uint8_t *header)
 Read input until we find the next ident. More...
 
static int get_packet_header (AVFormatContext *s, uint8_t *header, uint32_t *format)
 Read and checksum the next packet header. More...
 
static int lxf_read_header (AVFormatContext *s)
 
static void deplanarize (LXFDemuxContext *lxf, AVStream *ast, uint8_t *out, int bytes)
 De-planerize the PCM data in lxf->temp FIXME: remove this once support for planar audio is added to libavcodec. More...
 
static int lxf_read_packet (AVFormatContext *s, AVPacket *pkt)
 

Variables

static const AVCodecTag lxf_tags []
 
AVInputFormat ff_lxf_demuxer
 

Macro Definition Documentation

#define LXF_HEADER_DATA_SIZE   120

Definition at line 27 of file lxfdec.c.

Referenced by lxf_read_header().

#define LXF_IDENT   "LEITCH\0"

Definition at line 28 of file lxfdec.c.

Referenced by lxf_probe(), and sync().

#define LXF_IDENT_LENGTH   8

Definition at line 29 of file lxfdec.c.

Referenced by get_packet_header(), lxf_probe(), and sync().

#define LXF_MAX_AUDIO_PACKET   (8008*15*4)

15-channel 32-bit NTSC audio frame

Definition at line 31 of file lxfdec.c.

Referenced by lxf_read_packet().

#define LXF_PACKET_HEADER_SIZE   60

Definition at line 26 of file lxfdec.c.

Referenced by check_checksum(), get_packet_header(), lxf_read_header(), and lxf_read_packet().

#define LXF_SAMPLERATE   48000

Definition at line 30 of file lxfdec.c.

Referenced by get_packet_header(), and lxf_read_header().

Function Documentation

static int check_checksum ( const uint8_t header)
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 67 of file lxfdec.c.

Referenced by get_packet_header().

static void deplanarize ( LXFDemuxContext lxf,
AVStream ast,
uint8_t out,
int  bytes 
)
static

De-planerize the PCM data in lxf->temp FIXME: remove this once support for planar audio is added to libavcodec.

Parameters
[out]outwhere to write the de-planerized data to
[in]bytesthe total size of the PCM data

Definition at line 271 of file lxfdec.c.

Referenced by lxf_read_packet().

static int get_packet_header ( AVFormatContext s,
uint8_t header,
uint32_t *  format 
)
static

Read and checksum the next packet header.

Parameters
[out]headerthe read packet header
[out]formatcontext dependent format information
Returns
the size of the payload following the header or < 0 on failure

Definition at line 112 of file lxfdec.c.

Referenced by lxf_read_header(), and lxf_read_packet().

static int lxf_probe ( AVProbeData p)
static

Definition at line 53 of file lxfdec.c.

static int lxf_read_header ( AVFormatContext s)
static

Definition at line 198 of file lxfdec.c.

static int lxf_read_packet ( AVFormatContext s,
AVPacket pkt 
)
static

Definition at line 281 of file lxfdec.c.

static int 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 84 of file lxfdec.c.

Referenced by avi_sync(), ff_gen_syncpoint_search(), get_packet_header(), ogg_read_page(), and opt_map().

Variable Documentation

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 339 of file lxfdec.c.

const AVCodecTag lxf_tags[]
static