nutdec.c File Reference
#include "libavutil/avstring.h"
#include "libavutil/avassert.h"
#include "libavutil/bswap.h"
#include "libavutil/dict.h"
#include "libavutil/mathematics.h"
#include "libavutil/tree.h"
#include "avio_internal.h"
#include "nut.h"
#include "riff.h"
Include dependency graph for nutdec.c:

Go to the source code of this file.

Macros

#define NUT_MAX_STREAMS   256 /* arbitrary sanity check value */
 
#define GET_V(dst, check)
 

Functions

static int64_t nut_read_timestamp (AVFormatContext *s, int stream_index, int64_t *pos_arg, int64_t pos_limit)
 
static int get_str (AVIOContext *bc, char *string, unsigned int maxlen)
 
static int64_t get_s (AVIOContext *bc)
 
static uint64_t get_fourcc (AVIOContext *bc)
 
static int get_packetheader (NUTContext *nut, AVIOContext *bc, int calculate_checksum, uint64_t startcode)
 
static uint64_t find_any_startcode (AVIOContext *bc, int64_t pos)
 
static int64_t find_startcode (AVIOContext *bc, uint64_t code, int64_t pos)
 Find the given startcode. More...
 
static int nut_probe (AVProbeData *p)
 
static int skip_reserved (AVIOContext *bc, int64_t pos)
 
static int decode_main_header (NUTContext *nut)
 
static int decode_stream_header (NUTContext *nut)
 
static void set_disposition_bits (AVFormatContext *avf, char *value, int stream_id)
 
static int decode_info_header (NUTContext *nut)
 
static int decode_syncpoint (NUTContext *nut, int64_t *ts, int64_t *back_ptr)
 
static int64_t find_duration (NUTContext *nut, int64_t filesize)
 
static int find_and_decode_index (NUTContext *nut)
 
static int nut_read_header (AVFormatContext *s)
 
static int decode_frame_header (NUTContext *nut, int64_t *pts, int *stream_id, uint8_t *header_idx, int frame_code)
 
static int decode_frame (NUTContext *nut, AVPacket *pkt, int frame_code)
 
static int nut_read_packet (AVFormatContext *s, AVPacket *pkt)
 
static int read_seek (AVFormatContext *s, int stream_index, int64_t pts, int flags)
 
static int nut_read_close (AVFormatContext *s)
 

Variables

AVInputFormat ff_nut_demuxer
 

Macro Definition Documentation

#define GET_V (   dst,
  check 
)
Value:
do { \
tmp = ffio_read_varlen(bc); \
if (!(check)) { \
av_log(s, AV_LOG_ERROR, "Error " #dst " is (%"PRId64")\n", tmp); \
return -1; \
} \
dst = tmp; \
} while (0)
uint64_t ffio_read_varlen(AVIOContext *bc)
Definition: aviobuf.c:683
const char * s
Definition: avisynth_c.h:668
initialize output if(nPeaks >3)%at least 3 peaks in spectrum for trying to find f0 nf0peaks
void av_log(void *avcl, int level, const char *fmt,...)
Definition: log.c:246
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:148
else dst[i][x+y *dst_stride[i]]
Definition: vf_mcdeint.c:160
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame This method is called when a frame is wanted on an output For an it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return it should return
#define check(x, y, S, v)

Definition at line 194 of file nutdec.c.

Referenced by decode_frame_header(), decode_info_header(), decode_main_header(), decode_stream_header(), and find_and_decode_index().

#define NUT_MAX_STREAMS   256 /* arbitrary sanity check value */

Definition at line 33 of file nutdec.c.

Referenced by decode_main_header().

Function Documentation

static int decode_frame ( NUTContext nut,
AVPacket pkt,
int  frame_code 
)
static

Definition at line 834 of file nutdec.c.

Referenced by nut_read_packet().

static int decode_frame_header ( NUTContext nut,
int64_t *  pts,
int *  stream_id,
uint8_t header_idx,
int  frame_code 
)
static

Definition at line 760 of file nutdec.c.

Referenced by decode_frame().

static int decode_info_header ( NUTContext nut)
static

Definition at line 455 of file nutdec.c.

Referenced by nut_read_header(), and nut_read_packet().

static int decode_main_header ( NUTContext nut)
static

Definition at line 217 of file nutdec.c.

Referenced by nut_read_header().

static int decode_stream_header ( NUTContext nut)
static

Definition at line 342 of file nutdec.c.

Referenced by nut_read_header().

static int decode_syncpoint ( NUTContext nut,
int64_t *  ts,
int64_t *  back_ptr 
)
static

Definition at line 545 of file nutdec.c.

Referenced by nut_read_packet(), and nut_read_timestamp().

static int find_and_decode_index ( NUTContext nut)
static

Definition at line 596 of file nutdec.c.

Referenced by nut_read_header().

static uint64_t find_any_startcode ( AVIOContext bc,
int64_t  pos 
)
static

Definition at line 138 of file nutdec.c.

Referenced by find_startcode(), nut_read_header(), and nut_read_packet().

static int64_t find_duration ( NUTContext nut,
int64_t  filesize 
)
static

Definition at line 578 of file nutdec.c.

Referenced by find_and_decode_index().

static int64_t find_startcode ( AVIOContext bc,
uint64_t  code,
int64_t  pos 
)
static

Find the given startcode.

Parameters
codethe startcode
posthe start position of the search, or -1 if the current position
Returns
the position of the startcode or -1 if not found

Definition at line 169 of file nutdec.c.

Referenced by nut_read_header(), nut_read_timestamp(), and read_seek().

static uint64_t get_fourcc ( AVIOContext bc)
static

Definition at line 68 of file nutdec.c.

Referenced by decode_stream_header().

static int get_packetheader ( NUTContext nut,
AVIOContext bc,
int  calculate_checksum,
uint64_t  startcode 
)
static
static int64_t get_s ( AVIOContext bc)
static

Definition at line 58 of file nutdec.c.

Referenced by decode_frame_header(), decode_info_header(), decode_main_header(), and get_fourcc().

static int get_str ( AVIOContext bc,
char *  string,
unsigned int  maxlen 
)
static

Definition at line 38 of file nutdec.c.

Referenced by decode_info_header().

static int nut_probe ( AVProbeData p)
static

Definition at line 181 of file nutdec.c.

static int nut_read_close ( AVFormatContext s)
static

Definition at line 1024 of file nutdec.c.

static int nut_read_header ( AVFormatContext s)
static

Definition at line 696 of file nutdec.c.

static int nut_read_packet ( AVFormatContext s,
AVPacket pkt 
)
static

Definition at line 877 of file nutdec.c.

static int64_t nut_read_timestamp ( AVFormatContext s,
int  stream_index,
int64_t *  pos_arg,
int64_t  pos_limit 
)
static

Definition at line 934 of file nutdec.c.

Referenced by find_duration(), and read_seek().

static int read_seek ( AVFormatContext s,
int  stream_index,
int64_t  pts,
int  flags 
)
static

Definition at line 961 of file nutdec.c.

static void set_disposition_bits ( AVFormatContext avf,
char *  value,
int  stream_id 
)
static

Definition at line 440 of file nutdec.c.

Referenced by decode_info_header().

static int skip_reserved ( AVIOContext bc,
int64_t  pos 
)
static

Variable Documentation

AVInputFormat ff_nut_demuxer
Initial value:
= {
.name = "nut",
.long_name = NULL_IF_CONFIG_SMALL("NUT"),
.priv_data_size = sizeof(NUTContext),
.extensions = "nut",
.codec_tag = ff_nut_codec_tags,
}
static int nut_probe(AVProbeData *p)
Definition: nutdec.c:181
static av_cold int read_close(AVFormatContext *ctx)
Definition: libcdio.c:145
struct NUTContext NUTContext
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
static int nut_read_packet(AVFormatContext *s, AVPacket *pkt)
Definition: nutdec.c:877
static int nut_read_close(AVFormatContext *s)
Definition: nutdec.c:1024
static int read_probe(AVProbeData *pd)
static int nut_read_header(AVFormatContext *s)
Definition: nutdec.c:696
static int read_header(FFV1Context *f)
Definition: ffv1dec.c:517
static int read_packet(AVFormatContext *ctx, AVPacket *pkt)
Definition: libcdio.c:114
#define AVFMT_SEEK_TO_PTS
Seeking is based on PTS.
Definition: avformat.h:371
static int read_seek(AVFormatContext *s, int stream_index, int64_t pts, int flags)
Definition: nutdec.c:961
const AVCodecTag *const ff_nut_codec_tags[]
Definition: nut.c:184

Definition at line 1038 of file nutdec.c.