From c04dcc2e7d834218ef2d4194331e383402495ae1 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 10 Apr 2024 20:07:22 +0200 Subject: Adding upstream version 2:20.4+dfsg. Signed-off-by: Daniel Baumann --- xbmc/cores/paplayer/VideoPlayerCodec.h | 65 ++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 xbmc/cores/paplayer/VideoPlayerCodec.h (limited to 'xbmc/cores/paplayer/VideoPlayerCodec.h') diff --git a/xbmc/cores/paplayer/VideoPlayerCodec.h b/xbmc/cores/paplayer/VideoPlayerCodec.h new file mode 100644 index 0000000..08a9c2f --- /dev/null +++ b/xbmc/cores/paplayer/VideoPlayerCodec.h @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2005-2018 Team Kodi + * This file is part of Kodi - https://kodi.tv + * + * SPDX-License-Identifier: GPL-2.0-or-later + * See LICENSES/README.md for more information. + */ + +#pragma once + +#include "ICodec.h" +#include "cores/VideoPlayer/DVDCodecs/Audio/DVDAudioCodec.h" +#include "cores/VideoPlayer/DVDDemuxers/DVDDemux.h" +#include "cores/VideoPlayer/DVDInputStreams/DVDInputStream.h" + +namespace ActiveAE +{ + class IAEResample; +}; + +class VideoPlayerCodec : public ICodec +{ +public: + VideoPlayerCodec(); + ~VideoPlayerCodec() override; + + bool Init(const CFileItem &file, unsigned int filecache) override; + bool Seek(int64_t iSeekTime) override; + int ReadPCM(uint8_t* pBuffer, size_t size, size_t* actualsize) override; + int ReadRaw(uint8_t **pBuffer, int *bufferSize) override; + bool CanInit() override; + bool CanSeek() override; + + void DeInit(); + AEAudioFormat GetFormat(); + void SetContentType(const std::string &strContent); + + bool NeedConvert(AEDataFormat fmt); + void SetPassthroughStreamType(CAEStreamInfo::DataType streamType); + +private: + CAEStreamInfo::DataType GetPassthroughStreamType(AVCodecID codecId, int samplerate, int profile); + + CDVDDemux* m_pDemuxer{nullptr}; + std::shared_ptr m_pInputStream; + std::unique_ptr m_pAudioCodec; + + std::string m_strContentType; + std::string m_strFileName; + int m_nAudioStream{-1}; + size_t m_nDecodedLen{0}; + + bool m_bInited{false}; + bool m_bCanSeek{false}; + + ActiveAE::IAEResample* m_pResampler{nullptr}; + DVDAudioFrame m_audioFrame{}; + int m_planes{0}; + bool m_needConvert{false}; + AEAudioFormat m_srcFormat{}; + int m_channels{0}; + + std::unique_ptr m_processInfo; +}; + -- cgit v1.2.3