FFmpeg
Data Structures | Macros | Enumerations | Functions | Variables
nsvdec.c File Reference
#include "libavutil/attributes.h"
#include "libavutil/mathematics.h"
#include "avformat.h"
#include "demux.h"
#include "internal.h"
#include "libavutil/dict.h"
#include "libavutil/intreadwrite.h"

Go to the source code of this file.

Data Structures

struct  NSVStream
 
struct  NSVContext
 

Macros

#define NSV_MAX_RESYNC   (500*1024)
 
#define NSV_MAX_RESYNC_TRIES   300
 
#define T_NSVF   MKTAG('N', 'S', 'V', 'f') /* file header */
 
#define T_NSVS   MKTAG('N', 'S', 'V', 's') /* chunk header */
 
#define T_TOC2   MKTAG('T', 'O', 'C', '2') /* extra index marker */
 
#define T_NONE   MKTAG('N', 'O', 'N', 'E') /* null a/v 4CC */
 
#define T_SUBT   MKTAG('S', 'U', 'B', 'T') /* subtitle aux data */
 
#define T_ASYN   MKTAG('A', 'S', 'Y', 'N') /* async a/v aux marker */
 
#define T_KEYF   MKTAG('K', 'E', 'Y', 'F') /* video keyframe aux marker (addition) */
 
#define TB_NSVF   MKBETAG('N', 'S', 'V', 'f')
 
#define TB_NSVS   MKBETAG('N', 'S', 'V', 's')
 
#define NSV_ST_VIDEO   0
 
#define NSV_ST_AUDIO   1
 
#define NSV_ST_SUBT   2
 

Enumerations

enum  NSVStatus {
  NSV_UNSYNC, NSV_FOUND_NSVF, NSV_HAS_READ_NSVF, NSV_FOUND_NSVS,
  NSV_HAS_READ_NSVS, NSV_FOUND_BEEF, NSV_GOT_VIDEO, NSV_GOT_AUDIO
}
 

Functions

static int nsv_read_chunk (AVFormatContext *s, int fill_header)
 
static int nsv_resync (AVFormatContext *s)
 
static int nsv_parse_NSVf_header (AVFormatContext *s)
 
static int nsv_parse_NSVs_header (AVFormatContext *s)
 
static int nsv_read_header (AVFormatContext *s)
 
static int nsv_read_packet (AVFormatContext *s, AVPacket *pkt)
 
