From d4bdd0473d6f43132257c9fb3848d829755167a3 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 5 Nov 2012 17:02:04 +0100 Subject: Rename directories, move files (step 1 of 2) (does not compile) Tis drops the silly lib prefixes, and attempts to organize the tree in a more logical way. Make the top-level directory less cluttered as well. Renames the following directories: libaf -> audio/filter libao2 -> audio/out libvo -> video/out libmpdemux -> demux Split libmpcodecs: vf* -> video/filter vd*, dec_video.* -> video/decode mp_image*, img_format*, ... -> video/ ad*, dec_audio.* -> audio/decode libaf/format.* is moved to audio/ - this is similar to how mp_image.* is located in video/. Move most top-level .c/.h files to core. (talloc.c/.h is left on top- level, because it's external.) Park some of the more annoying files in compat/. Some of these are relicts from the time mplayer used ffmpeg internals. sub/ is not split, because it's too much of a mess (subtitle code is mixed with OSD display and rendering). Maybe the organization of core is not ideal: it mixes playback core (like mplayer.c) and utility helpers (like bstr.c/h). Should the need arise, the playback core will be moved somewhere else, while core contains all helper and common code. --- video/filter/vf_dlopen.h | 88 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 video/filter/vf_dlopen.h (limited to 'video/filter/vf_dlopen.h') diff --git a/video/filter/vf_dlopen.h b/video/filter/vf_dlopen.h new file mode 100644 index 0000000000..962605ca28 --- /dev/null +++ b/video/filter/vf_dlopen.h @@ -0,0 +1,88 @@ +#ifndef VF_DLOPEN_H +#define VF_DLOPEN_H + +// when doing a two-way compatible change, don't change these +// when doing a backwards compatible change, bump minor version +// when doing an incompatible change, bump major version and zero minor version +#define VF_DLOPEN_MAJOR_VERSION 1 +#define VF_DLOPEN_MINOR_VERSION 0 + +#if VF_DLOPEN_MINOR_VERSION > 0 +# define VF_DLOPEN_CHECK_VERSION(ctx) \ + do { \ + if (ctx->major_version != VF_DLOPEN_MAJOR_VERSION || \ + ctx->minor_version < VF_DLOPEN_MINOR_VERSION) \ + return -1; \ + } while (0) +#else +// workaround for "comparison is always false" warning +# define VF_DLOPEN_CHECK_VERSION(ctx) \ + do { \ + if (ctx->major_version != VF_DLOPEN_MAJOR_VERSION) \ + return -1; \ + } while (0) +#endif + +// valid pixel format names: +// "yv12": planar YUV, U and V planes have an xshift and yshift of 1 +// "rgb24": packed RGB24 +struct vf_dlopen_formatpair { + const char *from; // (LATER) can also be a name of a format class + const char *to; // if NULL, this means identical format as source +}; + +#define FILTER_MAX_OUTCNT 16 + +struct vf_dlopen_picdata { + unsigned int planes; + unsigned char *plane[4]; + signed int planestride[4]; + unsigned int planewidth[4]; + unsigned int planeheight[4]; + unsigned int planexshift[4]; + unsigned int planeyshift[4]; + double pts; +}; + +struct vf_dlopen_context { + unsigned short major_version; + unsigned short minor_version; + + void *priv; + + struct vf_dlopen_formatpair *format_mapping; + // {NULL, NULL} terminated list of supported format pairs + // if NULL, anything goes + + int (*config)(struct vf_dlopen_context *ctx); // -1 = error + // image config is put into the in_* members before calling this + // fills in the out_* members (which are preinitialized for an identity vf_dlopen_context) + + int (*put_image)(struct vf_dlopen_context *ctx); // returns number of images written, or negative on error + // before this is called, inpic_* and outpic_* are filled + + void (*uninit)(struct vf_dlopen_context *ctx); + + unsigned int in_width; + unsigned int in_height; + unsigned int in_d_width; + unsigned int in_d_height; + const char *in_fmt; + unsigned int out_width; + unsigned int out_height; + unsigned int out_d_width; + unsigned int out_d_height; + const char *out_fmt; + unsigned int out_cnt; + + struct vf_dlopen_picdata inpic; + char *inpic_qscale; + unsigned int inpic_qscalestride; + unsigned int inpic_qscaleshift; + + struct vf_dlopen_picdata outpic[FILTER_MAX_OUTCNT]; +}; +typedef int (vf_dlopen_getcontext_func)(struct vf_dlopen_context *ctx, int argc, const char **argv); // negative on error +vf_dlopen_getcontext_func vf_dlopen_getcontext; + +#endif -- cgit v1.2.3