44 char *mapping, *saveptr =
NULL, *p;
48 for (p =
s->mapping; *p; p++) {
49 if (*p ==
'|' || *p ==
' ')
53 s->frames =
av_calloc(nb_items,
sizeof(*
s->frames));
56 if (!
s->map || !
s->frames || !
s->pts) {
64 for (n = 0; n < nb_items; n++) {
66 if (!
map || sscanf(
map,
"%d", &
s->map[n]) != 1) {
71 if (
s->map[n] < -1 ||
s->map[n] >= nb_items) {
78 s->nb_frames = nb_items;
89 if (
s->in_frames <
s->nb_frames) {
90 s->frames[
s->in_frames] =
frame;
95 if (
s->in_frames ==
s->nb_frames) {
98 for (n = 0; n <
s->nb_frames; n++) {
106 out->pts =
s->pts[n];
112 for (n = 0; n <
s->nb_frames; n++)
123 while (
s->in_frames > 0) {
133 #define OFFSET(x) offsetof(ShuffleFramesContext, x)
134 #define FLAGS (AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_VIDEO_PARAM)
160 .
name =
"shuffleframes",
163 .priv_class = &shuffleframes_class,
static const AVFilterPad inputs[]
static const AVFilterPad outputs[]
simple assert() macros that are a bit more flexible than ISO C assert().
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
Main libavfilter public API header.
#define flags(name, subs,...)
common internal and external API header
#define AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC
Some filters support a generic "enable" expression option that can be used to enable or disable a fil...
AVFrame * av_frame_clone(const AVFrame *src)
Create a new frame that references the same data as src.
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
char * av_strdup(const char *s)
Duplicate a string.
void * av_calloc(size_t nmemb, size_t size)
Non-inlined equivalent of av_mallocz_array().
char * av_strtok(char *s, const char *delim, char **saveptr)
Split the string into several tokens which can be accessed by successive calls to av_strtok().
const VDPAUPixFmtMap * map
common internal API header
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Describe the class of an AVClass context structure.
A link between two filters.
AVFilterContext * dst
dest filter
A filter pad used for either input or output.
const char * name
Pad name.
const char * name
Filter name.
This structure describes decoded (raw) audio or video data.
int64_t pts
Presentation timestamp in time_base units (time when frame should be shown to user).
AVFilter ff_vf_shuffleframes
static const AVFilterPad shuffleframes_outputs[]
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
AVFILTER_DEFINE_CLASS(shuffleframes)
static const AVOption shuffleframes_options[]
static av_cold int init(AVFilterContext *ctx)
static av_cold void uninit(AVFilterContext *ctx)
static const AVFilterPad shuffleframes_inputs[]