File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -352,4 +352,14 @@ std::vector<std::string> OptionLoader::getSampleFormats( const std::string& audi
352
352
return sampleFormats;
353
353
}
354
354
355
+ AVPixelFormat OptionLoader::getAVPixelFormat ( const std::string& pixelFormat )
356
+ {
357
+ return av_get_pix_fmt ( pixelFormat.c_str () );
358
+ }
359
+
360
+ AVSampleFormat OptionLoader::getAVSampleFormat ( const std::string& sampleFormat )
361
+ {
362
+ return av_get_sample_fmt ( sampleFormat.c_str () );
363
+ }
364
+
355
365
}
Original file line number Diff line number Diff line change @@ -74,6 +74,18 @@ class OptionLoader
74
74
*/
75
75
static std::vector<std::string> getSampleFormats ( const std::string& audioCodecName = " " );
76
76
77
+ /* *
78
+ * @brief Get the corresponding AVPixelFormat from the pixel format name
79
+ * @param pixelFormat the name of the pixel format
80
+ */
81
+ static AVPixelFormat getAVPixelFormat ( const std::string& pixelFormat );
82
+
83
+ /* *
84
+ * @brief Get the corresponding AVSampleFormat from the sample format name
85
+ * @param sampleFormat the name of the sample format
86
+ */
87
+ static AVSampleFormat getAVSampleFormat ( const std::string& sampleFormat );
88
+
77
89
private:
78
90
/* *
79
91
* @brief: load array of Option depending on the flags.
You can’t perform that action at this time.
0 commit comments