diff --git a/src/stream/DemuxStream.h b/src/stream/DemuxStream.h index fb03e322..2869fce1 100644 --- a/src/stream/DemuxStream.h +++ b/src/stream/DemuxStream.h @@ -112,6 +112,7 @@ class DemuxStreamVideo : public DemuxStream int iOrientation = 0; // orientation of the video in degrees counter clockwise int iBitsPerPixel = 0; int iBitRate = 0; + int iBitDepth = 0; AVColorSpace colorSpace = AVCOL_SPC_UNSPECIFIED; AVColorRange colorRange = AVCOL_RANGE_UNSPECIFIED; diff --git a/src/stream/FFmpegStream.cpp b/src/stream/FFmpegStream.cpp index 216b54b9..1ac99467 100644 --- a/src/stream/FFmpegStream.cpp +++ b/src/stream/FFmpegStream.cpp @@ -41,6 +41,11 @@ extern "C" { using namespace ffmpegdirect; using namespace kodi::tools; +extern "C" +{ +#include "libavutil/pixdesc.h" +} + /*********************************************************** * InputSteam Client AddOn specific public library functions ***********************************************************/ @@ -2033,6 +2038,11 @@ DemuxStream* FFmpegStream::AddStream(int streamIdx) st->iOrientation = 0; st->iBitsPerPixel = pStream->codecpar->bits_per_coded_sample; st->iBitRate = static_cast(pStream->codecpar->bit_rate); + st->bitDepth = 8; + const AVPixFmtDescriptor* desc = + av_pix_fmt_desc_get(static_cast(pStream->codecpar->format)); + if (desc != nullptr && desc->comp != nullptr) + st->bitDepth = desc->comp[0].depth; st->colorPrimaries = pStream->codecpar->color_primaries; st->colorSpace = pStream->codecpar->color_space;