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.
12 #include "cores/VideoPlayer/DVDCodecs/Audio/DVDAudioCodec.h"
13 #include "cores/VideoPlayer/DVDDemuxers/DVDDemux.h"
14 #include "cores/VideoPlayer/DVDInputStreams/DVDInputStream.h"
21 class VideoPlayerCodec
: public ICodec
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
;
35 AEAudioFormat
GetFormat();
36 void SetContentType(const std::string
&strContent
);
38 bool NeedConvert(AEDataFormat fmt
);
39 void SetPassthroughStreamType(CAEStreamInfo::DataType streamType
);
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
{};
59 bool m_needConvert
{false};
60 AEAudioFormat m_srcFormat
{};
63 std::unique_ptr
<CProcessInfo
> m_processInfo
;