static int nsv_read_seek (AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
 
static int nsv_read_close (AVFormatContext *s)
 
static int nsv_probe (const AVProbeData *p)
 

Variables

static const AVCodecTag nsv_codec_video_tags []
 
static const AVCodecTag nsv_codec_audio_tags []
 
const FFInputFormat ff_nsv_demuxer
 

Macro Definition Documentation

◆ NSV_MAX_RESYNC

#define NSV_MAX_RESYNC   (500*1024)

Definition at line 35 of file nsvdec.c.

◆ NSV_MAX_RESYNC_TRIES

#define NSV_MAX_RESYNC_TRIES   300

Definition at line 36 of file nsvdec.c.

◆ T_NSVF

#define T_NSVF   MKTAG('N', 'S', 'V', 'f') /* file header */

Definition at line 127 of file nsvdec.c.

◆ T_NSVS

#define T_NSVS   MKTAG('N', 'S', 'V', 's') /* chunk header */

Definition at line 128 of file nsvdec.c.

◆ T_TOC2

#define T_TOC2   MKTAG('T', 'O', 'C', '2') /* extra index marker */

Definition at line 129 of file nsvdec.c.

◆ T_NONE

#define T_NONE   MKTAG('N', 'O', 'N', 'E') /* null a/v 4CC */

Definition at line 130 of file nsvdec.c.

◆ T_SUBT

#define T_SUBT   MKTAG('S', 'U', 'B', 'T') /* subtitle aux data */

Definition at line 131 of file nsvdec.c.

◆ T_ASYN

#define T_ASYN   MKTAG('A', 'S', 'Y', 'N') /* async a/v aux marker */

Definition at line 132 of file nsvdec.c.

◆ T_KEYF

#define T_KEYF   MKTAG('K', 'E', 'Y', 'F') /* video keyframe aux marker (addition) */

Definition at line 133 of file nsvdec.c.

◆ TB_NSVF

#define TB_NSVF   MKBETAG('N', 'S', 'V', 'f')

Definition at line 135 of file nsvdec.c.

◆ TB_NSVS

#define TB_NSVS   MKBETAG('N', 'S', 'V', 's')

Definition at line 136 of file nsvdec.c.

◆ NSV_ST_VIDEO

#define NSV_ST_VIDEO   0

Definition at line 139 of file nsvdec.c.

◆ NSV_ST_AUDIO

#define NSV_ST_AUDIO   1

Definition at line 140 of file nsvdec.c.

◆ NSV_ST_SUBT

#define NSV_ST_SUBT   2

Definition at line 141 of file nsvdec.c.

Enumeration Type Documentation

◆ NSVStatus

enum NSVStatus
Enumerator
NSV_UNSYNC 
NSV_FOUND_NSVF 
NSV_HAS_READ_NSVF 
NSV_FOUND_NSVS 
NSV_HAS_READ_NSVS 
NSV_FOUND_BEEF 
NSV_GOT_VIDEO 
NSV_GOT_AUDIO 

Definition at line 143 of file nsvdec.c.

Function Documentation

◆ nsv_read_chunk()

static int nsv_read_chunk ( AVFormatContext s,
int  fill_header 
)
static

Definition at line 540 of file nsvdec.c.

Referenced by nsv_read_header(), and nsv_read_packet().

◆ nsv_resync()

static int nsv_resync ( AVFormatContext s)
static

Definition at line 219 of file nsvdec.c.

Referenced by nsv_read_chunk(), and nsv_read_header().

◆ nsv_parse_NSVf_header()

static int nsv_parse_NSVf_header ( AVFormatContext s)
static

Definition at line 260 of file nsvdec.c.

Referenced by nsv_read_header().

◆ nsv_parse_NSVs_header()

static int nsv_parse_NSVs_header ( AVFormatContext s)
static

Definition at line 375 of file nsvdec.c.

Referenced by nsv_read_chunk(), and nsv_read_header().

◆ nsv_read_header()

static int nsv_read_header ( AVFormatContext s)
static

Definition at line 505 of file nsvdec.c.

◆ nsv_read_packet()

static int nsv_read_packet ( AVFormatContext s,
AVPacket pkt 
)
static

Definition at line 664 of file nsvdec.c.

◆ nsv_read_seek()

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

Definition at line 687 of file nsvdec.c.

◆ nsv_read_close()

static int nsv_read_close ( AVFormatContext s)
static

Definition at line 707 of file nsvdec.c.

◆ nsv_probe()

static int nsv_probe ( const AVProbeData p)
static

Definition at line 720 of file nsvdec.c.

Variable Documentation

◆ nsv_codec_video_tags

const AVCodecTag nsv_codec_video_tags[]
static
Initial value:
= {
{ AV_CODEC_ID_VP3, MKTAG('V', 'P', '3', ' ') },
{ AV_CODEC_ID_VP3, MKTAG('V', 'P', '3', '0') },
{ AV_CODEC_ID_VP3, MKTAG('V', 'P', '3', '1') },
{ AV_CODEC_ID_VP5, MKTAG('V', 'P', '5', ' ') },
{ AV_CODEC_ID_VP5, MKTAG('V', 'P', '5', '0') },
{ AV_CODEC_ID_VP6, MKTAG('V', 'P', '6', ' ') },
{ AV_CODEC_ID_VP6, MKTAG('V', 'P', '6', '0') },
{ AV_CODEC_ID_VP6, MKTAG('V', 'P', '6', '1') },
{ AV_CODEC_ID_VP6, MKTAG('V', 'P', '6', '2') },
{ AV_CODEC_ID_VP8, MKTAG('V', 'P', '8', '0') },
{ AV_CODEC_ID_MPEG4, MKTAG('X', 'V', 'I', 'D') },
{ AV_CODEC_ID_H264, MKTAG('H', '2', '6', '4') },
{ AV_CODEC_ID_RAWVIDEO, MKTAG('R', 'G', 'B', '3') },
}

Definition at line 183 of file nsvdec.c.

Referenced by nsv_parse_NSVs_header().

◆ nsv_codec_audio_tags

const AVCodecTag nsv_codec_audio_tags[]
static
Initial value:
= {
{ AV_CODEC_ID_MP3, MKTAG('M', 'P', '3', ' ') },
{ AV_CODEC_ID_AAC, MKTAG('A', 'A', 'C', ' ') },
{ AV_CODEC_ID_AAC, MKTAG('A', 'A', 'C', 'P') },
{ AV_CODEC_ID_AAC, MKTAG('A', 'A', 'V', ' ') },
{ AV_CODEC_ID_AAC, MKTAG('V', 'L', 'B', ' ') },
{ AV_CODEC_ID_SPEEX, MKTAG('S', 'P', 'X', ' ') },
{ AV_CODEC_ID_PCM_U16LE, MKTAG('P', 'C', 'M', ' ') },
}

Definition at line 204 of file nsvdec.c.

Referenced by nsv_parse_NSVs_header().

◆ ff_nsv_demuxer

const FFInputFormat ff_nsv_demuxer
Initial value:
= {
.p.name = "nsv",
.p.long_name = NULL_IF_CONFIG_SMALL("Nullsoft Streaming Video"),
.priv_data_size = sizeof(NSVContext),
.flags_internal = FF_INFMT_FLAG_INIT_CLEANUP,
}

Definition at line 751 of file nsvdec.c.

AV_CODEC_ID_RAWVIDEO
@ AV_CODEC_ID_RAWVIDEO
Definition: codec_id.h:65
AV_CODEC_ID_MPEG4
@ AV_CODEC_ID_MPEG4
Definition: codec_id.h:64
AV_CODEC_ID_VP6
@ AV_CODEC_ID_VP6
Definition: codec_id.h:143
nsv_read_seek
static int nsv_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
Definition: nsvdec.c:687
NSVContext
Definition: nsvdec.c:166
AV_CODEC_ID_SPEEX
@ AV_CODEC_ID_SPEEX
Definition: codec_id.h:475
read_seek
static int read_seek(AVFormatContext *ctx, int stream_index, int64_t timestamp, int flags)
Definition: libcdio.c:151
read_close
static av_cold int read_close(AVFormatContext *ctx)
Definition: libcdio.c:143
AV_CODEC_ID_MP3
@ AV_CODEC_ID_MP3
preferred ID for decoding MPEG audio layer 1, 2 or 3
Definition: codec_id.h:441
nsv_read_header
static int nsv_read_header(AVFormatContext *s)
Definition: nsvdec.c:505
read_packet
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
Definition: avio_read_callback.c:41
AV_CODEC_ID_H264
@ AV_CODEC_ID_H264
Definition: codec_id.h:79
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:550
AV_CODEC_ID_AAC
@ AV_CODEC_ID_AAC
Definition: codec_id.h:442
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:106
nsv_read_packet
static int nsv_read_packet(AVFormatContext *s, AVPacket *pkt)
Definition: nsvdec.c:664
nsv_probe
static int nsv_probe(const AVProbeData *p)
Definition: nsvdec.c:720
AV_CODEC_ID_VP5
@ AV_CODEC_ID_VP5
Definition: codec_id.h:142
AV_CODEC_ID_VP3
@ AV_CODEC_ID_VP3
Definition: codec_id.h:81
AV_CODEC_ID_NONE
@ AV_CODEC_ID_NONE
Definition: codec_id.h:50
read_probe
static int read_probe(const AVProbeData *p)
Definition: cdg.c:30
AV_CODEC_ID_PCM_U16LE
@ AV_CODEC_ID_PCM_U16LE
Definition: codec_id.h:330
AV_CODEC_ID_VP8
@ AV_CODEC_ID_VP8
Definition: codec_id.h:192
MKTAG
#define MKTAG(a, b, c, d)
Definition: macros.h:55
nsv_read_close
static int nsv_read_close(AVFormatContext *s)
Definition: nsvdec.c:707