mirror of https://git.ffmpeg.org/ffmpeg.git
avfilter: hflip,swapuv,vflip: add timeline support
This commit is contained in:
parent
dc7e5adbc0
commit
88bcdf109a
|
@ -26,6 +26,7 @@
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
#include "libavutil/opt.h"
|
||||||
#include "avfilter.h"
|
#include "avfilter.h"
|
||||||
#include "formats.h"
|
#include "formats.h"
|
||||||
#include "internal.h"
|
#include "internal.h"
|
||||||
|
@ -36,11 +37,18 @@
|
||||||
#include "libavutil/imgutils.h"
|
#include "libavutil/imgutils.h"
|
||||||
|
|
||||||
typedef struct FlipContext {
|
typedef struct FlipContext {
|
||||||
|
const AVClass *class;
|
||||||
int max_step[4]; ///< max pixel step for each plane, expressed as a number of bytes
|
int max_step[4]; ///< max pixel step for each plane, expressed as a number of bytes
|
||||||
int planewidth[4]; ///< width of each plane
|
int planewidth[4]; ///< width of each plane
|
||||||
int planeheight[4]; ///< height of each plane
|
int planeheight[4]; ///< height of each plane
|
||||||
} FlipContext;
|
} FlipContext;
|
||||||
|
|
||||||
|
static const AVOption hflip_options[] = {
|
||||||
|
{ NULL }
|
||||||
|
};
|
||||||
|
|
||||||
|
AVFILTER_DEFINE_CLASS(hflip);
|
||||||
|
|
||||||
static int query_formats(AVFilterContext *ctx)
|
static int query_formats(AVFilterContext *ctx)
|
||||||
{
|
{
|
||||||
AVFilterFormats *pix_fmts = NULL;
|
AVFilterFormats *pix_fmts = NULL;
|
||||||
|
@ -194,8 +202,9 @@ AVFilter ff_vf_hflip = {
|
||||||
.name = "hflip",
|
.name = "hflip",
|
||||||
.description = NULL_IF_CONFIG_SMALL("Horizontally flip the input video."),
|
.description = NULL_IF_CONFIG_SMALL("Horizontally flip the input video."),
|
||||||
.priv_size = sizeof(FlipContext),
|
.priv_size = sizeof(FlipContext),
|
||||||
|
.priv_class = &hflip_class,
|
||||||
.query_formats = query_formats,
|
.query_formats = query_formats,
|
||||||
.inputs = avfilter_vf_hflip_inputs,
|
.inputs = avfilter_vf_hflip_inputs,
|
||||||
.outputs = avfilter_vf_hflip_outputs,
|
.outputs = avfilter_vf_hflip_outputs,
|
||||||
.flags = AVFILTER_FLAG_SLICE_THREADS,
|
.flags = AVFILTER_FLAG_SLICE_THREADS | AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC,
|
||||||
};
|
};
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
* swap UV filter
|
* swap UV filter
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "libavutil/opt.h"
|
||||||
#include "libavutil/pixdesc.h"
|
#include "libavutil/pixdesc.h"
|
||||||
#include "libavutil/version.h"
|
#include "libavutil/version.h"
|
||||||
#include "avfilter.h"
|
#include "avfilter.h"
|
||||||
|
@ -30,6 +31,16 @@
|
||||||
#include "internal.h"
|
#include "internal.h"
|
||||||
#include "video.h"
|
#include "video.h"
|
||||||
|
|
||||||
|
typedef struct SwapUVContext {
|
||||||
|
const AVClass *class;
|
||||||
|
} SwapUVContext;
|
||||||
|
|
||||||
|
static const AVOption swapuv_options[] = {
|
||||||
|
{ NULL }
|
||||||
|
};
|
||||||
|
|
||||||
|
AVFILTER_DEFINE_CLASS(swapuv);
|
||||||
|
|
||||||
static void do_swap(AVFrame *frame)
|
static void do_swap(AVFrame *frame)
|
||||||
{
|
{
|
||||||
FFSWAP(uint8_t*, frame->data[1], frame->data[2]);
|
FFSWAP(uint8_t*, frame->data[1], frame->data[2]);
|
||||||
|
@ -110,6 +121,9 @@ AVFilter ff_vf_swapuv = {
|
||||||
.name = "swapuv",
|
.name = "swapuv",
|
||||||
.description = NULL_IF_CONFIG_SMALL("Swap U and V components."),
|
.description = NULL_IF_CONFIG_SMALL("Swap U and V components."),
|
||||||
.query_formats = query_formats,
|
.query_formats = query_formats,
|
||||||
|
.priv_size = sizeof(SwapUVContext),
|
||||||
|
.priv_class = &swapuv_class,
|
||||||
.inputs = swapuv_inputs,
|
.inputs = swapuv_inputs,
|
||||||
.outputs = swapuv_outputs,
|
.outputs = swapuv_outputs,
|
||||||
|
.flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC,
|
||||||
};
|
};
|
||||||
|
|
|
@ -24,15 +24,23 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "libavutil/internal.h"
|
#include "libavutil/internal.h"
|
||||||
|
#include "libavutil/opt.h"
|
||||||
#include "libavutil/pixdesc.h"
|
#include "libavutil/pixdesc.h"
|
||||||
#include "avfilter.h"
|
#include "avfilter.h"
|
||||||
#include "internal.h"
|
#include "internal.h"
|
||||||
#include "video.h"
|
#include "video.h"
|
||||||
|
|
||||||
typedef struct FlipContext {
|
typedef struct FlipContext {
|
||||||
|
const AVClass *class;
|
||||||
int vsub; ///< vertical chroma subsampling
|
int vsub; ///< vertical chroma subsampling
|
||||||
} FlipContext;
|
} FlipContext;
|
||||||
|
|
||||||
|
static const AVOption vflip_options[] = {
|
||||||
|
{ NULL }
|
||||||
|
};
|
||||||
|
|
||||||
|
AVFILTER_DEFINE_CLASS(vflip);
|
||||||
|
|
||||||
static int config_input(AVFilterLink *link)
|
static int config_input(AVFilterLink *link)
|
||||||
{
|
{
|
||||||
FlipContext *flip = link->dst->priv;
|
FlipContext *flip = link->dst->priv;
|
||||||
|
@ -106,6 +114,8 @@ AVFilter ff_vf_vflip = {
|
||||||
.name = "vflip",
|
.name = "vflip",
|
||||||
.description = NULL_IF_CONFIG_SMALL("Flip the input video vertically."),
|
.description = NULL_IF_CONFIG_SMALL("Flip the input video vertically."),
|
||||||
.priv_size = sizeof(FlipContext),
|
.priv_size = sizeof(FlipContext),
|
||||||
|
.priv_class = &vflip_class,
|
||||||
.inputs = avfilter_vf_vflip_inputs,
|
.inputs = avfilter_vf_vflip_inputs,
|
||||||
.outputs = avfilter_vf_vflip_outputs,
|
.outputs = avfilter_vf_vflip_outputs,
|
||||||
|
.flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC,
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue