Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 881de92

Browse files
committedOct 12, 2014
Option: rename "get default value" and "set value" functions
* Remove "Value" to getters of default value: getDefaultValueBool -> getDefaultBool. * Remove "Value" to setters of value: setValueBool -> setBool.
1 parent 68e08e9 commit 881de92

File tree

9 files changed

+37
-37
lines changed

9 files changed

+37
-37
lines changed
 

‎app/optionChecker/optionChecker.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,23 @@ void displayOptions( const std::vector<avtranscoder::Option>& options )
2424

2525
if( option.getType() == avtranscoder::eOptionBaseTypeInt )
2626
{
27-
std::cout << "DefaultValue: " << option.getDefaultValueInt() << std::endl;
27+
std::cout << "DefaultValue: " << option.getDefaultInt() << std::endl;
2828
}
2929
else if( option.getType() == avtranscoder::eOptionBaseTypeBool )
3030
{
31-
std::cout << "DefaultValue: " << option.getDefaultValueBool() << std::endl;
31+
std::cout << "DefaultValue: " << option.getDefaultBool() << std::endl;
3232
}
3333
else if( option.getType() == avtranscoder::eOptionBaseTypeDouble )
3434
{
35-
std::cout << "DefaultValue: " << option.getDefaultValueDouble() << std::endl;
35+
std::cout << "DefaultValue: " << option.getDefaultDouble() << std::endl;
3636
}
3737
else if( option.getType() == avtranscoder::eOptionBaseTypeRatio )
3838
{
39-
std::cout << "DefaultValue: " << option.getDefaultValueRatio().first << ", " << option.getDefaultValueRatio().second << std::endl;
39+
std::cout << "DefaultValue: " << option.getDefaultRatio().first << ", " << option.getDefaultRatio().second << std::endl;
4040
}
4141
else if( option.getType() == avtranscoder::eOptionBaseTypeString )
4242
{
43-
std::cout << "DefaultValue: " << option.getDefaultValueString() << std::endl;
43+
std::cout << "DefaultValue: " << option.getDefaultString() << std::endl;
4444
}
4545
else if( option.getType() == avtranscoder::eOptionBaseTypeChoice )
4646
{
@@ -57,7 +57,7 @@ void displayOptions( const std::vector<avtranscoder::Option>& options )
5757
for(size_t i = 0; i < option.getChilds().size(); ++i )
5858
std::cout << "Element " << i << ": " <<
5959
option.getChildAtIndex( i ).getName() << " // " <<
60-
option.getChildAtIndex( i ).getDefaultValueBool() << std::endl;
60+
option.getChildAtIndex( i ).getDefaultBool() << std::endl;
6161
}
6262
}
6363
}

‎src/AvTranscoder/essenceStream/AvInputVideo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ void AvInputVideo::setProfile( const Profile::ProfileDesc& desc )
159159
try
160160
{
161161
Option& decodeOption = codecContext.getOption( (*it).first );
162-
decodeOption.setValueString( (*it).second );
162+
decodeOption.setString( (*it).second );
163163
}
164164
catch( std::exception& e )
165165
{

‎src/AvTranscoder/essenceStream/AvOutputAudio.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ void AvOutputAudio::setProfile( const Profile::ProfileDesc& desc, const AudioFra
197197
try
198198
{
199199
Option& encodeOption = codecContext.getOption( (*it).first );
200-
encodeOption.setValueString( (*it).second );
200+
encodeOption.setString( (*it).second );
201201
}
202202
catch( std::exception& e )
203203
{
@@ -219,7 +219,7 @@ void AvOutputAudio::setProfile( const Profile::ProfileDesc& desc, const AudioFra
219219
try
220220
{
221221
Option& encodeOption = codecContext.getOption( (*it).first );
222-
encodeOption.setValueString( (*it).second );
222+
encodeOption.setString( (*it).second );
223223
}
224224
catch( std::exception& e )
225225
{

‎src/AvTranscoder/essenceStream/AvOutputVideo.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ void AvOutputVideo::setProfile( const Profile::ProfileDesc& desc, const avtransc
203203
try
204204
{
205205
Option& encodeOption = codecContext.getOption( (*it).first );
206-
encodeOption.setValueString( (*it).second );
206+
encodeOption.setString( (*it).second );
207207
}
208208
catch( std::exception& e )
209209
{
@@ -226,7 +226,7 @@ void AvOutputVideo::setProfile( const Profile::ProfileDesc& desc, const avtransc
226226
try
227227
{
228228
Option& encodeOption = codecContext.getOption( (*it).first );
229-
encodeOption.setValueString( (*it).second );
229+
encodeOption.setString( (*it).second );
230230
}
231231
catch( std::exception& e )
232232
{

‎src/AvTranscoder/file/InputFile.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ void InputFile::setProfile( const Profile::ProfileDesc& desc )
225225
try
226226
{
227227
Option& formatOption = formatContext.getOption( (*it).first );
228-
formatOption.setValueString( (*it).second );
228+
formatOption.setString( (*it).second );
229229
}
230230
catch( std::exception& e )
231231
{

‎src/AvTranscoder/file/OutputFile.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ void OutputFile::setProfile( const Profile::ProfileDesc& desc )
248248
try
249249
{
250250
Option& formatOption = formatContext.getOption( (*it).first );
251-
formatOption.setValueString( (*it).second );
251+
formatOption.setString( (*it).second );
252252
}
253253
catch( std::exception& e )
254254
{
@@ -269,7 +269,7 @@ void OutputFile::setProfile( const Profile::ProfileDesc& desc )
269269
try
270270
{
271271
Option& formatOption = formatContext.getOption( (*it).first );
272-
formatOption.setValueString( (*it).second );
272+
formatOption.setString( (*it).second );
273273
}
274274
catch( std::exception& e )
275275
{

‎src/AvTranscoder/option/Option.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,27 +66,27 @@ EOptionBaseType Option::getType() const
6666
return _type;
6767
}
6868

69-
bool Option::getDefaultValueBool() const
69+
bool Option::getDefaultBool() const
7070
{
7171
return _avOption->default_val.i64;
7272
}
7373

74-
int Option::getDefaultValueInt() const
74+
int Option::getDefaultInt() const
7575
{
7676
return _avOption->default_val.i64;
7777
}
7878

79-
double Option::getDefaultValueDouble() const
79+
double Option::getDefaultDouble() const
8080
{
8181
return _avOption->default_val.dbl;
8282
}
8383

84-
std::string Option::getDefaultValueString() const
84+
std::string Option::getDefaultString() const
8585
{
8686
return std::string( _avOption->default_val.str ? _avOption->default_val.str : "" );
8787
}
8888

89-
std::pair<int, int> Option::getDefaultValueRatio() const
89+
std::pair<int, int> Option::getDefaultRatio() const
9090
{
9191
return std::pair<int, int>( _avOption->default_val.q.num, _avOption->default_val.q.den );
9292
}
@@ -116,7 +116,7 @@ void Option::setFlag( const std::string& flag, const bool enable )
116116
}
117117
}
118118

119-
void Option::setValueBool( const bool value )
119+
void Option::setBool( const bool value )
120120
{
121121
int error = av_opt_set_int( _avContext, getName().c_str(), value, AV_OPT_SEARCH_CHILDREN );
122122
if( ! error )
@@ -127,7 +127,7 @@ void Option::setValueBool( const bool value )
127127
}
128128
}
129129

130-
void Option::setValueInt( const int value )
130+
void Option::setInt( const int value )
131131
{
132132
int error = av_opt_set_int( _avContext, getName().c_str(), value, AV_OPT_SEARCH_CHILDREN );
133133
if( ! error )
@@ -140,7 +140,7 @@ void Option::setValueInt( const int value )
140140
}
141141
}
142142

143-
void Option::setValueRatio( const int num, const int den )
143+
void Option::setRatio( const int num, const int den )
144144
{
145145
Rational ratio;
146146
ratio.num = num;
@@ -156,7 +156,7 @@ void Option::setValueRatio( const int num, const int den )
156156
}
157157
}
158158

159-
void Option::setValueDouble( const double value )
159+
void Option::setDouble( const double value )
160160
{
161161
int error = av_opt_set_double( _avContext, getName().c_str(), value, AV_OPT_SEARCH_CHILDREN );
162162
if( ! error )
@@ -169,7 +169,7 @@ void Option::setValueDouble( const double value )
169169
}
170170
}
171171

172-
void Option::setValueString( const std::string& value )
172+
void Option::setString( const std::string& value )
173173
{
174174
int error = av_opt_set( _avContext, getName().c_str(), value.c_str(), AV_OPT_SEARCH_CHILDREN );
175175
if( ! error )

‎src/AvTranscoder/option/Option.hpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -55,20 +55,20 @@ class Option
5555
bool isVideoOpt() const { return _avOption->flags & AV_OPT_FLAG_VIDEO_PARAM; }
5656
bool isSubtitleOpt() const { return _avOption->flags & AV_OPT_FLAG_SUBTITLE_PARAM; }
5757

58-
// default value
59-
bool getDefaultValueBool() const;
60-
int getDefaultValueInt() const;
61-
double getDefaultValueDouble() const;
62-
std::string getDefaultValueString() const;
63-
std::pair<int, int> getDefaultValueRatio() const;
58+
// get default value
59+
bool getDefaultBool() const;
60+
int getDefaultInt() const;
61+
double getDefaultDouble() const;
62+
std::string getDefaultString() const;
63+
std::pair<int, int> getDefaultRatio() const;
6464

65-
// setters
65+
// set value
6666
void setFlag( const std::string& flag, const bool enable );
67-
void setValueBool( const bool value );
68-
void setValueInt( const int value );
69-
void setValueRatio( const int num, const int den );
70-
void setValueDouble( const double value );
71-
void setValueString( const std::string& value );
67+
void setBool( const bool value );
68+
void setInt( const int value );
69+
void setRatio( const int num, const int den );
70+
void setDouble( const double value );
71+
void setString( const std::string& value );
7272

7373
// array of childs
7474
bool hasChild() const { return _childOptions.size(); }

‎src/AvTranscoder/option/context.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ void Context::loadOptions( void* av_class, int req_flags )
7676
// child of a Choice
7777
if( parentOption.getType() == eOptionBaseTypeChoice )
7878
{
79-
if( itOption->getDefaultValueInt() == parentOption.getDefaultValueInt() )
79+
if( itOption->getDefaultInt() == parentOption.getDefaultInt() )
8080
parentOption.setDefaultChildIndex( parentOption.getChilds().size() - 1 );
8181
}
8282

0 commit comments

Comments
 (0)