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
73d5d405
Commit
73d5d405
authored
Feb 25, 2013
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
split: switch to an AVOptions-based system.
parent
b13623e1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
11 deletions
+37
-11
split.c
libavfilter/split.c
+37
-11
No files found.
libavfilter/split.c
View file @
73d5d405
...
...
@@ -27,25 +27,24 @@
#include "libavutil/internal.h"
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "avfilter.h"
#include "audio.h"
#include "internal.h"
#include "video.h"
typedef
struct
SplitContext
{
const
AVClass
*
class
;
int
nb_outputs
;
}
SplitContext
;
static
int
split_init
(
AVFilterContext
*
ctx
,
const
char
*
args
)
{
int
i
,
nb_outputs
=
2
;
if
(
args
)
{
nb_outputs
=
strtol
(
args
,
NULL
,
0
);
if
(
nb_outputs
<=
0
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"Invalid number of outputs specified: %d.
\n
"
,
nb_outputs
);
return
AVERROR
(
EINVAL
);
}
}
SplitContext
*
s
=
ctx
->
priv
;
int
i
;
for
(
i
=
0
;
i
<
nb_outputs
;
i
++
)
{
for
(
i
=
0
;
i
<
s
->
nb_outputs
;
i
++
)
{
char
name
[
32
];
AVFilterPad
pad
=
{
0
};
...
...
@@ -87,6 +86,27 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
return
ret
;
}
#define OFFSET(x) offsetof(SplitContext, x)
#define FLAGS AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_VIDEO_PARAM
static
const
AVOption
options
[]
=
{
{
"outputs"
,
"Number of outputs"
,
OFFSET
(
nb_outputs
),
AV_OPT_TYPE_INT
,
{
.
i64
=
2
},
1
,
INT_MAX
,
FLAGS
},
{
NULL
},
};
static
const
AVClass
split_class
=
{
.
class_name
=
"split"
,
.
item_name
=
av_default_item_name
,
.
option
=
options
,
.
version
=
LIBAVUTIL_VERSION_INT
,
};
static
const
AVClass
asplit_class
=
{
.
class_name
=
"asplit"
,
.
item_name
=
av_default_item_name
,
.
option
=
options
,
.
version
=
LIBAVUTIL_VERSION_INT
,
};
static
const
AVFilterPad
avfilter_vf_split_inputs
[]
=
{
{
.
name
=
"default"
,
...
...
@@ -101,6 +121,9 @@ AVFilter avfilter_vf_split = {
.
name
=
"split"
,
.
description
=
NULL_IF_CONFIG_SMALL
(
"Pass on the input to two outputs."
),
.
priv_size
=
sizeof
(
SplitContext
),
.
priv_class
=
&
split_class
,
.
init
=
split_init
,
.
uninit
=
split_uninit
,
...
...
@@ -122,6 +145,9 @@ AVFilter avfilter_af_asplit = {
.
name
=
"asplit"
,
.
description
=
NULL_IF_CONFIG_SMALL
(
"Pass on the audio input to N audio outputs."
),
.
priv_size
=
sizeof
(
SplitContext
),
.
priv_class
=
&
asplit_class
,
.
init
=
split_init
,
.
uninit
=
split_uninit
,
...
...
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