Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Releases
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Stefan Westerfeld
ffmpeg
Commits
66f8f9ed
Commit
66f8f9ed
authored
Feb 12, 2022
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/f_perms: add commands support
parent
59c647bc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
15 deletions
+15
-15
f_perms.c
libavfilter/f_perms.c
+15
-15
No files found.
libavfilter/f_perms.c
View file @
66f8f9ed
...
...
@@ -42,14 +42,15 @@ typedef struct PermsContext {
#define OFFSET(x) offsetof(PermsContext, x)
#define FLAGS AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_VIDEO_PARAM
#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_RUNTIME_PARAM
static
const
AVOption
options
[]
=
{
{
"mode"
,
"select permissions mode"
,
OFFSET
(
mode
),
AV_OPT_TYPE_INT
,
{.
i64
=
MODE_NONE
},
MODE_NONE
,
NB_MODES
-
1
,
FLAGS
,
"mode"
},
{
"none"
,
"do nothing"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
MODE_NONE
},
INT_MIN
,
INT_MAX
,
FLAGS
,
"mode"
},
{
"ro"
,
"set all output frames read-only"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
MODE_RO
},
INT_MIN
,
INT_MAX
,
FLAGS
,
"mode"
},
{
"rw"
,
"set all output frames writable"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
MODE_RW
},
INT_MIN
,
INT_MAX
,
FLAGS
,
"mode"
},
{
"toggle"
,
"switch permissions"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
MODE_TOGGLE
},
INT_MIN
,
INT_MAX
,
FLAGS
,
"mode"
},
{
"random"
,
"set permissions randomly"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
MODE_RANDOM
},
INT_MIN
,
INT_MAX
,
FLAGS
,
"mode"
},
{
"mode"
,
"select permissions mode"
,
OFFSET
(
mode
),
AV_OPT_TYPE_INT
,
{.
i64
=
MODE_NONE
},
MODE_NONE
,
NB_MODES
-
1
,
T
FLAGS
,
"mode"
},
{
"none"
,
"do nothing"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
MODE_NONE
},
0
,
0
,
T
FLAGS
,
"mode"
},
{
"ro"
,
"set all output frames read-only"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
MODE_RO
},
0
,
0
,
T
FLAGS
,
"mode"
},
{
"rw"
,
"set all output frames writable"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
MODE_RW
},
0
,
0
,
T
FLAGS
,
"mode"
},
{
"toggle"
,
"switch permissions"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
MODE_TOGGLE
},
0
,
0
,
T
FLAGS
,
"mode"
},
{
"random"
,
"set permissions randomly"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
MODE_RANDOM
},
0
,
0
,
T
FLAGS
,
"mode"
},
{
"seed"
,
"set the seed for the random mode"
,
OFFSET
(
random_seed
),
AV_OPT_TYPE_INT64
,
{.
i64
=
-
1
},
-
1
,
UINT32_MAX
,
FLAGS
},
{
NULL
}
};
...
...
@@ -57,16 +58,13 @@ static const AVOption options[] = {
static
av_cold
int
init
(
AVFilterContext
*
ctx
)
{
PermsContext
*
s
=
ctx
->
priv
;
uint32_t
seed
;
if
(
s
->
mode
==
MODE_RANDOM
)
{
uint32_t
seed
;
if
(
s
->
random_seed
==
-
1
)
s
->
random_seed
=
av_get_random_seed
();
seed
=
s
->
random_seed
;
av_log
(
ctx
,
AV_LOG_INFO
,
"random seed: 0x%08"
PRIx32
"
\n
"
,
seed
);
av_lfg_init
(
&
s
->
lfg
,
seed
);
}
if
(
s
->
random_seed
==
-
1
)
s
->
random_seed
=
av_get_random_seed
();
seed
=
s
->
random_seed
;
av_log
(
ctx
,
AV_LOG_INFO
,
"random seed: 0x%08"
PRIx32
"
\n
"
,
seed
);
av_lfg_init
(
&
s
->
lfg
,
seed
);
return
0
;
}
...
...
@@ -140,6 +138,7 @@ const AVFilter ff_af_aperms = {
FILTER_OUTPUTS
(
aperms_outputs
),
.
flags
=
AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC
|
AVFILTER_FLAG_METADATA_ONLY
,
.
process_command
=
ff_filter_process_command
,
};
#endif
/* CONFIG_APERMS_FILTER */
...
...
@@ -170,5 +169,6 @@ const AVFilter ff_vf_perms = {
.
priv_class
=
&
perms_class
,
.
flags
=
AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC
|
AVFILTER_FLAG_METADATA_ONLY
,
.
process_command
=
ff_filter_process_command
,
};
#endif
/* CONFIG_PERMS_FILTER */
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