File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed
src/AvTranscoder/mediaProperty Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,15 @@ std::string PixelProperties::getPixelName() const
35
35
return " unknown pixel name" ;
36
36
}
37
37
38
+ std::string PixelProperties::getPixelFormatName () const
39
+ {
40
+ if ( ! _pixelFormat )
41
+ throw std::runtime_error ( " unable to find pixel format." );
42
+
43
+ const char * formatName = av_get_pix_fmt_name ( _pixelFormat );
44
+ return formatName ? std::string ( formatName ) : " unknown pixel format" ;
45
+ }
46
+
38
47
size_t PixelProperties::getBitsPerPixel () const
39
48
{
40
49
if ( ! _pixelDesc )
@@ -214,6 +223,7 @@ PropertiesMap PixelProperties::getPropertiesAsMap() const
214
223
PropertiesMap dataMap;
215
224
216
225
detail::add ( dataMap, " pixelName" , getPixelName () );
226
+ detail::add ( dataMap, " pixelFormatName" , getPixelFormatName () );
217
227
detail::add ( dataMap, " bitDepth" , getBitsPerPixel () );
218
228
detail::add ( dataMap, " nbComponents" , getNbComponents () );
219
229
detail::add ( dataMap, " chromaWidth" , getChromaWidth () );
Original file line number Diff line number Diff line change @@ -53,6 +53,7 @@ class AvExport PixelProperties
53
53
PixelProperties ( const AVPixelFormat avPixelFormat );
54
54
55
55
std::string getPixelName () const ;
56
+ std::string getPixelFormatName () const ;
56
57
57
58
size_t getBitsPerPixel () const ;
58
59
size_t getNbComponents () const ;
You can’t perform that action at this time.
0 commit comments