forked from avTranscoder/avTranscoder
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProfileLoader.hpp
More file actions
88 lines (72 loc) · 2.61 KB
/
Copy pathProfileLoader.hpp
File metadata and controls
88 lines (72 loc) · 2.61 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#ifndef _AV_TRANSCODER_PROFILE_HPP_
#define _AV_TRANSCODER_PROFILE_HPP_
#include <AvTranscoder/common.hpp>
#include <string>
#include <vector>
#include <map>
#include <iostream>
namespace avtranscoder
{
namespace constants
{
const std::string avProfileIdentificator = "avProfileName";
const std::string avProfileIdentificatorHuman = "avProfileLongName";
const std::string avProfileType = "avProfileType";
const std::string avProfileTypeFormat = "avProfileTypeFormat";
const std::string avProfileTypeVideo = "avProfileTypeVideo";
const std::string avProfileTypeAudio = "avProfileTypeAudio";
const std::string avProfileFormat = "format";
const std::string avProfileCodec = "codec";
const std::string avProfilePixelFormat = "pix_fmt";
const std::string avProfileSampleFormat = "sample_fmt";
const std::string avProfileFrameRate = "r";
const std::string avProfileWidth = "width";
const std::string avProfileHeight = "height";
const std::string avProfileSampleRate = "ar";
const std::string avProfileChannel = "ac";
const std::string avProfileThreads = "threads";
const std::string avProfileProcessStat = "processStat"; ///< Do statistics during the process.
}
class AvExport ProfileLoader
{
public:
typedef std::map<std::string, std::string> Profile;
typedef std::vector<Profile> Profiles;
public:
/**
* @param autoload: load profiles defined as text files at AVPROFILES
*/
ProfileLoader(const bool autoload = true);
/**
* @brief Add profiles from files in avProfilesPath directory
* @param avProfilesPath: if empty, the path is replaced by value of AVPROFILES environment variable
*/
void addProfiles(const std::string& avProfilesPath = "");
/**
* @brief Add the profile defines in the given file
*/
void addProfile(const std::string& avProfileFileName);
/**
* @brief Add the given profile
* @exception throw std::runtime_error if the profile is invalid
*/
void addProfile(const Profile& profile);
bool hasProfile(const Profile& profile) const;
const Profiles& getProfiles() const;
Profiles getFormatProfiles() const;
Profiles getVideoProfiles() const;
Profiles getAudioProfiles() const;
const Profile& getProfile(const std::string& avProfileIdentificator) const;
public:
static bool checkFormatProfile(const Profile& profileToCheck);
static bool checkVideoProfile(const Profile& profileToCheck);
static bool checkAudioProfile(const Profile& profileToCheck);
private:
Profiles _profiles;
};
#ifndef SWIG
// To print a profile
std::ostream& operator<<(std::ostream& os, const ProfileLoader::Profile& profile);
#endif
}
#endif