27 #include "libavutil/avstring.h"
28 #include "libavutil/opt.h"
29 #include "libavutil/parseutils.h"
30 #include "libavutil/pixdesc.h"
64 SDL_FreeYUVOverlay(sdl->
overlay);
87 if (SDL_WasInit(SDL_INIT_VIDEO)) {
89 "SDL video subsystem was already inited, aborting\n");
95 if (SDL_Init(SDL_INIT_VIDEO) != 0) {
118 "Unsupported pixel format '%s', choose one of yuv420p, yuyv422, or uyvy422\n",
167 "SDL does not support an overlay with size of %dx%d pixels\n",
194 SDL_MapRGB(sdl->
surface->format, 0, 0, 0));
195 SDL_LockYUVOverlay(sdl->
overlay);
196 for (i = 0; i < 3; i++) {
200 SDL_DisplayYUVOverlay(sdl->
overlay, &rect);
201 SDL_UnlockYUVOverlay(sdl->
overlay);
203 SDL_UpdateRect(sdl->
surface, rect.x, rect.y, rect.w, rect.h);
208 #define OFFSET(x) offsetof(SDLContext,x)
235 .priv_class = &sdl_class,
int linesize[AV_NUM_DATA_POINTERS]
number of bytes per line
#define LIBAVUTIL_VERSION_INT
char * av_strdup(const char *s) av_malloc_attrib
Duplicate the string s.
AVCodecContext * codec
Codec context associated with this stream.
AVRational sample_aspect_ratio
sample aspect ratio (0 if unknown)
static int sdl_write_header(AVFormatContext *s)
enum AVPixelFormat pix_fmt
const char * av_get_pix_fmt_name(enum AVPixelFormat pix_fmt)
Return the short name for a pixel format, NULL in case pix_fmt is unknown.
void av_log(void *avcl, int level, const char *fmt,...) av_printf_format(3
Send the specified message to the log if the level is less than or equal to the current av_log_level...
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
static int av_cmp_q(AVRational a, AVRational b)
Compare two rationals.
int avpicture_fill(AVPicture *picture, const uint8_t *ptr, enum AVPixelFormat pix_fmt, int width, int height)
Setup the picture fields based on the specified image parameters and the provided image data buffer...
void av_freep(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
static struct sdl_overlay_pix_fmt_entry sdl_overlay_pix_fmt_map[]
const char * av_default_item_name(void *ctx)
Return the context name.
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
AVRational av_mul_q(AVRational b, AVRational c) av_const
Multiply two rationals.
#define AV_LOG_VERBOSE
Detailed information.
enum AVPixelFormat pix_fmt
uint8_t * data[AV_NUM_DATA_POINTERS]
pointers to the image data planes
const OptionDef options[]
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
void * priv_data
Format private data.
char filename[1024]
input or output filename
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
AVPixelFormat
Pixel format.
unsigned int nb_streams
A list of all streams in the file.
static int sdl_write_trailer(AVFormatContext *s)
int64_t av_rescale(int64_t a, int64_t b, int64_t c) av_const
Rescale a 64-bit integer with rounding to nearest.
int width
picture width / height.
static int write_trailer(AVFormatContext *s1)
int sdl_was_already_inited
int window_height
size of the window
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
enum AVMediaType codec_type
packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr
main external API structure.
Main libavdevice API header.
static const char * window_title
Describe the class of an AVClass context structure.
rational number numerator/denominator
static int sdl_write_packet(AVFormatContext *s, AVPacket *pkt)
offset must point to two consecutive integers
AVOutputFormat ff_sdl_muxer
#define AV_OPT_FLAG_ENCODING_PARAM
a generic parameter which can be set by the user for muxing or encoding
packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
static void write_header(FFV1Context *f)
int overlay_height
size of the video in the window
static const AVClass sdl_class
This structure stores compressed data.
static int write_packet(AVFormatContext *s1, AVPacket *pkt)