Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
c9e183b4
Commit
c9e183b4
authored
Jun 16, 2012
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavfi: update some deprecated functions
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
0354412a
Show whitespace changes
Inline
Side-by-side
Showing
34 changed files
with
145 additions
and
125 deletions
+145
-125
af_aconvert.c
libavfilter/af_aconvert.c
+4
-4
af_amerge.c
libavfilter/af_amerge.c
+3
-3
af_aresample.c
libavfilter/af_aresample.c
+7
-7
af_astreamsync.c
libavfilter/af_astreamsync.c
+4
-4
af_earwax.c
libavfilter/af_earwax.c
+3
-3
af_pan.c
libavfilter/af_pan.c
+1
-1
af_silencedetect.c
libavfilter/af_silencedetect.c
+2
-2
af_volume.c
libavfilter/af_volume.c
+2
-2
asrc_aevalsrc.c
libavfilter/asrc_aevalsrc.c
+2
-2
avfiltergraph.c
libavfilter/avfiltergraph.c
+5
-5
defaults.c
libavfilter/defaults.c
+2
-4
drawutils.c
libavfilter/drawutils.c
+2
-1
formats.c
libavfilter/formats.c
+1
-1
sink_buffer.c
libavfilter/sink_buffer.c
+5
-5
src_movie.c
libavfilter/src_movie.c
+2
-2
vf_bbox.c
libavfilter/vf_bbox.c
+3
-3
vf_blackdetect.c
libavfilter/vf_blackdetect.c
+4
-4
vf_colormatrix.c
libavfilter/vf_colormatrix.c
+7
-5
vf_deshake.c
libavfilter/vf_deshake.c
+5
-3
vf_hflip.c
libavfilter/vf_hflip.c
+2
-2
vf_idet.c
libavfilter/vf_idet.c
+7
-6
vf_removelogo.c
libavfilter/vf_removelogo.c
+8
-6
vf_select.c
libavfilter/vf_select.c
+1
-1
vf_setfield.c
libavfilter/vf_setfield.c
+3
-2
vf_super2xsai.c
libavfilter/vf_super2xsai.c
+5
-3
vf_swapuv.c
libavfilter/vf_swapuv.c
+5
-3
vf_thumbnail.c
libavfilter/vf_thumbnail.c
+7
-6
vf_tile.c
libavfilter/vf_tile.c
+1
-1
vf_tinterlace.c
libavfilter/vf_tinterlace.c
+13
-13
video.c
libavfilter/video.c
+1
-1
vsrc_cellauto.c
libavfilter/vsrc_cellauto.c
+7
-5
vsrc_life.c
libavfilter/vsrc_life.c
+7
-5
vsrc_mandelbrot.c
libavfilter/vsrc_mandelbrot.c
+7
-5
vsrc_mptestsrc.c
libavfilter/vsrc_mptestsrc.c
+7
-5
No files found.
libavfilter/af_aconvert.c
View file @
c9e183b4
...
...
@@ -75,14 +75,14 @@ static int query_formats(AVFilterContext *ctx)
AVFilterLink
*
outlink
=
ctx
->
outputs
[
0
];
AVFilterChannelLayouts
*
layouts
;
avfilter
_formats_ref
(
avfilter_make_all_formats
(
AVMEDIA_TYPE_AUDIO
),
ff
_formats_ref
(
avfilter_make_all_formats
(
AVMEDIA_TYPE_AUDIO
),
&
inlink
->
out_formats
);
if
(
aconvert
->
out_sample_fmt
!=
AV_SAMPLE_FMT_NONE
)
{
formats
=
NULL
;
avfilter
_add_format
(
&
formats
,
aconvert
->
out_sample_fmt
);
avfilter
_formats_ref
(
formats
,
&
outlink
->
in_formats
);
ff
_add_format
(
&
formats
,
aconvert
->
out_sample_fmt
);
ff
_formats_ref
(
formats
,
&
outlink
->
in_formats
);
}
else
avfilter
_formats_ref
(
avfilter_make_all_formats
(
AVMEDIA_TYPE_AUDIO
),
ff
_formats_ref
(
avfilter_make_all_formats
(
AVMEDIA_TYPE_AUDIO
),
&
outlink
->
in_formats
);
ff_channel_layouts_ref
(
ff_all_channel_layouts
(),
...
...
libavfilter/af_amerge.c
View file @
c9e183b4
...
...
@@ -119,8 +119,8 @@ static int query_formats(AVFilterContext *ctx)
if
((
inlayout
[
i
]
>>
c
)
&
1
)
*
(
route
[
i
]
++
)
=
out_ch_number
++
;
}
formats
=
avfilter
_make_format_list
(
ff_packed_sample_fmts_array
);
avfilter_set_common_sample
_formats
(
ctx
,
formats
);
formats
=
ff
_make_format_list
(
ff_packed_sample_fmts_array
);
ff_set_common
_formats
(
ctx
,
formats
);
for
(
i
=
0
;
i
<
am
->
nb_inputs
;
i
++
)
{
layouts
=
NULL
;
ff_add_channel_layout
(
&
layouts
,
inlayout
[
i
]);
...
...
@@ -315,7 +315,7 @@ static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
.
min_perms
=
AV_PERM_READ
|
AV_PERM_PRESERVE
,
};
snprintf
(
name
,
sizeof
(
name
),
"in%d"
,
i
);
avfilter
_insert_inpad
(
ctx
,
i
,
&
pad
);
ff
_insert_inpad
(
ctx
,
i
,
&
pad
);
}
return
0
;
}
...
...
libavfilter/af_aresample.c
View file @
c9e183b4
...
...
@@ -91,29 +91,29 @@ static int query_formats(AVFilterContext *ctx)
AVFilterLink
*
inlink
=
ctx
->
inputs
[
0
];
AVFilterLink
*
outlink
=
ctx
->
outputs
[
0
];
AVFilterFormats
*
in_formats
=
avfilter
_all_formats
(
AVMEDIA_TYPE_AUDIO
);
AVFilterFormats
*
in_formats
=
ff
_all_formats
(
AVMEDIA_TYPE_AUDIO
);
AVFilterFormats
*
out_formats
;
AVFilterFormats
*
in_samplerates
=
ff_all_samplerates
();
AVFilterFormats
*
out_samplerates
;
AVFilterChannelLayouts
*
in_layouts
=
ff_all_channel_layouts
();
AVFilterChannelLayouts
*
out_layouts
;
avfilter
_formats_ref
(
in_formats
,
&
inlink
->
out_formats
);
avfilter
_formats_ref
(
in_samplerates
,
&
inlink
->
out_samplerates
);
ff
_formats_ref
(
in_formats
,
&
inlink
->
out_formats
);
ff
_formats_ref
(
in_samplerates
,
&
inlink
->
out_samplerates
);
ff_channel_layouts_ref
(
in_layouts
,
&
inlink
->
out_channel_layouts
);
if
(
out_rate
>
0
)
{
out_samplerates
=
avfilter
_make_format_list
((
int
[]){
out_rate
,
-
1
});
out_samplerates
=
ff
_make_format_list
((
int
[]){
out_rate
,
-
1
});
}
else
{
out_samplerates
=
ff_all_samplerates
();
}
avfilter
_formats_ref
(
out_samplerates
,
&
outlink
->
in_samplerates
);
ff
_formats_ref
(
out_samplerates
,
&
outlink
->
in_samplerates
);
if
(
out_format
!=
AV_SAMPLE_FMT_NONE
)
{
out_formats
=
avfilter
_make_format_list
((
int
[]){
out_format
,
-
1
});
out_formats
=
ff
_make_format_list
((
int
[]){
out_format
,
-
1
});
}
else
out_formats
=
avfilter_make_all_formats
(
AVMEDIA_TYPE_AUDIO
);
avfilter
_formats_ref
(
out_formats
,
&
outlink
->
in_formats
);
ff
_formats_ref
(
out_formats
,
&
outlink
->
in_formats
);
if
(
out_layout
)
{
out_layouts
=
avfilter_make_format64_list
((
int64_t
[]){
out_layout
,
-
1
});
...
...
libavfilter/af_astreamsync.c
View file @
c9e183b4
...
...
@@ -85,11 +85,11 @@ static int query_formats(AVFilterContext *ctx)
for
(
i
=
0
;
i
<
2
;
i
++
)
{
formats
=
ctx
->
inputs
[
i
]
->
in_formats
;
avfilter
_formats_ref
(
formats
,
&
ctx
->
inputs
[
i
]
->
out_formats
);
avfilter
_formats_ref
(
formats
,
&
ctx
->
outputs
[
i
]
->
in_formats
);
ff
_formats_ref
(
formats
,
&
ctx
->
inputs
[
i
]
->
out_formats
);
ff
_formats_ref
(
formats
,
&
ctx
->
outputs
[
i
]
->
in_formats
);
rates
=
ff_all_samplerates
();
avfilter
_formats_ref
(
rates
,
&
ctx
->
inputs
[
i
]
->
out_samplerates
);
avfilter
_formats_ref
(
rates
,
&
ctx
->
outputs
[
i
]
->
in_samplerates
);
ff
_formats_ref
(
rates
,
&
ctx
->
inputs
[
i
]
->
out_samplerates
);
ff
_formats_ref
(
rates
,
&
ctx
->
outputs
[
i
]
->
in_samplerates
);
layouts
=
ctx
->
inputs
[
i
]
->
in_channel_layouts
;
ff_channel_layouts_ref
(
layouts
,
&
ctx
->
inputs
[
i
]
->
out_channel_layouts
);
ff_channel_layouts_ref
(
layouts
,
&
ctx
->
outputs
[
i
]
->
in_channel_layouts
);
...
...
libavfilter/af_earwax.c
View file @
c9e183b4
...
...
@@ -82,11 +82,11 @@ static int query_formats(AVFilterContext *ctx)
AVFilterFormats
*
formats
=
NULL
;
AVFilterChannelLayouts
*
layout
=
NULL
;
avfilter
_add_format
(
&
formats
,
AV_SAMPLE_FMT_S16
);
avfilter_set_common_sample
_formats
(
ctx
,
formats
);
ff
_add_format
(
&
formats
,
AV_SAMPLE_FMT_S16
);
ff_set_common
_formats
(
ctx
,
formats
);
ff_add_channel_layout
(
&
layout
,
AV_CH_LAYOUT_STEREO
);
ff_set_common_channel_layouts
(
ctx
,
layout
);
ff_set_common_samplerates
(
ctx
,
avfilter
_make_format_list
(
sample_rates
));
ff_set_common_samplerates
(
ctx
,
ff
_make_format_list
(
sample_rates
));
return
0
;
}
...
...
libavfilter/af_pan.c
View file @
c9e183b4
...
...
@@ -217,7 +217,7 @@ static int query_formats(AVFilterContext *ctx)
pan
->
pure_gains
=
are_gains_pure
(
pan
);
/* libswr supports any sample and packing formats */
avfilter_set_common_sample
_formats
(
ctx
,
avfilter_make_all_formats
(
AVMEDIA_TYPE_AUDIO
));
ff_set_common
_formats
(
ctx
,
avfilter_make_all_formats
(
AVMEDIA_TYPE_AUDIO
));
formats
=
ff_all_samplerates
();
if
(
!
formats
)
...
...
libavfilter/af_silencedetect.c
View file @
c9e183b4
...
...
@@ -137,10 +137,10 @@ static int query_formats(AVFilterContext *ctx)
return
AVERROR
(
ENOMEM
);
ff_set_common_channel_layouts
(
ctx
,
layouts
);
formats
=
avfilter
_make_format_list
(
sample_fmts
);
formats
=
ff
_make_format_list
(
sample_fmts
);
if
(
!
formats
)
return
AVERROR
(
ENOMEM
);
avfilter_set_common_sample
_formats
(
ctx
,
formats
);
ff_set_common
_formats
(
ctx
,
formats
);
formats
=
ff_all_samplerates
();
if
(
!
formats
)
...
...
libavfilter/af_volume.c
View file @
c9e183b4
...
...
@@ -97,10 +97,10 @@ static int query_formats(AVFilterContext *ctx)
return
AVERROR
(
ENOMEM
);
ff_set_common_channel_layouts
(
ctx
,
layouts
);
formats
=
avfilter
_make_format_list
(
sample_fmts
);
formats
=
ff
_make_format_list
(
sample_fmts
);
if
(
!
formats
)
return
AVERROR
(
ENOMEM
);
avfilter_set_common_sample
_formats
(
ctx
,
formats
);
ff_set_common
_formats
(
ctx
,
formats
);
formats
=
ff_all_samplerates
();
if
(
!
formats
)
...
...
libavfilter/asrc_aevalsrc.c
View file @
c9e183b4
...
...
@@ -199,9 +199,9 @@ static int query_formats(AVFilterContext *ctx)
int64_t
chlayouts
[]
=
{
eval
->
chlayout
,
-
1
};
int
sample_rates
[]
=
{
eval
->
sample_rate
,
-
1
};
avfilter_set_common_sample_formats
(
ctx
,
avfilter
_make_format_list
(
sample_fmts
));
ff_set_common_formats
(
ctx
,
ff
_make_format_list
(
sample_fmts
));
ff_set_common_channel_layouts
(
ctx
,
avfilter_make_format64_list
(
chlayouts
));
ff_set_common_samplerates
(
ctx
,
avfilter
_make_format_list
(
sample_rates
));
ff_set_common_samplerates
(
ctx
,
ff
_make_format_list
(
sample_rates
));
return
0
;
}
...
...
libavfilter/avfiltergraph.c
View file @
c9e183b4
...
...
@@ -189,7 +189,7 @@ static int filter_query_formats(AVFilterContext *ctx)
formats
=
avfilter_make_all_formats
(
type
);
if
(
!
formats
)
return
AVERROR
(
ENOMEM
);
avfilter
_set_common_formats
(
ctx
,
formats
);
ff
_set_common_formats
(
ctx
,
formats
);
if
(
type
==
AVMEDIA_TYPE_AUDIO
)
{
samplerates
=
ff_all_samplerates
();
if
(
!
samplerates
)
...
...
@@ -231,9 +231,9 @@ static int insert_conv_filter(AVFilterGraph *graph, AVFilterLink *link,
filter_query_formats
(
filt_ctx
);
if
(
((
link
=
filt_ctx
->
inputs
[
0
])
&&
!
avfilter
_merge_formats
(
link
->
in_formats
,
link
->
out_formats
))
||
!
ff
_merge_formats
(
link
->
in_formats
,
link
->
out_formats
))
||
((
link
=
filt_ctx
->
outputs
[
0
])
&&
!
avfilter
_merge_formats
(
link
->
in_formats
,
link
->
out_formats
))
!
ff
_merge_formats
(
link
->
in_formats
,
link
->
out_formats
))
)
{
av_log
(
NULL
,
AV_LOG_ERROR
,
"Impossible to convert between the formats supported by the filter "
...
...
@@ -295,7 +295,7 @@ static int query_formats(AVFilterGraph *graph, AVClass *log_ctx)
return AVERROR(EINVAL);
if (link->type == AVMEDIA_TYPE_VIDEO &&
!
avfilter
_merge_formats(link->in_formats, link->out_formats)) {
!
ff
_merge_formats(link->in_formats, link->out_formats)) {
/* couldn't merge format lists, auto-insert scale filter */
snprintf(filt_args, sizeof(filt_args), "0:0:%s",
...
...
@@ -310,7 +310,7 @@ static int query_formats(AVFilterGraph *graph, AVClass *log_ctx)
/* Merge all three list before checking: that way, in all
* three categories, aconvert will use a common format
* whenever possible. */
formats
= avfilter
_merge_formats(link->in_formats, link->out_formats);
formats
= ff
_merge_formats(link->in_formats, link->out_formats);
chlayouts = ff_merge_channel_layouts(link->in_channel_layouts , link->out_channel_layouts);
samplerates = ff_merge_samplerates (link->in_samplerates, link->out_samplerates);
...
...
libavfilter/defaults.c
View file @
c9e183b4
...
...
@@ -34,13 +34,11 @@ static void set_common_formats(AVFilterContext *ctx, AVFilterFormats *fmts,
int
i
;
for
(
i
=
0
;
i
<
ctx
->
input_count
;
i
++
)
if
(
ctx
->
inputs
[
i
]
&&
ctx
->
inputs
[
i
]
->
type
==
type
)
avfilter_formats_ref
(
fmts
,
(
AVFilterFormats
**
)((
uint8_t
*
)
ctx
->
inputs
[
i
]
+
offout
));
ff_formats_ref
(
fmts
,
(
AVFilterFormats
**
)((
uint8_t
*
)
ctx
->
inputs
[
i
]
+
offout
));
for
(
i
=
0
;
i
<
ctx
->
output_count
;
i
++
)
if
(
ctx
->
outputs
[
i
]
&&
ctx
->
outputs
[
i
]
->
type
==
type
)
avfilter_formats_ref
(
fmts
,
(
AVFilterFormats
**
)((
uint8_t
*
)
ctx
->
outputs
[
i
]
+
offin
));
ff_formats_ref
(
fmts
,
(
AVFilterFormats
**
)((
uint8_t
*
)
ctx
->
outputs
[
i
]
+
offin
));
if
(
!
fmts
->
refcount
)
{
av_free
(
fmts
->
formats
);
...
...
libavfilter/drawutils.c
View file @
c9e183b4
...
...
@@ -23,6 +23,7 @@
#include "libavutil/colorspace.h"
#include "libavutil/pixdesc.h"
#include "drawutils.h"
#include "formats.h"
enum
{
RED
=
0
,
GREEN
,
BLUE
,
ALPHA
};
...
...
@@ -505,7 +506,7 @@ AVFilterFormats *ff_draw_supported_pixel_formats(unsigned flags)
if
(
ff_draw_init
(
&
draw
,
i
,
flags
)
>=
0
)
pix_fmts
[
n
++
]
=
i
;
pix_fmts
[
n
++
]
=
PIX_FMT_NONE
;
return
avfilter
_make_format_list
(
pix_fmts
);
return
ff
_make_format_list
(
pix_fmts
);
}
#ifdef TEST
...
...
libavfilter/formats.c
View file @
c9e183b4
...
...
@@ -299,7 +299,7 @@ AVFilterFormats *avfilter_make_all_packing_formats(void)
-
1
,
};
return
avfilter
_make_format_list
(
packing
);
return
ff
_make_format_list
(
packing
);
}
#endif
...
...
libavfilter/sink_buffer.c
View file @
c9e183b4
...
...
@@ -152,7 +152,7 @@ int av_buffersink_poll_frame(AVFilterContext *ctx)
BufferSinkContext
*
buf
=
ctx
->
priv
;
AVFilterLink
*
inlink
=
ctx
->
inputs
[
0
];
return
av_fifo_size
(
buf
->
fifo
)
/
sizeof
(
AVFilterBufferRef
*
)
+
avfilter
_poll_frame
(
inlink
);
return
av_fifo_size
(
buf
->
fifo
)
/
sizeof
(
AVFilterBufferRef
*
)
+
ff
_poll_frame
(
inlink
);
}
#if FF_API_OLD_VSINK_API
...
...
@@ -201,9 +201,9 @@ static int vsink_query_formats(AVFilterContext *ctx)
BufferSinkContext
*
buf
=
ctx
->
priv
;
if
(
buf
->
pixel_fmts
)
avfilter_set_common_pixel_formats
(
ctx
,
avfilter
_make_format_list
(
buf
->
pixel_fmts
));
ff_set_common_formats
(
ctx
,
ff
_make_format_list
(
buf
->
pixel_fmts
));
else
avfilter
_default_query_formats
(
ctx
);
ff
_default_query_formats
(
ctx
);
return
0
;
}
...
...
@@ -272,9 +272,9 @@ static int asink_query_formats(AVFilterContext *ctx)
AVFilterFormats
*
formats
=
NULL
;
AVFilterChannelLayouts
*
layouts
=
NULL
;
if
(
!
(
formats
=
avfilter
_make_format_list
(
buf
->
sample_fmts
)))
if
(
!
(
formats
=
ff
_make_format_list
(
buf
->
sample_fmts
)))
return
AVERROR
(
ENOMEM
);
avfilter_set_common_sample
_formats
(
ctx
,
formats
);
ff_set_common
_formats
(
ctx
,
formats
);
if
(
!
(
layouts
=
avfilter_make_format64_list
(
buf
->
channel_layouts
)))
return
AVERROR
(
ENOMEM
);
...
...
libavfilter/src_movie.c
View file @
c9e183b4
...
...
@@ -371,8 +371,8 @@ static int amovie_query_formats(AVFilterContext *ctx)
int64_t
chlayouts
[]
=
{
c
->
channel_layout
?
c
->
channel_layout
:
av_get_default_channel_layout
(
c
->
channels
),
-
1
};
avfilter_set_common_sample_formats
(
ctx
,
avfilter
_make_format_list
(
sample_fmts
));
ff_set_common_samplerates
(
ctx
,
avfilter
_make_format_list
(
sample_rates
));
ff_set_common_formats
(
ctx
,
ff
_make_format_list
(
sample_fmts
));
ff_set_common_samplerates
(
ctx
,
ff
_make_format_list
(
sample_rates
));
ff_set_common_channel_layouts
(
ctx
,
avfilter_make_format64_list
(
chlayouts
));
return
0
;
...
...
libavfilter/vf_bbox.c
View file @
c9e183b4
...
...
@@ -52,7 +52,7 @@ static int query_formats(AVFilterContext *ctx)
PIX_FMT_NONE
,
};
avfilter_set_common_pixel_formats
(
ctx
,
avfilter
_make_format_list
(
pix_fmts
));
ff_set_common_formats
(
ctx
,
ff
_make_format_list
(
pix_fmts
));
return
0
;
}
...
...
@@ -87,7 +87,7 @@ static void end_frame(AVFilterLink *inlink)
bbox
->
frame
++
;
avfilter_unref_buffer
(
picref
);
avfilter
_end_frame
(
inlink
->
dst
->
outputs
[
0
]);
ff
_end_frame
(
inlink
->
dst
->
outputs
[
0
]);
}
AVFilter
avfilter_vf_bbox
=
{
...
...
@@ -100,7 +100,7 @@ AVFilter avfilter_vf_bbox = {
.
inputs
=
(
const
AVFilterPad
[])
{
{
.
name
=
"default"
,
.
type
=
AVMEDIA_TYPE_VIDEO
,
.
get_video_buffer
=
avfilter
_null_get_video_buffer
,
.
get_video_buffer
=
ff
_null_get_video_buffer
,
.
start_frame
=
ff_null_start_frame_keep_ref
,
.
end_frame
=
end_frame
,
.
min_perms
=
AV_PERM_READ
,
},
...
...
libavfilter/vf_blackdetect.c
View file @
c9e183b4
...
...
@@ -79,7 +79,7 @@ static int query_formats(AVFilterContext *ctx)
PIX_FMT_NONE
};
avfilter_set_common_pixel_formats
(
ctx
,
avfilter
_make_format_list
(
pix_fmts
));
ff_set_common_formats
(
ctx
,
ff
_make_format_list
(
pix_fmts
));
return
0
;
}
...
...
@@ -134,7 +134,7 @@ static void draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir)
p
+=
picref
->
linesize
[
0
];
}
avfilter
_draw_slice
(
ctx
->
outputs
[
0
],
y
,
h
,
slice_dir
);
ff
_draw_slice
(
ctx
->
outputs
[
0
],
y
,
h
,
slice_dir
);
}
static
void
end_frame
(
AVFilterLink
*
inlink
)
...
...
@@ -176,7 +176,7 @@ static void end_frame(AVFilterLink *inlink)
blackdetect
->
frame_count
++
;
blackdetect
->
nb_black_pixels
=
0
;
avfilter_unref_buffer
(
picref
);
avfilter
_end_frame
(
inlink
->
dst
->
outputs
[
0
]);
ff
_end_frame
(
inlink
->
dst
->
outputs
[
0
]);
}
AVFilter
avfilter_vf_blackdetect
=
{
...
...
@@ -191,7 +191,7 @@ AVFilter avfilter_vf_blackdetect = {
.
type
=
AVMEDIA_TYPE_VIDEO
,
.
config_props
=
config_input
,
.
draw_slice
=
draw_slice
,
.
get_video_buffer
=
avfilter
_null_get_video_buffer
,
.
get_video_buffer
=
ff
_null_get_video_buffer
,
.
start_frame
=
ff_null_start_frame_keep_ref
,
.
end_frame
=
end_frame
,
},
{
.
name
=
NULL
}
...
...
libavfilter/vf_colormatrix.c
View file @
c9e183b4
...
...
@@ -31,6 +31,8 @@
#include <strings.h>
#include <float.h>
#include "avfilter.h"
#include "formats.h"
#include "video.h"
#include "libavutil/pixdesc.h"
#include "libavutil/avstring.h"
...
...
@@ -325,7 +327,7 @@ static int query_formats(AVFilterContext *ctx)
PIX_FMT_NONE
};
avfilter_set_common_pixel_formats
(
ctx
,
avfilter
_make_format_list
(
pix_fmts
));
ff_set_common_formats
(
ctx
,
ff
_make_format_list
(
pix_fmts
));
return
0
;
}
...
...
@@ -333,7 +335,7 @@ static int query_formats(AVFilterContext *ctx)
static
AVFilterBufferRef
*
get_video_buffer
(
AVFilterLink
*
inlink
,
int
perms
,
int
w
,
int
h
)
{
AVFilterBufferRef
*
picref
=
avfilter
_get_video_buffer
(
inlink
->
dst
->
outputs
[
0
],
perms
,
w
,
h
);
ff
_get_video_buffer
(
inlink
->
dst
->
outputs
[
0
],
perms
,
w
,
h
);
return
picref
;
}
...
...
@@ -343,7 +345,7 @@ static void start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
link
->
dst
->
outputs
[
0
]
->
out_buf
=
outpicref
;
avfilter
_start_frame
(
link
->
dst
->
outputs
[
0
],
outpicref
);
ff
_start_frame
(
link
->
dst
->
outputs
[
0
],
outpicref
);
}
static
void
end_frame
(
AVFilterLink
*
link
)
...
...
@@ -359,8 +361,8 @@ static void end_frame(AVFilterLink *link)
else
process_frame_uyvy422
(
color
,
out
,
link
->
cur_buf
);
avfilter
_draw_slice
(
ctx
->
outputs
[
0
],
0
,
link
->
dst
->
outputs
[
0
]
->
h
,
1
);
avfilter
_end_frame
(
ctx
->
outputs
[
0
]);
ff
_draw_slice
(
ctx
->
outputs
[
0
],
0
,
link
->
dst
->
outputs
[
0
]
->
h
,
1
);
ff
_end_frame
(
ctx
->
outputs
[
0
]);
avfilter_unref_buffer
(
link
->
cur_buf
);
}
...
...
libavfilter/vf_deshake.c
View file @
c9e183b4
...
...
@@ -50,6 +50,8 @@
*/
#include "avfilter.h"
#include "formats.h"
#include "video.h"
#include "libavutil/common.h"
#include "libavutil/mem.h"
#include "libavutil/pixdesc.h"
...
...
@@ -390,7 +392,7 @@ static int query_formats(AVFilterContext *ctx)
PIX_FMT_YUVJ444P
,
PIX_FMT_YUVJ440P
,
PIX_FMT_NONE
};
avfilter_set_common_pixel_formats
(
ctx
,
avfilter
_make_format_list
(
pix_fmts
));
ff_set_common_formats
(
ctx
,
ff
_make_format_list
(
pix_fmts
));
return
0
;
}
...
...
@@ -525,8 +527,8 @@ static void end_frame(AVFilterLink *link)
deshake
->
ref
=
in
;
// Draw the transformed frame information
avfilter
_draw_slice
(
link
->
dst
->
outputs
[
0
],
0
,
link
->
h
,
1
);
avfilter
_end_frame
(
link
->
dst
->
outputs
[
0
]);
ff
_draw_slice
(
link
->
dst
->
outputs
[
0
],
0
,
link
->
h
,
1
);
ff
_end_frame
(
link
->
dst
->
outputs
[
0
]);
avfilter_unref_buffer
(
out
);
}
...
...
libavfilter/vf_hflip.c
View file @
c9e183b4
...
...
@@ -88,14 +88,14 @@ static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *picref)
AVFilterLink
*
outlink
=
inlink
->
dst
->
outputs
[
0
];
outlink
->
out_buf
=
avfilter
_get_video_buffer
(
outlink
,
AV_PERM_WRITE
,
outlink
->
w
,
outlink
->
h
);
ff
_get_video_buffer
(
outlink
,
AV_PERM_WRITE
,
outlink
->
w
,
outlink
->
h
);
avfilter_copy_buffer_ref_props
(
outlink
->
out_buf
,
picref
);
/* copy palette if required */
if
(
av_pix_fmt_descriptors
[
inlink
->
format
].
flags
&
PIX_FMT_PAL
)
memcpy
(
inlink
->
dst
->
outputs
[
0
]
->
out_buf
->
data
[
1
],
picref
->
data
[
1
],
AVPALETTE_SIZE
);
avfilter
_start_frame
(
outlink
,
avfilter_ref_buffer
(
outlink
->
out_buf
,
~
0
));
ff
_start_frame
(
outlink
,
avfilter_ref_buffer
(
outlink
->
out_buf
,
~
0
));
}
static
void
draw_slice
(
AVFilterLink
*
inlink
,
int
y
,
int
h
,
int
slice_dir
)
...
...
libavfilter/vf_idet.c
View file @
c9e183b4
...
...
@@ -22,6 +22,7 @@
#include "libavutil/common.h"
#include "libavutil/pixdesc.h"
#include "avfilter.h"
#include "internal.h"
#undef NDEBUG
#include <assert.h>
...
...
@@ -185,7 +186,7 @@ static void start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
if
(
!
idet
->
prev
)
idet
->
prev
=
avfilter_ref_buffer
(
idet
->
cur
,
AV_PERM_READ
);
avfilter
_start_frame
(
ctx
->
outputs
[
0
],
avfilter_ref_buffer
(
idet
->
cur
,
AV_PERM_READ
));
ff
_start_frame
(
ctx
->
outputs
[
0
],
avfilter_ref_buffer
(
idet
->
cur
,
AV_PERM_READ
));
}
static
void
end_frame
(
AVFilterLink
*
link
)
...
...
@@ -203,8 +204,8 @@ static void end_frame(AVFilterLink *link)
filter
(
ctx
);
avfilter
_draw_slice
(
ctx
->
outputs
[
0
],
0
,
link
->
h
,
1
);
avfilter
_end_frame
(
ctx
->
outputs
[
0
]);
ff
_draw_slice
(
ctx
->
outputs
[
0
],
0
,
link
->
h
,
1
);
ff
_end_frame
(
ctx
->
outputs
[
0
]);
}
static
int
request_frame
(
AVFilterLink
*
link
)
...
...
@@ -227,12 +228,12 @@ static int poll_frame(AVFilterLink *link)
IDETContext
*
idet
=
link
->
src
->
priv
;
int
ret
,
val
;
val
=
avfilter
_poll_frame
(
link
->
src
->
inputs
[
0
]);
val
=
ff
_poll_frame
(
link
->
src
->
inputs
[
0
]);
if
(
val
>=
1
&&
!
idet
->
next
)
{
//FIXME change API to not requre this red tape
if
((
ret
=
avfilter_request_frame
(
link
->
src
->
inputs
[
0
]))
<
0
)
return
ret
;
val
=
avfilter
_poll_frame
(
link
->
src
->
inputs
[
0
]);
val
=
ff
_poll_frame
(
link
->
src
->
inputs
[
0
]);
}
assert
(
idet
->
next
||
!
val
);
...
...
@@ -286,7 +287,7 @@ static int query_formats(AVFilterContext *ctx)
PIX_FMT_NONE
};
avfilter_set_common_pixel_formats
(
ctx
,
avfilter
_make_format_list
(
pix_fmts
));
ff_set_common_formats
(
ctx
,
ff
_make_format_list
(
pix_fmts
));
return
0
;
}
...
...
libavfilter/vf_removelogo.c
View file @
c9e183b4
...
...
@@ -71,6 +71,8 @@
#include "libavutil/imgutils.h"
#include "avfilter.h"
#include "formats.h"
#include "video.h"
#include "bbox.h"
#include "lavfutils.h"
#include "lswsutils.h"
...
...
@@ -190,7 +192,7 @@ static void convert_mask_to_strength_mask(uint8_t *data, int linesize,
static
int
query_formats
(
AVFilterContext
*
ctx
)
{
enum
PixelFormat
pix_fmts
[]
=
{
PIX_FMT_YUV420P
,
PIX_FMT_NONE
};
avfilter_set_common_pixel_formats
(
ctx
,
avfilter
_make_format_list
(
pix_fmts
));
ff_set_common_formats
(
ctx
,
ff
_make_format_list
(
pix_fmts
));
return
0
;
}
...
...
@@ -476,7 +478,7 @@ static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref)
AVFilterBufferRef
*
outpicref
;
if
(
inpicref
->
perms
&
AV_PERM_PRESERVE
)
{
outpicref
=
avfilter
_get_video_buffer
(
outlink
,
AV_PERM_WRITE
,
outpicref
=
ff
_get_video_buffer
(
outlink
,
AV_PERM_WRITE
,
outlink
->
w
,
outlink
->
h
);
avfilter_copy_buffer_ref_props
(
outpicref
,
inpicref
);
outpicref
->
video
->
w
=
outlink
->
w
;
...
...
@@ -485,7 +487,7 @@ static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref)
outpicref
=
inpicref
;
outlink
->
out_buf
=
outpicref
;
avfilter
_start_frame
(
outlink
,
avfilter_ref_buffer
(
outpicref
,
~
0
));
ff
_start_frame
(
outlink
,
avfilter_ref_buffer
(
outpicref
,
~
0
));
}
static
void
end_frame
(
AVFilterLink
*
inlink
)
...
...
@@ -512,8 +514,8 @@ static void end_frame(AVFilterLink *inlink)
removelogo
->
half_mask_data
,
inlink
->
w
/
2
,
inlink
->
w
/
2
,
inlink
->
h
/
2
,
direct
,
&
removelogo
->
half_mask_bbox
);
avfilter
_draw_slice
(
outlink
,
0
,
inlink
->
h
,
1
);
avfilter
_end_frame
(
outlink
);
ff
_draw_slice
(
outlink
,
0
,
inlink
->
h
,
1
);
ff
_end_frame
(
outlink
);
avfilter_unref_buffer
(
inpicref
);
if
(
!
direct
)
avfilter_unref_buffer
(
outpicref
);
...
...
@@ -554,7 +556,7 @@ AVFilter avfilter_vf_removelogo = {
.
inputs
=
(
const
AVFilterPad
[])
{
{
.
name
=
"default"
,
.
type
=
AVMEDIA_TYPE_VIDEO
,
.
get_video_buffer
=
avfilter
_null_get_video_buffer
,
.
get_video_buffer
=
ff
_null_get_video_buffer
,
.
config_props
=
config_props_input
,
.
draw_slice
=
null_draw_slice
,
.
start_frame
=
start_frame
,
...
...
libavfilter/vf_select.c
View file @
c9e183b4
...
...
@@ -390,7 +390,7 @@ static int query_formats(AVFilterContext *ctx)
PIX_FMT_RGB24
,
PIX_FMT_BGR24
,
PIX_FMT_NONE
};
avfilter_set_common_pixel_formats
(
ctx
,
avfilter
_make_format_list
(
pix_fmts
));
ff_set_common_formats
(
ctx
,
ff
_make_format_list
(
pix_fmts
));
}
return
0
;
}
...
...
libavfilter/vf_setfield.c
View file @
c9e183b4
...
...
@@ -24,6 +24,7 @@
*/
#include "avfilter.h"
#include "video.h"
enum
SetFieldMode
{
MODE_AUTO
=
-
1
,
...
...
@@ -79,7 +80,7 @@ static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref)
outpicref
->
video
->
interlaced
=
1
;
outpicref
->
video
->
top_field_first
=
setfield
->
mode
;
}
avfilter
_start_frame
(
inlink
->
dst
->
outputs
[
0
],
outpicref
);
ff
_start_frame
(
inlink
->
dst
->
outputs
[
0
],
outpicref
);
}
AVFilter
avfilter_vf_setfield
=
{
...
...
@@ -92,7 +93,7 @@ AVFilter avfilter_vf_setfield = {
.
inputs
=
(
const
AVFilterPad
[])
{
{
.
name
=
"default"
,
.
type
=
AVMEDIA_TYPE_VIDEO
,
.
get_video_buffer
=
avfilter
_null_get_video_buffer
,
.
get_video_buffer
=
ff
_null_get_video_buffer
,
.
start_frame
=
start_frame
,
},
{
.
name
=
NULL
}
},
...
...
libavfilter/vf_super2xsai.c
View file @
c9e183b4
...
...
@@ -29,6 +29,8 @@
#include "libavutil/pixdesc.h"
#include "libavutil/intreadwrite.h"
#include "avfilter.h"
#include "formats.h"
#include "video.h"
typedef
struct
{
/* masks used for two pixels interpolation */
...
...
@@ -238,7 +240,7 @@ static int query_formats(AVFilterContext *ctx)
PIX_FMT_NONE
};
avfilter_set_common_pixel_formats
(
ctx
,
avfilter
_make_format_list
(
pix_fmts
));
ff_set_common_formats
(
ctx
,
ff
_make_format_list
(
pix_fmts
));
return
0
;
}
...
...
@@ -313,8 +315,8 @@ static void end_frame(AVFilterLink *inlink)
inlink
->
w
,
inlink
->
h
);
avfilter_unref_buffer
(
inpicref
);
avfilter
_draw_slice
(
outlink
,
0
,
outlink
->
h
,
1
);
avfilter
_end_frame
(
outlink
);
ff
_draw_slice
(
outlink
,
0
,
outlink
->
h
,
1
);
ff
_end_frame
(
outlink
);
avfilter_unref_buffer
(
outpicref
);
}
...
...
libavfilter/vf_swapuv.c
View file @
c9e183b4
...
...
@@ -24,12 +24,14 @@
*/
#include "avfilter.h"
#include "formats.h"
#include "video.h"
static
AVFilterBufferRef
*
get_video_buffer
(
AVFilterLink
*
link
,
int
perms
,
int
w
,
int
h
)
{
AVFilterBufferRef
*
picref
=
avfilter
_default_get_video_buffer
(
link
,
perms
,
w
,
h
);
ff
_default_get_video_buffer
(
link
,
perms
,
w
,
h
);
uint8_t
*
tmp
;
int
tmp2
;
...
...
@@ -54,7 +56,7 @@ static void start_frame(AVFilterLink *link, AVFilterBufferRef *inpicref)
outpicref
->
linesize
[
1
]
=
inpicref
->
linesize
[
2
];
outpicref
->
linesize
[
2
]
=
inpicref
->
linesize
[
1
];
avfilter
_start_frame
(
link
->
dst
->
outputs
[
0
],
outpicref
);
ff
_start_frame
(
link
->
dst
->
outputs
[
0
],
outpicref
);
}
static
int
query_formats
(
AVFilterContext
*
ctx
)
...
...
@@ -68,7 +70,7 @@ static int query_formats(AVFilterContext *ctx)
PIX_FMT_NONE
,
};
avfilter_set_common_pixel_formats
(
ctx
,
avfilter
_make_format_list
(
pix_fmts
));
ff_set_common_formats
(
ctx
,
ff
_make_format_list
(
pix_fmts
));
return
0
;
}
...
...
libavfilter/vf_thumbnail.c
View file @
c9e183b4
...
...
@@ -28,6 +28,7 @@
*/
#include "avfilter.h"
#include "internal.h"
#define HIST_SIZE (3*256)
...
...
@@ -151,10 +152,10 @@ static void end_frame(AVFilterLink *inlink)
picref
=
thumb
->
frames
[
best_frame_idx
].
buf
;
av_log
(
ctx
,
AV_LOG_INFO
,
"frame id #%d (pts_time=%f) selected
\n
"
,
best_frame_idx
,
picref
->
pts
*
av_q2d
(
inlink
->
time_base
));
avfilter
_start_frame
(
outlink
,
picref
);
ff
_start_frame
(
outlink
,
picref
);
thumb
->
frames
[
best_frame_idx
].
buf
=
NULL
;
avfilter
_draw_slice
(
outlink
,
0
,
inlink
->
h
,
1
);
avfilter
_end_frame
(
outlink
);
ff
_draw_slice
(
outlink
,
0
,
inlink
->
h
,
1
);
ff
_end_frame
(
outlink
);
}
static
av_cold
void
uninit
(
AVFilterContext
*
ctx
)
...
...
@@ -188,7 +189,7 @@ static int poll_frame(AVFilterLink *link)
{
ThumbContext
*
thumb
=
link
->
src
->
priv
;
AVFilterLink
*
inlink
=
link
->
src
->
inputs
[
0
];
int
ret
,
available_frames
=
avfilter
_poll_frame
(
inlink
);
int
ret
,
available_frames
=
ff
_poll_frame
(
inlink
);
/* If the input link is not able to provide any frame, we can't do anything
* at the moment and thus have zero thumbnail available. */
...
...
@@ -212,7 +213,7 @@ static int query_formats(AVFilterContext *ctx)
PIX_FMT_RGB24
,
PIX_FMT_BGR24
,
PIX_FMT_NONE
};
avfilter_set_common_pixel_formats
(
ctx
,
avfilter
_make_format_list
(
pix_fmts
));
ff_set_common_formats
(
ctx
,
ff
_make_format_list
(
pix_fmts
));
return
0
;
}
...
...
@@ -226,7 +227,7 @@ AVFilter avfilter_vf_thumbnail = {
.
inputs
=
(
const
AVFilterPad
[])
{
{
.
name
=
"default"
,
.
type
=
AVMEDIA_TYPE_VIDEO
,
.
get_video_buffer
=
avfilter
_null_get_video_buffer
,
.
get_video_buffer
=
ff
_null_get_video_buffer
,
.
start_frame
=
null_start_frame
,
.
draw_slice
=
draw_slice
,
.
end_frame
=
end_frame
,
...
...
libavfilter/vf_tile.c
View file @
c9e183b4
...
...
@@ -103,7 +103,7 @@ static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *picref)
if
(
tile
->
current
)
return
;
outlink
->
out_buf
=
avfilter
_get_video_buffer
(
outlink
,
AV_PERM_WRITE
,
outlink
->
out_buf
=
ff
_get_video_buffer
(
outlink
,
AV_PERM_WRITE
,
outlink
->
w
,
outlink
->
h
);
avfilter_copy_buffer_ref_props
(
outlink
->
out_buf
,
picref
);
outlink
->
out_buf
->
video
->
w
=
outlink
->
w
;
...
...
libavfilter/vf_tinterlace.c
View file @
c9e183b4
...
...
@@ -76,7 +76,7 @@ static int query_formats(AVFilterContext *ctx)
PIX_FMT_NONE
};
avfilter_set_common_pixel_formats
(
ctx
,
avfilter
_make_format_list
(
pix_fmts
));
ff_set_common_formats
(
ctx
,
ff
_make_format_list
(
pix_fmts
));
return
0
;
}
...
...
@@ -224,7 +224,7 @@ static void end_frame(AVFilterLink *inlink)
switch
(
tinterlace
->
mode
)
{
case
MODE_MERGE
:
/* move the odd frame into the upper field of the new image, even into
* the lower field, generating a double-height video at half framerate */
out
=
avfilter
_get_video_buffer
(
outlink
,
AV_PERM_WRITE
,
outlink
->
w
,
outlink
->
h
);
out
=
ff
_get_video_buffer
(
outlink
,
AV_PERM_WRITE
,
outlink
->
w
,
outlink
->
h
);
avfilter_copy_buffer_ref_props
(
out
,
cur
);
out
->
video
->
h
=
outlink
->
h
;
out
->
video
->
interlaced
=
1
;
...
...
@@ -251,7 +251,7 @@ static void end_frame(AVFilterLink *inlink)
case
MODE_PAD
:
/* expand each frame to double height, but pad alternate
* lines with black; framerate unchanged */
out
=
avfilter
_get_video_buffer
(
outlink
,
AV_PERM_WRITE
,
outlink
->
w
,
outlink
->
h
);
out
=
ff
_get_video_buffer
(
outlink
,
AV_PERM_WRITE
,
outlink
->
w
,
outlink
->
h
);
avfilter_copy_buffer_ref_props
(
out
,
cur
);
out
->
video
->
h
=
outlink
->
h
;
...
...
@@ -273,7 +273,7 @@ static void end_frame(AVFilterLink *inlink)
case
MODE_INTERLEAVE_TOP
:
/* top field first */
case
MODE_INTERLEAVE_BOTTOM
:
/* bottom field first */
tff
=
tinterlace
->
mode
==
MODE_INTERLEAVE_TOP
;
out
=
avfilter
_get_video_buffer
(
outlink
,
AV_PERM_WRITE
,
outlink
->
w
,
outlink
->
h
);
out
=
ff
_get_video_buffer
(
outlink
,
AV_PERM_WRITE
,
outlink
->
w
,
outlink
->
h
);
avfilter_copy_buffer_ref_props
(
out
,
cur
);
out
->
video
->
interlaced
=
1
;
out
->
video
->
top_field_first
=
tff
;
...
...
@@ -295,13 +295,13 @@ static void end_frame(AVFilterLink *inlink)
out
=
avfilter_ref_buffer
(
cur
,
AV_PERM_READ
);
out
->
video
->
interlaced
=
1
;
avfilter
_start_frame
(
outlink
,
out
);
avfilter
_draw_slice
(
outlink
,
0
,
outlink
->
h
,
1
);
avfilter
_end_frame
(
outlink
);
ff
_start_frame
(
outlink
,
out
);
ff
_draw_slice
(
outlink
,
0
,
outlink
->
h
,
1
);
ff
_end_frame
(
outlink
);
/* output mix of current and next frame */
tff
=
next
->
video
->
top_field_first
;
out
=
avfilter
_get_video_buffer
(
outlink
,
AV_PERM_WRITE
,
outlink
->
w
,
outlink
->
h
);
out
=
ff
_get_video_buffer
(
outlink
,
AV_PERM_WRITE
,
outlink
->
w
,
outlink
->
h
);
avfilter_copy_buffer_ref_props
(
out
,
next
);
out
->
video
->
interlaced
=
1
;
...
...
@@ -318,9 +318,9 @@ static void end_frame(AVFilterLink *inlink)
break
;
}
avfilter
_start_frame
(
outlink
,
out
);
avfilter
_draw_slice
(
outlink
,
0
,
outlink
->
h
,
1
);
avfilter
_end_frame
(
outlink
);
ff
_start_frame
(
outlink
,
out
);
ff
_draw_slice
(
outlink
,
0
,
outlink
->
h
,
1
);
ff
_end_frame
(
outlink
);
tinterlace
->
frame
++
;
}
...
...
@@ -331,12 +331,12 @@ static int poll_frame(AVFilterLink *outlink)
AVFilterLink
*
inlink
=
outlink
->
src
->
inputs
[
0
];
int
ret
,
val
;
val
=
avfilter
_poll_frame
(
inlink
);
val
=
ff
_poll_frame
(
inlink
);
if
(
val
==
1
&&
!
tinterlace
->
next
)
{
if
((
ret
=
avfilter_request_frame
(
inlink
))
<
0
)
return
ret
;
val
=
avfilter
_poll_frame
(
inlink
);
val
=
ff
_poll_frame
(
inlink
);
}
assert
(
tinterlace
->
next
);
...
...
libavfilter/video.c
View file @
c9e183b4
...
...
@@ -220,7 +220,7 @@ void ff_start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
void
ff_null_start_frame_keep_ref
(
AVFilterLink
*
inlink
,
AVFilterBufferRef
*
picref
)
{
avfilter
_start_frame
(
inlink
->
dst
->
outputs
[
0
],
avfilter_ref_buffer
(
picref
,
~
0
));
ff
_start_frame
(
inlink
->
dst
->
outputs
[
0
],
avfilter_ref_buffer
(
picref
,
~
0
));
}
void
ff_null_end_frame
(
AVFilterLink
*
link
)
...
...
libavfilter/vsrc_cellauto.c
View file @
c9e183b4
...
...
@@ -31,6 +31,8 @@
#include "libavutil/parseutils.h"
#include "libavutil/random_seed.h"
#include "avfilter.h"
#include "formats.h"
#include "video.h"
typedef
struct
{
const
AVClass
*
class
;
...
...
@@ -305,7 +307,7 @@ static int request_frame(AVFilterLink *outlink)
{
CellAutoContext
*
cellauto
=
outlink
->
src
->
priv
;
AVFilterBufferRef
*
picref
=
avfilter
_get_video_buffer
(
outlink
,
AV_PERM_WRITE
,
cellauto
->
w
,
cellauto
->
h
);
ff
_get_video_buffer
(
outlink
,
AV_PERM_WRITE
,
cellauto
->
w
,
cellauto
->
h
);
picref
->
video
->
sample_aspect_ratio
=
(
AVRational
)
{
1
,
1
};
if
(
cellauto
->
generation
==
0
&&
cellauto
->
start_full
)
{
int
i
;
...
...
@@ -322,9 +324,9 @@ static int request_frame(AVFilterLink *outlink)
show_cellauto_row
(
outlink
->
src
);
#endif
avfilter
_start_frame
(
outlink
,
avfilter_ref_buffer
(
picref
,
~
0
));
avfilter
_draw_slice
(
outlink
,
0
,
cellauto
->
h
,
1
);
avfilter
_end_frame
(
outlink
);
ff
_start_frame
(
outlink
,
avfilter_ref_buffer
(
picref
,
~
0
));
ff
_draw_slice
(
outlink
,
0
,
cellauto
->
h
,
1
);
ff
_end_frame
(
outlink
);
avfilter_unref_buffer
(
picref
);
return
0
;
...
...
@@ -333,7 +335,7 @@ static int request_frame(AVFilterLink *outlink)
static
int
query_formats
(
AVFilterContext
*
ctx
)
{
static
const
enum
PixelFormat
pix_fmts
[]
=
{
PIX_FMT_MONOBLACK
,
PIX_FMT_NONE
};
avfilter_set_common_pixel_formats
(
ctx
,
avfilter
_make_format_list
(
pix_fmts
));
ff_set_common_formats
(
ctx
,
ff
_make_format_list
(
pix_fmts
));
return
0
;
}
...
...
libavfilter/vsrc_life.c
View file @
c9e183b4
...
...
@@ -32,6 +32,8 @@
#include "libavutil/parseutils.h"
#include "libavutil/random_seed.h"
#include "avfilter.h"
#include "formats.h"
#include "video.h"
typedef
struct
{
const
AVClass
*
class
;
...
...
@@ -431,7 +433,7 @@ static void fill_picture_rgb(AVFilterContext *ctx, AVFilterBufferRef *picref)
static
int
request_frame
(
AVFilterLink
*
outlink
)
{
LifeContext
*
life
=
outlink
->
src
->
priv
;
AVFilterBufferRef
*
picref
=
avfilter
_get_video_buffer
(
outlink
,
AV_PERM_WRITE
,
life
->
w
,
life
->
h
);
AVFilterBufferRef
*
picref
=
ff
_get_video_buffer
(
outlink
,
AV_PERM_WRITE
,
life
->
w
,
life
->
h
);
picref
->
video
->
sample_aspect_ratio
=
(
AVRational
)
{
1
,
1
};
picref
->
pts
=
life
->
pts
++
;
picref
->
pos
=
-
1
;
...
...
@@ -442,9 +444,9 @@ static int request_frame(AVFilterLink *outlink)
show_life_grid
(
outlink
->
src
);
#endif
avfilter
_start_frame
(
outlink
,
avfilter_ref_buffer
(
picref
,
~
0
));
avfilter
_draw_slice
(
outlink
,
0
,
life
->
h
,
1
);
avfilter
_end_frame
(
outlink
);
ff
_start_frame
(
outlink
,
avfilter_ref_buffer
(
picref
,
~
0
));
ff
_draw_slice
(
outlink
,
0
,
life
->
h
,
1
);
ff
_end_frame
(
outlink
);
avfilter_unref_buffer
(
picref
);
return
0
;
...
...
@@ -462,7 +464,7 @@ static int query_formats(AVFilterContext *ctx)
pix_fmts
[
0
]
=
PIX_FMT_MONOBLACK
;
life
->
draw
=
fill_picture_monoblack
;
}
avfilter_set_common_pixel_formats
(
ctx
,
avfilter
_make_format_list
(
pix_fmts
));
ff_set_common_formats
(
ctx
,
ff
_make_format_list
(
pix_fmts
));
return
0
;
}
...
...
libavfilter/vsrc_mandelbrot.c
View file @
c9e183b4
...
...
@@ -27,6 +27,8 @@
*/
#include "avfilter.h"
#include "formats.h"
#include "video.h"
#include "libavutil/imgutils.h"
#include "libavutil/opt.h"
#include "libavutil/parseutils.h"
...
...
@@ -161,7 +163,7 @@ static int query_formats(AVFilterContext *ctx)
PIX_FMT_NONE
};
avfilter_set_common_pixel_formats
(
ctx
,
avfilter
_make_format_list
(
pix_fmts
));
ff_set_common_formats
(
ctx
,
ff
_make_format_list
(
pix_fmts
));
return
0
;
}
...
...
@@ -385,15 +387,15 @@ static void draw_mandelbrot(AVFilterContext *ctx, uint32_t *color, int linesize,
static
int
request_frame
(
AVFilterLink
*
link
)
{
MBContext
*
mb
=
link
->
src
->
priv
;
AVFilterBufferRef
*
picref
=
avfilter
_get_video_buffer
(
link
,
AV_PERM_WRITE
,
mb
->
w
,
mb
->
h
);
AVFilterBufferRef
*
picref
=
ff
_get_video_buffer
(
link
,
AV_PERM_WRITE
,
mb
->
w
,
mb
->
h
);
picref
->
video
->
sample_aspect_ratio
=
(
AVRational
)
{
1
,
1
};
picref
->
pts
=
mb
->
pts
++
;
picref
->
pos
=
-
1
;
avfilter
_start_frame
(
link
,
avfilter_ref_buffer
(
picref
,
~
0
));
ff
_start_frame
(
link
,
avfilter_ref_buffer
(
picref
,
~
0
));
draw_mandelbrot
(
link
->
src
,
(
uint32_t
*
)
picref
->
data
[
0
],
picref
->
linesize
[
0
]
/
4
,
picref
->
pts
);
avfilter
_draw_slice
(
link
,
0
,
mb
->
h
,
1
);
avfilter
_end_frame
(
link
);
ff
_draw_slice
(
link
,
0
,
mb
->
h
,
1
);
ff
_end_frame
(
link
);
avfilter_unref_buffer
(
picref
);
return
0
;
...
...
libavfilter/vsrc_mptestsrc.c
View file @
c9e183b4
...
...
@@ -28,6 +28,8 @@
#include "libavutil/parseutils.h"
#include "libavutil/pixdesc.h"
#include "avfilter.h"
#include "formats.h"
#include "video.h"
#define WIDTH 512
#define HEIGHT 512
...
...
@@ -320,7 +322,7 @@ static int query_formats(AVFilterContext *ctx)
PIX_FMT_YUV420P
,
PIX_FMT_NONE
};
avfilter_set_common_pixel_formats
(
ctx
,
avfilter
_make_format_list
(
pix_fmts
));
ff_set_common_formats
(
ctx
,
ff
_make_format_list
(
pix_fmts
));
return
0
;
}
...
...
@@ -334,7 +336,7 @@ static int request_frame(AVFilterLink *outlink)
if
(
test
->
max_pts
>=
0
&&
test
->
pts
>
test
->
max_pts
)
return
AVERROR_EOF
;
picref
=
avfilter
_get_video_buffer
(
outlink
,
AV_PERM_WRITE
,
w
,
h
);
picref
=
ff
_get_video_buffer
(
outlink
,
AV_PERM_WRITE
,
w
,
h
);
picref
->
pts
=
test
->
pts
++
;
// clean image
...
...
@@ -360,9 +362,9 @@ static int request_frame(AVFilterLink *outlink)
test
->
frame_nb
++
;
avfilter
_start_frame
(
outlink
,
avfilter_ref_buffer
(
picref
,
~
0
));
avfilter
_draw_slice
(
outlink
,
0
,
picref
->
video
->
h
,
1
);
avfilter
_end_frame
(
outlink
);
ff
_start_frame
(
outlink
,
avfilter_ref_buffer
(
picref
,
~
0
));
ff
_draw_slice
(
outlink
,
0
,
picref
->
video
->
h
,
1
);
ff
_end_frame
(
outlink
);
avfilter_unref_buffer
(
picref
);
return
0
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment