Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita5ceb7f

Browse files
author
Clement Champetier
committed
mediaProperty: can get video and audio properties by a vector or a map
Fix#141
1 parentc0aed47 commita5ceb7f

File tree

5 files changed

+36
-2
lines changed

5 files changed

+36
-2
lines changed

‎src/AvTranscoder/mediaProperty/AudioProperties.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,4 +231,19 @@ PropertyVector AudioProperties::getPropertiesAsVector() const
231231
return data;
232232
}
233233

234+
PropertyMapAudioProperties::getPropertiesAsMap()const
235+
{
236+
PropertyMap dataMap;
237+
238+
PropertyVectordataVector(getPropertiesAsVector() );
239+
for( PropertyVector::const_iterator it = dataVector.begin();
240+
it != dataVector.end();
241+
++it )
242+
{
243+
dataMap.insert(std::make_pair( it->first, it->second ) );
244+
}
245+
246+
return dataMap;
247+
}
248+
234249
}

‎src/AvTranscoder/mediaProperty/AudioProperties.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ class AvExport AudioProperties
4242
AVCodecContext&getAVCodecContext() {return *_codecContext; }
4343
#endif
4444

45-
PropertyVectorgetPropertiesAsVector()const;///< Return all audio properties as a vector (name of property: value)
45+
PropertyMapgetPropertiesAsMap()const;///< Return all audio properties as a map (name of property, value)
46+
PropertyVectorgetPropertiesAsVector()const;///< Same data with a specific order
4647

4748
private:
4849
#ifndef SWIG

‎src/AvTranscoder/mediaProperty/VideoProperties.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -696,4 +696,19 @@ PropertyVector VideoProperties::getPropertiesAsVector() const
696696
return data;
697697
}
698698

699+
PropertyMapVideoProperties::getPropertiesAsMap()const
700+
{
701+
PropertyMap dataMap;
702+
703+
PropertyVectordataVector(getPropertiesAsVector() );
704+
for( PropertyVector::const_iterator it = dataVector.begin();
705+
it != dataVector.end();
706+
++it )
707+
{
708+
dataMap.insert(std::make_pair( it->first, it->second ) );
709+
}
710+
711+
return dataMap;
712+
}
713+
699714
}

‎src/AvTranscoder/mediaProperty/VideoProperties.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ class AvExport VideoProperties
8383
const PixelProperties&getPixelProperties()const {return _pixelProperties; }
8484
#endif
8585

86-
PropertyVectorgetPropertiesAsVector()const;///< Return all video and pixel properties as a vector (name of property: value)
86+
PropertyMapgetPropertiesAsMap()const;///< Return all video and pixel properties as a map (name of property, value)
87+
PropertyVectorgetPropertiesAsVector()const;///< Same data with a specific order
8788

8889
private:
8990
/**

‎src/AvTranscoder/mediaProperty/util.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ extern "C" {
99

1010
#include<vector>
1111
#include<utility>
12+
#include<map>
1213
#include<string>
1314
#include<sstream>
1415

@@ -19,6 +20,7 @@ namespace avtranscoder
1920
* @brief PropertyVector is a vector of pair, because the order of properties matters to us.
2021
*/
2122
typedef std::vector< std::pair<std::string, std::string> > PropertyVector;
23+
typedef std::map< std::string, std::string > PropertyMap;
2224

2325
namespacedetail
2426
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp