Skip to content

Commit

Permalink
VideoPlayer: VAAPI - Add av1 hw decoding
Browse files Browse the repository at this point in the history
  • Loading branch information
phunkyfish committed Jan 29, 2024
1 parent d3ff90d commit 4b86259
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/stream/DemuxStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
10 changes: 10 additions & 0 deletions src/stream/FFmpegStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
***********************************************************/
Expand Down Expand Up @@ -2033,6 +2038,11 @@ DemuxStream* FFmpegStream::AddStream(int streamIdx)
st->iOrientation = 0;
st->iBitsPerPixel = pStream->codecpar->bits_per_coded_sample;
st->iBitRate = static_cast<int>(pStream->codecpar->bit_rate);
st->bitDepth = 8;
const AVPixFmtDescriptor* desc =
av_pix_fmt_desc_get(static_cast<AVPixelFormat>(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;
Expand Down

0 comments on commit 4b86259

Please sign in to comment.