File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -105,6 +105,18 @@ AVSampleFormat getAVSampleFormat(const std::string& sampleFormat)
105
105
return av_get_sample_fmt (sampleFormat.c_str ());
106
106
}
107
107
108
+ std::string getPixelFormatName (const AVPixelFormat pixelFormat)
109
+ {
110
+ const char * formatName = av_get_pix_fmt_name (pixelFormat);
111
+ return formatName ? std::string (formatName) : " " ;
112
+ }
113
+
114
+ std::string getSampleFormatName (const AVSampleFormat sampleFormat)
115
+ {
116
+ const char * formatName = av_get_sample_fmt_name (sampleFormat);
117
+ return formatName ? std::string (formatName) : " " ;
118
+ }
119
+
108
120
NamesArray getFormatsNames ()
109
121
{
110
122
NamesArray formatsNames;
Original file line number Diff line number Diff line change @@ -50,6 +50,18 @@ AVPixelFormat AvExport getAVPixelFormat(const std::string& pixelFormat);
50
50
*/
51
51
AVSampleFormat AvExport getAVSampleFormat (const std::string& sampleFormat);
52
52
53
+ /* *
54
+ * @return The name of the given pixel format.
55
+ * @note Returns an empty string if the format is not found.
56
+ */
57
+ std::string AvExport getPixelFormatName (const AVPixelFormat pixelFormat);
58
+
59
+ /* *
60
+ * @return The name of the given sample format.
61
+ * @note Returns an empty string if the format is not found.
62
+ */
63
+ std::string AvExport getSampleFormatName (const AVSampleFormat sampleFormat);
64
+
53
65
#ifndef SWIG
54
66
/* *
55
67
* @brief Get array of short/long names of all format supported by FFmpeg / libav.
You can’t perform that action at this time.
0 commit comments