File tree Expand file tree Collapse file tree 3 files changed +19
-4
lines changed Expand file tree Collapse file tree 3 files changed +19
-4
lines changed Original file line number Diff line number Diff line change 5
5
#include < AvTranscoder/Options/OptionChoice.hpp>
6
6
#include < AvTranscoder/OptionLoader.hpp>
7
7
8
+ extern " C" {
9
+ #ifndef __STDC_CONSTANT_MACROS
10
+ #define __STDC_CONSTANT_MACROS
11
+ #endif
12
+ #include < libavutil/opt.h>
13
+ }
14
+
8
15
#include < string>
9
16
#include < iostream>
10
17
#include < iomanip>
@@ -18,7 +25,7 @@ int optionChecker( const std::string& inputfilename )
18
25
avtranscoder::AudioDesc audioDesc ( inputFile.getStream ( 0 ).getAudioDesc () );
19
26
20
27
avtranscoder::OptionLoader optionLoader;
21
- optionLoader.loadOptions ( audioDesc.getCodecContext () );
28
+ optionLoader.loadOptions ( audioDesc.getCodecContext (), 0 , 0 );
22
29
23
30
// display Options
24
31
for ( auto option : optionLoader.getOptions () )
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ OptionLoader::OptionLoader()
20
20
21
21
}
22
22
23
- void OptionLoader::loadOptions ( void * av_class )
23
+ void OptionLoader::loadOptions ( void * av_class, int req_flags, int rej_flags )
24
24
{
25
25
// tmp vectors to access easely to the OptionChoice/OptionGroup to add choice / boolean to them
26
26
std::vector<avtranscoder::OptionChoice*> optionsChoice;
@@ -31,7 +31,10 @@ void OptionLoader::loadOptions( void* av_class )
31
31
32
32
while ( ( avOption = av_opt_next ( av_class, avOption ) ) != NULL )
33
33
{
34
- if ( !avOption || ! avOption->name )
34
+ if ( !avOption ||
35
+ ! avOption->name ||
36
+ ( avOption->flags & req_flags ) != req_flags ||
37
+ ( avOption->flags & rej_flags ) )
35
38
{
36
39
continue ;
37
40
}
@@ -109,6 +112,8 @@ void OptionLoader::loadOptions( void* av_class )
109
112
{
110
113
if ( !avOption ||
111
114
!avOption->name ||
115
+ ( avOption->flags & req_flags ) != req_flags ||
116
+ ( avOption->flags & rej_flags ) ||
112
117
( avOption->unit && avOption->type == AV_OPT_TYPE_FLAGS ) ||
113
118
( avOption->unit && avOption->type == AV_OPT_TYPE_INT ) )
114
119
{
Original file line number Diff line number Diff line change @@ -19,7 +19,10 @@ class OptionLoader
19
19
20
20
std::vector<Option*>& getOptions () { return m_options; }
21
21
22
- void loadOptions ( void * av_class );
22
+ /* *
23
+ * @param av_class: a libav / ffmpeg object which contains AVOption.
24
+ */
25
+ void loadOptions ( void * av_class, int req_flags, int rej_flags );
23
26
24
27
private:
25
28
std::vector<Option*> m_options;
You can’t perform that action at this time.
0 commit comments