File tree Expand file tree Collapse file tree 5 files changed +36
-2
lines changed
src/AvTranscoder/mediaProperty Expand file tree Collapse file tree 5 files changed +36
-2
lines changed Original file line number Diff line number Diff line change @@ -231,4 +231,19 @@ PropertyVector AudioProperties::getPropertiesAsVector() const
231
231
return data;
232
232
}
233
233
234
+ PropertyMap AudioProperties::getPropertiesAsMap () const
235
+ {
236
+ PropertyMap dataMap;
237
+
238
+ PropertyVector dataVector ( 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
+
234
249
}
Original file line number Diff line number Diff line change @@ -42,7 +42,8 @@ class AvExport AudioProperties
42
42
AVCodecContext& getAVCodecContext () { return *_codecContext; }
43
43
#endif
44
44
45
- PropertyVector getPropertiesAsVector () const ; // /< Return all audio properties as a vector (name of property: value)
45
+ PropertyMap getPropertiesAsMap () const ; // /< Return all audio properties as a map (name of property, value)
46
+ PropertyVector getPropertiesAsVector () const ; // /< Same data with a specific order
46
47
47
48
private:
48
49
#ifndef SWIG
Original file line number Diff line number Diff line change @@ -696,4 +696,19 @@ PropertyVector VideoProperties::getPropertiesAsVector() const
696
696
return data;
697
697
}
698
698
699
+ PropertyMap VideoProperties::getPropertiesAsMap () const
700
+ {
701
+ PropertyMap dataMap;
702
+
703
+ PropertyVector dataVector ( 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
+
699
714
}
Original file line number Diff line number Diff line change @@ -83,7 +83,8 @@ class AvExport VideoProperties
83
83
const PixelProperties& getPixelProperties () const { return _pixelProperties; }
84
84
#endif
85
85
86
- PropertyVector getPropertiesAsVector () const ; // /< Return all video and pixel properties as a vector (name of property: value)
86
+ PropertyMap getPropertiesAsMap () const ; // /< Return all video and pixel properties as a map (name of property, value)
87
+ PropertyVector getPropertiesAsVector () const ; // /< Same data with a specific order
87
88
88
89
private:
89
90
/* *
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ extern "C" {
9
9
10
10
#include < vector>
11
11
#include < utility>
12
+ #include < map>
12
13
#include < string>
13
14
#include < sstream>
14
15
@@ -19,6 +20,7 @@ namespace avtranscoder
19
20
* @brief PropertyVector is a vector of pair, because the order of properties matters to us.
20
21
*/
21
22
typedef std::vector< std::pair<std::string, std::string> > PropertyVector;
23
+ typedef std::map< std::string, std::string > PropertyMap;
22
24
23
25
namespace detail
24
26
{
You can’t perform that action at this time.
0 commit comments