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.
11 // FileShoutcast.h: interface for the CShoutcastFile class.
13 //////////////////////////////////////////////////////////////////////
17 #include "threads/Thread.h"
33 class CShoutcastFile
: public IFile
, public CThread
37 ~CShoutcastFile() override
;
38 int64_t GetPosition() override
;
39 int64_t GetLength() override
;
40 bool Open(const CURL
& url
) override
;
41 bool Exists(const CURL
& url
) override
{ return true; }
42 int Stat(const CURL
& url
, struct __stat64
* buffer
) override
47 ssize_t
Read(void* lpBuf
, size_t uiBufSize
) override
;
48 int64_t Seek(int64_t iFilePosition
, int iWhence
= SEEK_SET
) override
;
49 void Close() override
;
50 int IoControl(EIoControl request
, void* param
) override
;
52 void Process() override
;
54 bool ExtractTagInfo(const char* buf
);
55 void ReadTruncated(char* buf2
, int size
);
58 std::string
DecodeToUTF8(const std::string
& str
);
61 std::string m_fileCharset
;
63 int m_discarded
; // data used for tags
65 char* m_buffer
; // buffer used for tags
68 CFileCache
* m_cacheReader
;
70 CCriticalSection m_tagSection
;
71 using TagInfo
= std::pair
<int64_t, std::shared_ptr
<MUSIC_INFO::CMusicInfoTag
>>;
72 std::queue
<TagInfo
> m_tags
; // tagpos, tag
73 std::shared_ptr
<MUSIC_INFO::CMusicInfoTag
> m_masterTag
;