FFmpeg
Data Structures | Macros | Functions | Variables
vividas.c File Reference

Vividas VIV (.viv) file demuxer. More...

#include "libavutil/avassert.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/mem.h"
#include "avio_internal.h"
#include "avformat.h"
#include "demux.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  VIV_SB_block
 
struct  VIV_SB_entry
 
struct  VIV_AudioSubpacket
 
struct  VividasDemuxContext
 

Macros

#define MAX_AUDIO_SUBPACKETS   100
 

Functions

static int viv_probe (const AVProbeData *p)
 
static uint32_t decode_key (uint8_t *buf)
 
static void put_v (uint8_t *p, unsigned v)
 
static unsigned recover_key (unsigned char sample[4], unsigned expected_size)
 
static void xor_block (void *p1, void *p2, unsigned size, int key, unsigned *key_ptr)
 
static void decode_block (uint8_t *src, uint8_t *dest, unsigned size, uint32_t key, uint32_t *key_ptr, int align)
 
static uint32_t get_v (uint8_t *p, int len)
 
static uint8_t * read_vblock (AVIOContext *src, uint32_t *size, uint32_t key, uint32_t *k2, int align)
 
static uint8_t * read_sb_block (AVIOContext *src, unsigned *size, uint32_t *key, unsigned expected_size)
 
static int track_header (VividasDemuxContext *viv, AVFormatContext *s, const uint8_t *buf, int size)
 
static int track_index (VividasDemuxContext *viv, AVFormatContext *s, const uint8_t *buf, unsigned size)
 
static void load_sb_block (AVFormatContext *s, VividasDemuxContext *viv, unsigned expected_size)
 
static int viv_read_header (AVFormatContext *s)
 
static int viv_read_packet (AVFormatContext *s, AVPacket *pkt)
 
static int viv_read_close (AVFormatContext *s)
 
static int viv_read_seek (AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
 

Variables

static const uint8_t keybits [32]
 
const FFInputFormat ff_vividas_demuxer
 

Detailed Description

Vividas VIV (.viv) file demuxer.

Author
Andrzej Szombierski [qq at kuku eu org] (2010-07)
See also
http://wiki.multimedia.cx/index.php?title=Vividas_VIV

Definition in file vividas.c.

Macro Definition Documentation

◆ MAX_AUDIO_SUBPACKETS

#define MAX_AUDIO_SUBPACKETS   100

Definition at line 39 of file vividas.c.

Function Documentation

◆ viv_probe()

static int viv_probe ( const AVProbeData p)
static

Definition at line 77 of file vividas.c.

◆ decode_key()

static uint32_t decode_key ( uint8_t *  buf)
static

Definition at line 92 of file vividas.c.

Referenced by viv_read_header().

◆ put_v()

static void put_v ( uint8_t *  p,
unsigned  v 
)
static

Definition at line 104 of file vividas.c.

Referenced by recover_key().

◆ recover_key()

static unsigned recover_key ( unsigned char  sample[4],
unsigned  expected_size 
)
static

Definition at line 116 of file vividas.c.

Referenced by read_sb_block().

◆ xor_block()

static void xor_block ( void *  p1,
void *  p2,
unsigned  size,
int  key,
unsigned *  key_ptr 
)
static

Definition at line 125 of file vividas.c.

Referenced by decode_block().

◆ decode_block()

static void decode_block ( uint8_t *  src,
uint8_t *  dest,
unsigned  size,
uint32_t  key,
uint32_t *  key_ptr,
int  align 
)
static

Definition at line 144 of file vividas.c.

Referenced by read_sb_block(), and read_vblock().

◆ get_v()

static uint32_t get_v ( uint8_t *  p,
int  len 
)
static

Definition at line 184 of file vividas.c.

Referenced by read_sb_block(), and read_vblock().

◆ read_vblock()

static uint8_t* read_vblock ( AVIOContext src,
uint32_t *  size,
uint32_t  key,
uint32_t *  k2,
int  align 
)
static

Definition at line 199 of file vividas.c.

Referenced by viv_read_header().

◆ read_sb_block()

static uint8_t* read_sb_block ( AVIOContext src,
unsigned *  size,
uint32_t *  key,
unsigned  expected_size 
)
static

Definition at line 234 of file vividas.c.

Referenced by load_sb_block().

◆ track_header()

static int track_header ( VividasDemuxContext viv,
AVFormatContext s,
const uint8_t *  buf,
int  size 
)
static

Definition at line 282 of file vividas.c.

Referenced by viv_read_header().

◆ track_index()

static int track_index ( VividasDemuxContext viv,
AVFormatContext s,
const uint8_t *  buf,
unsigned  size 
)
static

◆ load_sb_block()

static void load_sb_block ( AVFormatContext s,
VividasDemuxContext viv,
unsigned  expected_size 
)
static

Definition at line 496 of file vividas.c.

Referenced by viv_read_header(), viv_read_packet(), and viv_read_seek().

◆ viv_read_header()

static int viv_read_header ( AVFormatContext s)
static

Definition at line 540 of file vividas.c.

◆ viv_read_packet()

static int viv_read_packet ( AVFormatContext s,
AVPacket pkt 
)
static

Definition at line 635 of file vividas.c.

◆ viv_read_close()

static int viv_read_close ( AVFormatContext s)
static

Definition at line 747 of file vividas.c.

◆ viv_read_seek()

static int viv_read_seek ( AVFormatContext s,
int  stream_index,
int64_t  timestamp,
int  flags 
)
static

Definition at line 759 of file vividas.c.

Variable Documentation

◆ keybits

const uint8_t keybits[32]
static
Initial value:
= {
20, 52, 111, 10, 27, 71, 142, 53,
82, 138, 1, 78, 86, 121, 183, 85,
105, 152, 39, 140, 172, 11, 64, 144,
155, 6, 71, 163, 186, 49, 126, 43,
}

Definition at line 85 of file vividas.c.

Referenced by decode_key().

◆ ff_vividas_demuxer

const FFInputFormat ff_vividas_demuxer
Initial value:
= {
.p.name = "vividas",
.p.long_name = NULL_IF_CONFIG_SMALL("Vividas VIV"),
.priv_data_size = sizeof(VividasDemuxContext),
.flags_internal = FF_INFMT_FLAG_INIT_CLEANUP,
}

Definition at line 795 of file vividas.c.

read_seek
static int read_seek(AVFormatContext *ctx, int stream_index, int64_t timestamp, int flags)
Definition: libcdio.c:151
viv_read_header
static int viv_read_header(AVFormatContext *s)
Definition: vividas.c:540
read_close
static av_cold int read_close(AVFormatContext *ctx)
Definition: libcdio.c:143
read_packet
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
Definition: avio_read_callback.c:42
viv_read_seek
static int viv_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
Definition: vividas.c:759
FF_INFMT_FLAG_INIT_CLEANUP
#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...
Definition: demux.h:35
read_header
static int read_header(FFV1Context *f)
Definition: ffv1dec.c:538
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:94
VividasDemuxContext
Definition: vividas.c:55
viv_probe
static int viv_probe(const AVProbeData *p)
Definition: vividas.c:77
viv_read_packet
static int viv_read_packet(AVFormatContext *s, AVPacket *pkt)
Definition: vividas.c:635
read_probe
static int read_probe(const AVProbeData *p)
Definition: cdg.c:30
viv_read_close
static int viv_read_close(AVFormatContext *s)
Definition: vividas.c:747