FFmpeg
Data Structures | Macros | Functions | Variables
xv.c File Reference
#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/frame.h"
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "libavutil/imgutils.h"
#include "libavformat/mux.h"
#include "avdevice.h"

Go to the source code of this file.

Data Structures

struct  XVContext
 
struct  XVTagFormatMap
 

Macros

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

Functions

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)
 

Variables

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

Detailed Description

XVideo output device

TODO:

Definition in file xv.c.

Macro Definition Documentation

◆ OFFSET

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

Definition at line 361 of file xv.c.

Function Documentation

◆ xv_get_tag_from_format()

static int xv_get_tag_from_format ( enum AVPixelFormat  format)
static

Definition at line 79 of file xv.c.

Referenced by xv_write_header().

◆ xv_write_trailer()

static int xv_write_trailer ( AVFormatContext s)
static

Definition at line 90 of file xv.c.

Referenced by xv_write_header().

◆ xv_write_header()

static int xv_write_header ( AVFormatContext s)
static

Definition at line 105 of file xv.c.

◆ compute_display_area()

static void compute_display_area ( AVFormatContext s)
static

Definition at line 228 of file xv.c.

Referenced by xv_repaint().

◆ xv_repaint()

static int xv_repaint ( AVFormatContext s)
static

Definition at line 258 of file xv.c.

Referenced by write_picture(), and xv_control_message().

◆ write_picture()

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

Definition at line 296 of file xv.c.

Referenced by xv_write_frame(), and xv_write_packet().

◆ xv_write_packet()

static int xv_write_packet ( AVFormatContext s,
AVPacket pkt 
)
static

Definition at line 324 of file xv.c.

◆ xv_write_frame()

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

Definition at line 341 of file xv.c.

◆ xv_control_message()

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

Definition at line 350 of file xv.c.

Variable Documentation

◆ tag_codec_map

const XVTagFormatMap tag_codec_map[]
static
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 },
}

Definition at line 72 of file xv.c.

Referenced by xv_get_tag_from_format().

◆ options

const AVOption options[]
static
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 }
}

Definition at line 362 of file xv.c.

◆ xv_class

const AVClass xv_class
static
Initial value:
= {
.class_name = "xvideo outdev",
.item_name = av_default_item_name,
.option = options,
}

Definition at line 373 of file xv.c.

◆ ff_xv_muxer

const FFOutputFormat ff_xv_muxer
Initial value:
= {
.p.name = "xv",
.p.long_name = NULL_IF_CONFIG_SMALL("XV (XVideo) output device"),
.p.audio_codec = AV_CODEC_ID_NONE,
.p.video_codec = AV_CODEC_ID_WRAPPED_AVFRAME,
.p.priv_class = &xv_class,
.priv_data_size = sizeof(XVContext),
.write_uncoded_frame = xv_write_frame,
.control_message = xv_control_message,
}

Definition at line 381 of file xv.c.

AVFMT_VARIABLE_FPS
#define AVFMT_VARIABLE_FPS
Format allows variable fps.
Definition: avformat.h:482
AVFMT_NOTIMESTAMPS
#define AVFMT_NOTIMESTAMPS
Format does not need / have any timestamps.
Definition: avformat.h:479
xv_control_message
static int xv_control_message(AVFormatContext *s, int type, void *data, size_t data_size)
Definition: xv.c:350
options
static const AVOption options[]
Definition: xv.c:362
xv_write_packet
static int xv_write_packet(AVFormatContext *s, AVPacket *pkt)
Definition: xv.c:324
AV_OPT_TYPE_INT64
@ AV_OPT_TYPE_INT64
Underlying C type is int64_t.
Definition: opt.h:263
AV_PIX_FMT_YUV420P
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:73
AV_CODEC_ID_WRAPPED_AVFRAME
@ AV_CODEC_ID_WRAPPED_AVFRAME
Passthrough codec, AVFrames wrapped in AVPacket.
Definition: codec_id.h:608
window_title
static const char * window_title
Definition: ffplay.c:307
xv_write_frame
static int xv_write_frame(AVFormatContext *s, int stream_index, AVFrame **frame, unsigned flags)
Definition: xv.c:341
LIBAVUTIL_VERSION_INT
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
NULL
#define NULL
Definition: coverity.c:32
write_trailer
static int write_trailer(AVFormatContext *s1)
Definition: v4l2enc.c:101
AV_PIX_FMT_YUYV422
@ AV_PIX_FMT_YUYV422
packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr
Definition: pixfmt.h:74
AV_OPT_TYPE_IMAGE_SIZE
@ AV_OPT_TYPE_IMAGE_SIZE
Underlying C type is two consecutive integers.
Definition: opt.h:303
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:237
AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT
@ AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT
Definition: log.h:40
AV_OPT_FLAG_ENCODING_PARAM
#define AV_OPT_FLAG_ENCODING_PARAM
A generic parameter which can be set by the user for muxing or encoding.
Definition: opt.h:352
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:94
AVFMT_NOFILE
#define AVFMT_NOFILE
Demuxer will use avio_open, no opened file should be provided by the caller.
Definition: avformat.h:468
xv_write_trailer
static int xv_write_trailer(AVFormatContext *s)
Definition: xv.c:90
AV_CODEC_ID_NONE
@ AV_CODEC_ID_NONE
Definition: codec_id.h:50
XVContext
Definition: xv.c:43
write_packet
static int write_packet(Muxer *mux, OutputStream *ost, AVPacket *pkt)
Definition: ffmpeg_mux.c:209
xv_class
static const AVClass xv_class
Definition: xv.c:373
AV_PIX_FMT_UYVY422
@ AV_PIX_FMT_UYVY422
packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
Definition: pixfmt.h:88
AV_PIX_FMT_NONE
@ AV_PIX_FMT_NONE
Definition: pixfmt.h:72
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition: opt.h:259
MKTAG
#define MKTAG(a, b, c, d)
Definition: macros.h:55
AV_OPT_TYPE_STRING
@ AV_OPT_TYPE_STRING
Underlying C type is a uint8_t* that is either NULL or points to a C string allocated with the av_mal...
Definition: opt.h:276
write_header
static void write_header(FFV1Context *f)
Definition: ffv1enc.c:348
xv_write_header
static int xv_write_header(AVFormatContext *s)
Definition: xv.c:105
OFFSET
#define OFFSET(x)
Definition: xv.c:361