Data Structures | Macros | Functions | Variables
xv.c File Reference

XVideo output device. More...

#include <X11/Xlib.h>
#include <X11/extensions/Xv.h>
#include <X11/extensions/XShm.h>
#include <X11/extensions/Xvlib.h>
#include <sys/shm.h>
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "libavutil/imgutils.h"
#include "libavformat/internal.h"
#include "avdevice.h"

Go to the source code of this file.

Data Structures

struct  XVContext
struct  XVTagFormatMap


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


static int xv_get_tag_from_format (enum AVPixelFormat format)
static int xv_write_trailer (AVFormatContext *s)
static int xv_write_header (AVFormatContext *s)
static void compute_display_area (AVFormatContext *s)
static int xv_repaint (AVFormatContext *s)
static int write_picture (AVFormatContext *s, uint8_t *input_data[4], int linesize[4])
static int xv_write_packet (AVFormatContext *s, AVPacket *pkt)
static int xv_write_frame (AVFormatContext *s, int stream_index, AVFrame **frame, unsigned flags)
static int xv_control_message (AVFormatContext *s, int type, void *data, size_t data_size)


static const XVTagFormatMap tag_codec_map []
static const AVOption options []
static const AVClass xv_class
AVOutputFormat ff_xv_muxer

Detailed Description

XVideo output device.


Definition in file xv.c.

Macro Definition Documentation

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

Definition at line 359 of file xv.c.

Function Documentation

static int xv_get_tag_from_format ( enum AVPixelFormat  format)

Definition at line 77 of file xv.c.

Referenced by xv_write_header().

static int xv_write_trailer ( AVFormatContext s)

Definition at line 88 of file xv.c.

Referenced by xv_write_header().

static int xv_write_header ( AVFormatContext s)

Definition at line 103 of file xv.c.

static void compute_display_area ( AVFormatContext s)

Definition at line 226 of file xv.c.

Referenced by xv_repaint().

static int xv_repaint ( AVFormatContext s)

Definition at line 256 of file xv.c.

Referenced by write_picture(), and xv_control_message().

static int write_picture ( AVFormatContext s,
uint8_t input_data[4],
int  linesize[4] 

Definition at line 294 of file xv.c.

Referenced by xv_write_frame(), and xv_write_packet().

static int xv_write_packet ( AVFormatContext s,
AVPacket pkt 

Definition at line 322 of file xv.c.

static int xv_write_frame ( AVFormatContext s,
int  stream_index,
AVFrame **  frame,
unsigned  flags 

Definition at line 339 of file xv.c.

static int xv_control_message ( AVFormatContext s,
int  type,
void data,
size_t  data_size 

Definition at line 348 of file xv.c.

Variable Documentation

const XVTagFormatMap tag_codec_map[]
Initial value:
= {
{ MKTAG('I','4','2','0'), AV_PIX_FMT_YUV420P },
{ MKTAG('U','Y','V','Y'), AV_PIX_FMT_UYVY422 },
{ MKTAG('Y','U','Y','2'), AV_PIX_FMT_YUYV422 },
packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
Definition: pixfmt.h:81
packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr
Definition: pixfmt.h:67
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:66
#define MKTAG(a, b, c, d)
Definition: common.h:406

Definition at line 70 of file xv.c.

Referenced by xv_get_tag_from_format().

const AVOption options[]
Initial value:
= {
{ "display_name", "set display name", OFFSET(display_name), AV_OPT_TYPE_STRING, {.str = NULL }, 0, 0, AV_OPT_FLAG_ENCODING_PARAM },
{ "window_id", "set existing window id", OFFSET(window_id), AV_OPT_TYPE_INT64, {.i64 = 0 }, 0, INT64_MAX, AV_OPT_FLAG_ENCODING_PARAM },
{ "window_size", "set window forced size", OFFSET(window_width), AV_OPT_TYPE_IMAGE_SIZE, {.str = NULL}, 0, 0, AV_OPT_FLAG_ENCODING_PARAM },
{ "window_title", "set window title", OFFSET(window_title), AV_OPT_TYPE_STRING, {.str = NULL }, 0, 0, AV_OPT_FLAG_ENCODING_PARAM },
{ "window_x", "set window x offset", OFFSET(window_x), AV_OPT_TYPE_INT, {.i64 = 0 }, -INT_MAX, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM },
{ "window_y", "set window y offset", OFFSET(window_y), AV_OPT_TYPE_INT, {.i64 = 0 }, -INT_MAX, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM },
{ NULL }
#define NULL
Definition: coverity.c:32
a generic parameter which can be set by the user for muxing or encoding
Definition: opt.h:278
static const char * window_title
Definition: ffplay.c:313
offset must point to two consecutive integers
Definition: opt.h:235
#define OFFSET(x)
Definition: xv.c:359

Definition at line 360 of file xv.c.

const AVClass xv_class
Initial value:
= {
.class_name = "xvideo outdev",
.item_name = av_default_item_name,
.option = options,
static const AVOption options[]
Definition: xv.c:360
Definition: version.h:85
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:235

Definition at line 371 of file xv.c.

AVOutputFormat ff_xv_muxer
Initial value:
= {
.name = "xv",
.long_name = NULL_IF_CONFIG_SMALL("XV (XVideo) output device"),
.priv_data_size = sizeof(XVContext),
.audio_codec = AV_CODEC_ID_NONE,
.write_uncoded_frame = xv_write_frame,
.control_message = xv_control_message,
.priv_class = &xv_class,
static void write_packet(OutputFile *of, AVPacket *pkt, OutputStream *ost, int unqueue)
Definition: ffmpeg.c:701
static int xv_write_header(AVFormatContext *s)
Definition: xv.c:103
static int xv_write_frame(AVFormatContext *s, int stream_index, AVFrame **frame, unsigned flags)
Definition: xv.c:339
static const AVClass xv_class
Definition: xv.c:371
static int xv_write_packet(AVFormatContext *s, AVPacket *pkt)
Definition: xv.c:322
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:153
static int write_trailer(AVFormatContext *s1)
Definition: v4l2enc.c:98
static int xv_write_trailer(AVFormatContext *s)
Definition: xv.c:88
Passthrough codec, AVFrames wrapped in AVPacket.
Definition: codec_id.h:560
Format does not need / have any timestamps.
Definition: avformat.h:462
Definition: xv.c:41
static int xv_control_message(AVFormatContext *s, int type, void *data, size_t data_size)
Definition: xv.c:348
#define flags(name, subs,...)
Definition: cbs_av1.c:560
Demuxer will use avio_open, no opened file should be provided by the caller.
Definition: avformat.h:458
Format allows variable fps.
Definition: avformat.h:465
static void write_header(FFV1Context *f)
Definition: ffv1enc.c:346

Definition at line 379 of file xv.c.