2 * Copyright (C) 2015-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.
13 #include "guilib/XBTF.h"
14 #include "guilib/XBTFReader.h"
20 #include "PlatformDefs.h"
24 class CXbtFile
: public IFile
30 bool Open(const CURL
& url
) override
;
31 void Close() override
;
32 bool Exists(const CURL
& url
) override
;
34 int64_t GetPosition() override
;
35 int64_t GetLength() override
;
37 int Stat(struct __stat64
* buffer
) override
;
38 int Stat(const CURL
& url
, struct __stat64
* buffer
) override
;
40 ssize_t
Read(void* lpBuf
, size_t uiBufSize
) override
;
41 int64_t Seek(int64_t iFilePosition
, int iWhence
= SEEK_SET
) override
;
43 uint32_t GetImageWidth() const;
44 uint32_t GetImageHeight() const;
45 XB_FMT
GetImageFormat() const;
46 bool HasImageAlpha() const;
49 bool GetFirstFrame(CXBTFFrame
& frame
) const;
51 static bool GetReader(const CURL
& url
, CXBTFReaderPtr
& reader
);
52 static bool GetReaderAndFile(const CURL
& url
, CXBTFReaderPtr
& reader
, CXBTFFile
& file
);
53 static bool GetFile(const CURL
& url
, CXBTFFile
& file
);
57 CXBTFReaderPtr m_xbtfReader
;
60 std::vector
<uint64_t> m_frameStartPositions
;
61 size_t m_frameIndex
= 0;
62 uint64_t m_positionWithinFrame
= 0;
63 int64_t m_positionTotal
= 0;
65 std::vector
<std::vector
<uint8_t>> m_unpackedFrames
;