forked from mikrosimage/avTranscoder
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutil.cpp
More file actions
40 lines (31 loc) · 848 Bytes
/
Copy pathutil.cpp
File metadata and controls
40 lines (31 loc) · 848 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include "util.hpp"
#include <sstream>
namespace avtranscoder
{
namespace detail
{
template<>
void add( PropertiesMap& propertiesMap, const std::string& key, const std::string& value )
{
propertiesMap.push_back( std::make_pair( key, value ) );
}
template<>
void add( PropertiesMap& propertiesMap, const std::string& key, const bool& value )
{
add( propertiesMap, key, value ? "True" : "False" );
}
template<>
void add( PropertiesMap& propertiesMap, const std::string& key, const Rational& value )
{
add( propertiesMap, key, value.num / (double) value.den );
}
void fillMetadataDictionnary( AVDictionary* avdictionnary, PropertiesMap& metadata )
{
AVDictionaryEntry* tag = NULL;
while( ( tag = av_dict_get( avdictionnary, "", tag, AV_DICT_IGNORE_SUFFIX ) ) )
{
metadata.push_back( std::make_pair( tag->key, tag->value ) );
}
}
}
}