FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
decoding_encoding.c File Reference

libavcodec API use example. More...

#include <math.h>
#include <libavutil/opt.h>
#include <libavcodec/avcodec.h>
#include <libavutil/channel_layout.h>
#include <libavutil/common.h>
#include <libavutil/imgutils.h>
#include <libavutil/mathematics.h>
#include <libavutil/samplefmt.h>

Go to the source code of this file.

Macros

#define INBUF_SIZE   4096
 
#define AUDIO_INBUF_SIZE   20480
 
#define AUDIO_REFILL_THRESH   4096
 

Functions

static int check_sample_fmt (AVCodec *codec, enum AVSampleFormat sample_fmt)
 
static int select_sample_rate (AVCodec *codec)
 
static int select_channel_layout (AVCodec *codec)
 
static void audio_encode_example (const char *filename)
 
static void audio_decode_example (const char *outfilename, const char *filename)
 
static void video_encode_example (const char *filename, int codec_id)
 
static void pgm_save (unsigned char *buf, int wrap, int xsize, int ysize, char *filename)
 
static int decode_write_frame (const char *outfilename, AVCodecContext *avctx, AVFrame *frame, int *frame_count, AVPacket *pkt, int last)
 
static void video_decode_example (const char *outfilename, const char *filename)
 
int main (int argc, char **argv)
 

Detailed Description

libavcodec API use example.

Definition in file decoding_encoding.c.

Macro Definition Documentation

#define INBUF_SIZE   4096
Examples:
decoding_encoding.c.

Definition at line 43 of file decoding_encoding.c.

Referenced by video_decode_example().

#define AUDIO_INBUF_SIZE   20480
Examples:
decoding_encoding.c.

Definition at line 44 of file decoding_encoding.c.

Referenced by audio_decode_example().

#define AUDIO_REFILL_THRESH   4096
Examples:
decoding_encoding.c.

Definition at line 45 of file decoding_encoding.c.

Referenced by audio_decode_example().

Function Documentation

static int check_sample_fmt ( AVCodec codec,
enum AVSampleFormat  sample_fmt 
)
static
Examples:
decoding_encoding.c.

Definition at line 48 of file decoding_encoding.c.

Referenced by audio_encode_example().

static int select_sample_rate ( AVCodec codec)
static
Examples:
decoding_encoding.c.

Definition at line 61 of file decoding_encoding.c.

Referenced by audio_encode_example().

static int select_channel_layout ( AVCodec codec)
static
Examples:
decoding_encoding.c.

Definition at line 78 of file decoding_encoding.c.

Referenced by audio_encode_example().

static void audio_encode_example ( const char *  filename)
static
Examples:
decoding_encoding.c.

Definition at line 103 of file decoding_encoding.c.

Referenced by main().

static void audio_decode_example ( const char *  outfilename,
const char *  filename 
)
static
Examples:
decoding_encoding.c.

Definition at line 242 of file decoding_encoding.c.

Referenced by main().

static void video_encode_example ( const char *  filename,
int  codec_id 
)
static
Examples:
decoding_encoding.c.

Definition at line 347 of file decoding_encoding.c.

Referenced by main().

static void pgm_save ( unsigned char *  buf,
int  wrap,
int  xsize,
int  ysize,
char *  filename 
)
static
Examples:
decoding_encoding.c.

Definition at line 493 of file decoding_encoding.c.

Referenced by decode_write_frame().

static int decode_write_frame ( const char *  outfilename,
AVCodecContext avctx,
AVFrame frame,
int frame_count,
AVPacket pkt,
int  last 
)
static
Examples:
decoding_encoding.c.

Definition at line 506 of file decoding_encoding.c.

Referenced by video_decode_example().

static void video_decode_example ( const char *  outfilename,
const char *  filename 
)
static
Examples:
decoding_encoding.c.

Definition at line 534 of file decoding_encoding.c.

Referenced by main().

int main ( int  argc,
char **  argv 
)
Examples:
decoding_encoding.c.

Definition at line 631 of file decoding_encoding.c.