63 if (strlen(cfg) > 0) {
64 color_printf(
TRED(
TBOLD(
"mirror"))
" capture filter flips the video horizontally (across vertical axis), takes no arguments\n");
65 return strcmp(cfg,
"help") == 0 ? 1 : -1;
76static void mirror_line_UYVY(
unsigned char *dst,
const unsigned char *src,
int linesize)
79 while (linesize > 3) {
80 unsigned char u, y1, v, y2;
113 unsigned char *in_data = (
unsigned char *) in->
tiles[0].
data;
114 unsigned char *out_data = (
unsigned char *) out->
tiles[0].
data;
117 for (
unsigned int y = 0; y < in->
tiles[0].
height; ++y) {
118 mirror_line_UYVY(out_data + y * linesize, in_data + y * linesize, linesize);
void vf_free(struct video_frame *buf)
Frees video_frame structure.
struct video_desc video_desc_from_frame(const struct video_frame *frame)
Returns struct video_desc from video frame.
void vf_data_deleter(struct video_frame *buf)
int vc_get_linesize(unsigned int width, codec_t codec)
struct video_frame * vf_alloc_desc(struct video_desc desc)
Allocates video frame accordig given desc.
#define CAPTURE_FILTER_ABI_VERSION
#define ADD_VO_PP_CAPTURE_FILTER_WRAPPER(name, init, filter, done, set_out_buf, get_prop_callb)
int color_printf(const char *format,...)
void log_msg(int level, const char *format,...)
#define LOG_LEVEL_WARNING
less severe errors
@ LIBRARY_CLASS_CAPTURE_FILTER
#define REGISTER_MODULE(name, info, lclass, abi)
Registers module to global modules' registry.
static struct video_frame * filter(void *state, struct video_frame *in)
static void vo_pp_set_out_buffer(void *state, char *buffer)
static void mirror_line_UYVY(unsigned char *dst, const unsigned char *src, int linesize)
static const struct capture_filter_info capture_filter_mirror
static void done(void *state)
static int init(struct module *parent, const char *cfg, void **state)
char * vo_pp_out_buffer
buffer to write to if we use vo_pp wrapper (otherwise unused)
char * data
Raw tile data. Pointer must be at least 4B aligned.
unsigned int data_len
length of the data
void(* data_deleter)(struct video_frame *)
void(* dispose)(struct video_frame *)
Struct video_frame represents a video frame and contains video description.
struct tile tiles[FLEXIBLE_ARRAY_MEMBER]
struct video_frame_callbacks callbacks
@ UYVY
YCbCr 422 8-bit - Cb Y0 Cr Y1.
This is an umbrella header for video functions.
#define VIDEO_FRAME_DISPOSE(frame)