[videodb] remove unused seasons table from episode_view
[xbmc.git] / xbmc / cores / VideoPlayer / IVideoPlayer.h
blobcf30266692fdbdcef6561dc1b4c05380984b1232
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 "DVDClock.h"
13 #include <string>
14 #include <utility>
15 #include <vector>
17 #define VideoPlayer_AUDIO 1
18 #define VideoPlayer_VIDEO 2
19 #define VideoPlayer_SUBTITLE 3
20 #define VideoPlayer_TELETEXT 4
21 #define VideoPlayer_RDS 5
22 #define VideoPlayer_ID3 6
24 class CDVDMsg;
25 class CDVDStreamInfo;
26 class CProcessInfo;
28 class IVideoPlayer
30 public:
31 virtual int OnDiscNavResult(void* pData, int iMessage) = 0;
32 virtual void GetVideoResolution(unsigned int &width, unsigned int &height) = 0;
33 virtual ~IVideoPlayer() = default;
36 class IDVDStreamPlayer
38 public:
39 explicit IDVDStreamPlayer(CProcessInfo& processInfo) : m_processInfo(processInfo) {}
40 virtual ~IDVDStreamPlayer() = default;
41 virtual bool OpenStream(CDVDStreamInfo hint) = 0;
42 virtual void CloseStream(bool bWaitForBuffers) = 0;
43 virtual void SendMessage(std::shared_ptr<CDVDMsg> pMsg, int priority = 0) = 0;
44 virtual void FlushMessages() = 0;
45 virtual bool IsInited() const = 0;
46 virtual bool AcceptsData() const = 0;
47 virtual bool IsStalled() const = 0;
49 enum ESyncState
51 SYNC_STARTING,
52 SYNC_WAITSYNC,
53 SYNC_INSYNC
55 protected:
56 CProcessInfo &m_processInfo;
59 struct SStartMsg
61 double timestamp;
62 int player;
63 double cachetime;
64 double cachetotal;
67 struct SStateMsg
69 IDVDStreamPlayer::ESyncState syncState;
70 int player;
73 class CDVDVideoCodec;
75 class IDVDStreamPlayerVideo : public IDVDStreamPlayer
77 public:
78 explicit IDVDStreamPlayerVideo(CProcessInfo& processInfo) : IDVDStreamPlayer(processInfo) {}
79 ~IDVDStreamPlayerVideo() override = default;
80 bool OpenStream(CDVDStreamInfo hint) override = 0;
81 void CloseStream(bool bWaitForBuffers) override = 0;
82 virtual void Flush(bool sync) = 0;
83 bool AcceptsData() const override = 0;
84 virtual bool HasData() const = 0;
85 bool IsInited() const override = 0;
86 void SendMessage(std::shared_ptr<CDVDMsg> pMsg, int priority = 0) override = 0;
87 virtual void EnableSubtitle(bool bEnable) = 0;
88 virtual bool IsSubtitleEnabled() = 0;
89 virtual double GetSubtitleDelay() = 0;
90 virtual void SetSubtitleDelay(double delay) = 0;
91 bool IsStalled() const override = 0;
92 virtual bool IsRewindStalled() const { return false; }
93 virtual double GetCurrentPts() = 0;
94 virtual double GetOutputDelay() = 0;
95 virtual std::string GetPlayerInfo() = 0;
96 virtual int GetVideoBitrate() = 0;
97 virtual void SetSpeed(int iSpeed) = 0;
98 virtual bool IsEOS() { return false; }
101 class CDVDAudioCodec;
102 class IDVDStreamPlayerAudio : public IDVDStreamPlayer
104 public:
105 explicit IDVDStreamPlayerAudio(CProcessInfo& processInfo) : IDVDStreamPlayer(processInfo) {}
106 ~IDVDStreamPlayerAudio() override = default;
107 bool OpenStream(CDVDStreamInfo hints) override = 0;
108 void CloseStream(bool bWaitForBuffers) override = 0;
109 virtual void SetSpeed(int speed) = 0;
110 virtual void Flush(bool sync) = 0;
111 bool AcceptsData() const override = 0;
112 virtual bool HasData() const = 0;
113 virtual int GetLevel() const = 0;
114 bool IsInited() const override = 0;
115 void SendMessage(std::shared_ptr<CDVDMsg> pMsg, int priority = 0) override = 0;
116 virtual void SetVolume(float fVolume) {}
117 virtual void SetMute(bool bOnOff) {}
118 virtual void SetDynamicRangeCompression(long drc) = 0;
119 virtual std::string GetPlayerInfo() = 0;
120 virtual int GetAudioChannels() = 0;
121 virtual double GetCurrentPts() = 0;
122 bool IsStalled() const override = 0;
123 virtual bool IsPassthrough() const = 0;
124 virtual float GetDynamicRangeAmplification() const = 0;
125 virtual bool IsEOS() { return false; }