2 * Copyright (C) 2005-2022 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 #include "DVDMessageQueue.h"
12 #include "IVideoPlayer.h"
13 #include "Interface/TimingConstants.h"
14 #include "threads/CriticalSection.h"
15 #include "threads/Thread.h"
21 #include <taglib/id3v1tag.h>
22 #include <taglib/id3v2tag.h>
23 #include <taglib/tstringlist.h>
25 class CVideoPlayerAudioID3
: public IDVDStreamPlayer
, private CThread
28 explicit CVideoPlayerAudioID3(CProcessInfo
& processInfo
);
29 ~CVideoPlayerAudioID3() override
;
31 bool CheckStream(const CDVDStreamInfo
& hints
);
33 void WaitForBuffers();
35 bool OpenStream(CDVDStreamInfo hints
) override
;
36 void CloseStream(bool bWaitForBuffers
) override
;
37 void SendMessage(std::shared_ptr
<CDVDMsg
> pMsg
, int priority
= 0) override
;
38 void FlushMessages() override
;
39 bool IsInited() const override
;
40 bool AcceptsData() const override
;
41 bool IsStalled() const override
;
44 void OnExit() override
;
45 void Process() override
;
48 void ProcessID3(const unsigned char* data
, unsigned int length
) const;
49 void ProcessID3v1(const TagLib::ID3v1::Tag
* tag
) const;
50 void ProcessID3v2(const TagLib::ID3v2::Tag
* tag
) const;
52 static std::vector
<std::string
> GetID3v2StringList(const TagLib::ID3v2::FrameList
& frameList
);
53 static std::vector
<std::string
> StringListToVectorString(const TagLib::StringList
& stringList
);
55 int m_speed
= DVD_PLAYSPEED_NORMAL
;
56 CCriticalSection m_critSection
;
57 CDVDMessageQueue m_messageQueue
;