sdl.c File Reference

libSDL output device More...

#include <SDL.h>
#include "libavutil/avstring.h"
#include "libavutil/opt.h"
#include "libavutil/parseutils.h"
#include "libavutil/pixdesc.h"
#include "avdevice.h"
Include dependency graph for sdl.c:

Go to the source code of this file.

Data Structures

struct  SDLContext
 
struct  sdl_overlay_pix_fmt_entry
 

Macros

#define OFFSET(x)   offsetof(SDLContext,x)
 

Functions

static int sdl_write_trailer (AVFormatContext *s)
 
static int sdl_write_header (AVFormatContext *s)
 
static int sdl_write_packet (AVFormatContext *s, AVPacket *pkt)
 

Variables

static const struct sdl_overlay_pix_fmt_entry sdl_overlay_pix_fmt_map []
 
static const AVOption options []
 
static const AVClass sdl_class
 
AVOutputFormat ff_sdl_muxer
 

Detailed Description

libSDL output device

Definition in file sdl.c.

Macro Definition Documentation

#define OFFSET (   x)    offsetof(SDLContext,x)

Definition at line 208 of file sdl.c.

Function Documentation

static int sdl_write_header ( AVFormatContext s)
static

Definition at line 73 of file sdl.c.

static int sdl_write_packet ( AVFormatContext s,
AVPacket pkt 
)
static

Definition at line 183 of file sdl.c.

static int sdl_write_trailer ( AVFormatContext s)
static

Definition at line 56 of file sdl.c.

Referenced by sdl_write_header().

Variable Documentation

AVOutputFormat ff_sdl_muxer
Initial value:
= {
.name = "sdl",
.long_name = NULL_IF_CONFIG_SMALL("SDL output device"),
.priv_data_size = sizeof(SDLContext),
.audio_codec = AV_CODEC_ID_NONE,
.video_codec = AV_CODEC_ID_RAWVIDEO,
.priv_class = &sdl_class,
}
Definition: sdl.c:33
static int write_packet(AVFormatContext *s, AVPacket *pkt)
static int sdl_write_header(AVFormatContext *s)
Definition: sdl.c:73
static int write_trailer(AVFormatContext *s)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
static int sdl_write_trailer(AVFormatContext *s)
Definition: sdl.c:56
#define AVFMT_NOTIMESTAMPS
Format does not need / have any timestamps.
Definition: avformat.h:352
static int sdl_write_packet(AVFormatContext *s, AVPacket *pkt)
Definition: sdl.c:183
static int flags
Definition: cpu.c:23
#define AVFMT_NOFILE
Demuxer will use avio_open, no opened file should be provided by the caller.
Definition: avformat.h:345
#define AVFMT_VARIABLE_FPS
Format allows variable fps.
Definition: avformat.h:355
static void write_header(FFV1Context *f)
Definition: ffv1enc.c:470
static const AVClass sdl_class
Definition: sdl.c:218

Definition at line 225 of file sdl.c.

const AVOption options[]
static
Initial value:
= {
{ "window_title", "set SDL window title", OFFSET(window_title), AV_OPT_TYPE_STRING, {.str = NULL }, 0, 0, AV_OPT_FLAG_ENCODING_PARAM },
{ "icon_title", "set SDL iconified window title", OFFSET(icon_title) , AV_OPT_TYPE_STRING, {.str = NULL }, 0, 0, AV_OPT_FLAG_ENCODING_PARAM },
{ "window_size", "set SDL window forced size", OFFSET(window_width), AV_OPT_TYPE_IMAGE_SIZE,{.str=NULL}, 0, 0, AV_OPT_FLAG_ENCODING_PARAM },
{ "window_fullscreen", "set SDL window fullscreen", OFFSET(window_fullscreen), AV_OPT_TYPE_INT,{.i64=0}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM },
{ NULL },
}
#define AV_OPT_FLAG_ENCODING_PARAM
a generic parameter which can be set by the user for muxing or encoding
Definition: opt.h:281
#define OFFSET(x)
Definition: sdl.c:208
NULL
Definition: eval.c:55
static const char * window_title
Definition: ffplay.c:274
offset must point to two consecutive integers
Definition: opt.h:230

Definition at line 210 of file sdl.c.

const AVClass sdl_class
static
Initial value:
= {
.class_name = "sdl outdev",
.item_name = av_default_item_name,
.option = options,
}
av_default_item_name
LIBAVUTIL_VERSION_INT
Definition: eval.c:55
static const AVOption options[]
Definition: sdl.c:210

Definition at line 218 of file sdl.c.

const struct sdl_overlay_pix_fmt_entry sdl_overlay_pix_fmt_map[]
static
Initial value:
= {
{ AV_PIX_FMT_YUV420P, SDL_IYUV_OVERLAY },
{ AV_PIX_FMT_YUYV422, SDL_YUY2_OVERLAY },
{ AV_PIX_FMT_UYVY422, SDL_UYVY_OVERLAY },
}
packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
Definition: pixfmt.h:85
packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr
Definition: pixfmt.h:69
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:68

Referenced by sdl_write_header().