forked from avTranscoder/avTranscoder
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutil.hpp
More file actions
126 lines (105 loc) · 3.86 KB
/
util.hpp
File metadata and controls
126 lines (105 loc) · 3.86 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
#ifndef _AV_TRANSCODER_UTIL_HPP
#define _AV_TRANSCODER_UTIL_HPP
#include "common.hpp"
#include "Option.hpp"
extern "C" {
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include <libavutil/pixfmt.h>
#include <libavutil/samplefmt.h>
}
#include <string>
#include <vector>
#include <map>
namespace avtranscoder
{
typedef std::map<std::string, OptionArray> OptionArrayMap;
typedef std::map<std::string, std::string> NamesMap; //< short/long names of format/video codec/audio codec
/**
* @brief Get pixel format supported by a video codec.
* @param videoCodecName: the video codec name (empty if not indicated, and so get all pixel formats supported by all video
* codecs).
*/
std::vector<std::string> AvExport getSupportedPixelFormats(const std::string& videoCodecName = "");
/**
* @brief Get sample format supported by an audio codec.
* @param audioCodecName: the audio codec name (empty if not indicated, and so get all sample formats supported by all audio
* codecs).
*/
std::vector<std::string> AvExport getSupportedSampleFormats(const std::string& audioCodecName = "");
/**
* @brief Get the corresponding AVPixelFormat from the pixel format name
* @param pixelFormat: the name of the pixel format
*/
AVPixelFormat AvExport getAVPixelFormat(const std::string& pixelFormat);
/**
* @brief Get the corresponding AVSampleFormat from the sample format name
* @param sampleFormat: the name of the sample format
*/
AVSampleFormat AvExport getAVSampleFormat(const std::string& sampleFormat);
/**
* @return The name of the given pixel format.
* @note Returns an empty string if the format is not found.
*/
std::string AvExport getPixelFormatName(const AVPixelFormat pixelFormat);
/**
* @return The name of the given sample format.
* @note Returns an empty string if the format is not found.
*/
std::string AvExport getSampleFormatName(const AVSampleFormat sampleFormat);
#ifndef SWIG
/**
* @return The list of all formats available in FFmpeg / libav.
*/
std::vector<const AVOutputFormat*> getAvailableFormats();
#endif
/**
* @brief Get a map of short/long names of all formats available in FFmpeg / libav.
* @note Need to call preloadCodecsAndFormats before using this function.
*/
NamesMap AvExport getAvailableFormatsNames();
/**
* @brief Get a map of short/long names of all formats dedicate for video available in FFmpeg / libav.
* @note Need to call preloadCodecsAndFormats before using this function.
*/
NamesMap AvExport getAvailableVideoFormatsNames();
/**
* @brief Get a map of short/long names of all formats dedicate for video available in FFmpeg / libav.
* @note Need to call preloadCodecsAndFormats before using this function.
*/
NamesMap AvExport getAvailableAudioFormatsNames();
#ifndef SWIG
/**
* @return The list of all codecs available in FFmpeg / libav.
*/
std::vector<const AVCodec*> getAvailableCodecs();
#endif
/**
* @brief Get a map of short/long names of all video codecs available in FFmpeg / libav.
* @note Need to call preloadCodecsAndFormats before using this function.
*/
NamesMap AvExport getAvailableVideoCodecsNames();
/**
* @brief Get a map of short/long names of all audio codecs available in FFmpeg / libav.
* @note Need to call preloadCodecsAndFormats before using this function.
*/
NamesMap AvExport getAvailableAudioCodecsNames();
#ifndef SWIG
/**
* @brief Get the list of options for each output format
* @note Need to call preloadCodecsAndFormats before using this function.
*/
OptionArrayMap AvExport getAvailableOptionsPerOutputFormat();
/**
* @brief Get the list of options for each video codec
* @note Need to call preloadCodecsAndFormats before using this function.
*/
OptionArrayMap AvExport getAvailableOptionsPerVideoCodec();
/**
* @brief Get the list of options for each audio codec
* @note Need to call preloadCodecsAndFormats before using this function.
*/
OptionArrayMap AvExport getAvailableOptionsPerAudioCodec();
#endif
}
#endif