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;
91 s->pts[
s->in_frames] =
frame->pts;
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)
151 .p.name =
"shuffleframes",
153 .p.priv_class = &shuffleframes_class,
const FFFilter ff_vf_shuffleframes
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
Main libavfilter public API header.
common internal and external API header
static int filter_frame(DBEDecodeContext *s, AVFrame *frame)
int(* init)(AVBSFContext *ctx)
@ 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...
#define AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC
Some filters support a generic "enable" expression option that can be used to enable or disable a fil...
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
AVFrame * av_frame_clone(const AVFrame *src)
Create a new frame that references the same data as src.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
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
static av_cold void uninit(AVBitStreamFilterContext *ctx)
#define FILTER_INPUTS(array)
#define FILTER_OUTPUTS(array)
#define AVFILTER_DEFINE_CLASS(fname)
common internal API header
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
void * av_calloc(size_t nmemb, size_t size)
Memory handling functions.
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.
This structure describes decoded (raw) audio or video data.
static AVFormatContext * ctx
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
static const AVOption shuffleframes_options[]
static av_cold void uninit(AVFilterContext *ctx)
static const AVFilterPad shuffleframes_inputs[]
const AVFilterPad ff_video_default_filterpad[1]
An AVFilterPad array whose only entry has name "default" and is of type AVMEDIA_TYPE_VIDEO.