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

libSDL output device More...

#include <SDL.h>
#include <SDL_thread.h>
#include "libavutil/avstring.h"
#include "libavutil/imgutils.h"
#include "libavutil/opt.h"
#include "libavutil/parseutils.h"
#include "libavutil/pixdesc.h"
#include "libavutil/time.h"
#include "avdevice.h"

Go to the source code of this file.

Data Structures

struct  SDLContext
 
struct  sdl_overlay_pix_fmt_entry
 

Macros

#define SDL_BASE_FLAGS   (SDL_SWSURFACE|SDL_RESIZABLE)
 
#define OFFSET(x)   offsetof(SDLContext,x)
 

Functions

static int sdl_write_trailer (AVFormatContext *s)
 
static void compute_overlay_rect (AVFormatContext *s)
 
static int event_thread (void *arg)
 
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 SDL_BASE_FLAGS   (SDL_SWSURFACE|SDL_RESIZABLE)

Definition at line 132 of file sdl.c.

Referenced by event_thread().

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

Definition at line 348 of file sdl.c.

Function Documentation

static int sdl_write_trailer ( AVFormatContext s)
static

Definition at line 67 of file sdl.c.

Referenced by sdl_write_header(), and sdl_write_packet().

static void compute_overlay_rect ( AVFormatContext s)
static

Definition at line 92 of file sdl.c.

Referenced by event_thread(), and sdl_write_header().

static int event_thread ( void arg)
static

Definition at line 134 of file sdl.c.

Referenced by sdl_write_header().

static int sdl_write_header ( AVFormatContext s)
static

Definition at line 233 of file sdl.c.

static int sdl_write_packet ( AVFormatContext s,
AVPacket pkt 
)
static

Definition at line 315 of file sdl.c.

Variable Documentation

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:83
packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr
Definition: pixfmt.h:64
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:63

Referenced by sdl_write_header().

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 NULL
Definition: coverity.c:32
#define AV_OPT_FLAG_ENCODING_PARAM
a generic parameter which can be set by the user for muxing or encoding
Definition: opt.h:275
#define OFFSET(x)
Definition: sdl.c:348
static const char * window_title
Definition: ffplay.c:315
offset must point to two consecutive integers
Definition: opt.h:232

Definition at line 350 of file sdl.c.

const AVClass sdl_class
static
Initial value:
= {
.class_name = "sdl outdev",
.item_name = av_default_item_name,
.option = options,
}
#define LIBAVUTIL_VERSION_INT
Definition: version.h:70
av_default_item_name
static const AVOption options[]
Definition: sdl.c:350

Definition at line 358 of file sdl.c.

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:37
static int sdl_write_header(AVFormatContext *s)
Definition: sdl.c:233
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:176
static int sdl_write_trailer(AVFormatContext *s)
Definition: sdl.c:67
static int write_trailer(AVFormatContext *s1)
Definition: v4l2enc.c:94
#define AVFMT_NOTIMESTAMPS
Format does not need / have any timestamps.
Definition: avformat.h:485
static int sdl_write_packet(AVFormatContext *s, AVPacket *pkt)
Definition: sdl.c:315
static int flags
Definition: cpu.c:47
#define AVFMT_NOFILE
Demuxer will use avio_open, no opened file should be provided by the caller.
Definition: avformat.h:477
#define AVFMT_VARIABLE_FPS
Format allows variable fps.
Definition: avformat.h:488
static void write_header(FFV1Context *f)
Definition: ffv1enc.c:497
static const AVClass sdl_class
Definition: sdl.c:358
static int write_packet(AVFormatContext *s1, AVPacket *pkt)
Definition: v4l2enc.c:86

Definition at line 366 of file sdl.c.