Merge pull request #26273 from 78andyp/blurayfixes2
[xbmc.git] / xbmc / cores / paplayer / VideoPlayerCodec.h
blobf2eecd11fb9443131ffcc94ccc0b0a6893a721da
1 /*
2 * Copyright (C) 2005-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
7 */
9 #pragma once
11 #include "ICodec.h"
12 #include "cores/VideoPlayer/DVDCodecs/Audio/DVDAudioCodec.h"
13 #include "cores/VideoPlayer/DVDDemuxers/DVDDemux.h"
14 #include "cores/VideoPlayer/DVDInputStreams/DVDInputStream.h"
16 namespace ActiveAE
18 class IAEResample;
21 class VideoPlayerCodec : public ICodec
23 public:
24 VideoPlayerCodec();
25 ~VideoPlayerCodec() override;
27 bool Init(const CFileItem &file, unsigned int filecache) override;
28 bool Seek(int64_t iSeekTime) override;
29 int ReadPCM(uint8_t* pBuffer, size_t size, size_t* actualsize) override;
30 int ReadRaw(uint8_t **pBuffer, int *bufferSize) override;
31 bool CanInit() override;
32 bool CanSeek() override;
34 void DeInit();
35 AEAudioFormat GetFormat();
36 void SetContentType(const std::string &strContent);
38 bool NeedConvert(AEDataFormat fmt);
39 void SetPassthroughStreamType(CAEStreamInfo::DataType streamType);
41 private:
42 CAEStreamInfo::DataType GetPassthroughStreamType(AVCodecID codecId, int samplerate, int profile);
44 CDVDDemux* m_pDemuxer{nullptr};
45 std::shared_ptr<CDVDInputStream> m_pInputStream;
46 std::unique_ptr<CDVDAudioCodec> m_pAudioCodec;
48 std::string m_strContentType;
49 std::string m_strFileName;
50 int m_nAudioStream{-1};
51 size_t m_nDecodedLen{0};
53 bool m_bInited{false};
54 bool m_bCanSeek{false};
56 std::unique_ptr<ActiveAE::IAEResample> m_pResampler;
57 DVDAudioFrame m_audioFrame{};
58 int m_planes{0};
59 bool m_needConvert{false};
60 AEAudioFormat m_srcFormat{};
61 int m_channels{0};
63 std::unique_ptr<CProcessInfo> m_processInfo;