File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed
src/AvTranscoder/mediaProperty Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,21 @@ size_t PixelProperties::getBitsPerPixel() const
56
56
return av_get_bits_per_pixel ( _pixelDesc );
57
57
}
58
58
59
+ size_t PixelProperties::getMaxBitPerChannel () const
60
+ {
61
+ if ( ! _pixelDesc )
62
+ throw std::runtime_error ( " unable to find pixel description." );
63
+
64
+ size_t maxBitPerChannel = 0 ;
65
+ for ( unsigned int channelIndex = 0 ; channelIndex < _pixelDesc->nb_components ; ++channelIndex )
66
+ {
67
+ const size_t nbBits = _pixelDesc->comp [channelIndex].depth_minus1 + 1 ;
68
+ if ( nbBits > maxBitPerChannel )
69
+ maxBitPerChannel = nbBits;
70
+ }
71
+ return maxBitPerChannel;
72
+ }
73
+
59
74
size_t PixelProperties::getNbComponents () const
60
75
{
61
76
if ( ! _pixelDesc )
Original file line number Diff line number Diff line change @@ -56,6 +56,7 @@ class AvExport PixelProperties
56
56
std::string getPixelFormatName () const ;
57
57
58
58
size_t getBitsPerPixel () const ;
59
+ size_t getMaxBitPerChannel () const ;
59
60
size_t getNbComponents () const ;
60
61
size_t getChromaWidth () const ;
61
62
size_t getChromaHeight () const ;
You can’t perform that action at this time.
0 commit comments