| 1 |
/* |
| 2 |
* Copyright (C) 2010-2021 Team Kodi (https://kodi.tv) |
| 3 |
* Copyright (C) 2010 Alwin Esch (Team Kodi) |
| 4 |
* |
| 5 |
* SPDX-License-Identifier: GPL-2.0-or-later |
| 6 |
* See LICENSE.md for more information. |
| 7 |
*/ |
| 8 |
|
| 9 |
#pragma once |
| 10 |
|
| 11 |
#include "Session.h" |
| 12 |
|
| 13 |
#include <kodi/addon-instance/pvr/Stream.h> |
| 14 |
#include <map> |
| 15 |
#include <string> |
| 16 |
|
| 17 |
class cResponsePacket; |
| 18 |
|
| 19 |
class ATTR_DLL_LOCAL CVNSIDemuxStatus : public cVNSISession |
| 20 |
{ |
| 21 |
public: |
| 22 |
CVNSIDemuxStatus(kodi::addon::CInstancePVRClient& instance); |
| 23 |
~CVNSIDemuxStatus() override = default; |
| 24 |
|
| 25 |
int GetSocket(); |
| 26 |
void ReleaseServerClient(); |
| 27 |
std::unique_ptr<cResponsePacket> ReadStatus(); |
| 28 |
bool IsConnected(); |
| 29 |
}; |
| 30 |
|
| 31 |
class ATTR_DLL_LOCAL cVNSIDemux : public cVNSISession |
| 32 |
{ |
| 33 |
public: |
| 34 |
cVNSIDemux(kodi::addon::CInstancePVRClient& instance); |
| 35 |
~cVNSIDemux() override; |
| 36 |
|
| 37 |
void Close() override; |
| 38 |
bool OpenChannel(const kodi::addon::PVRChannel& channelinfo); |
| 39 |
void Abort(); |
| 40 |
bool GetStreamProperties(std::vector<kodi::addon::PVRStreamProperties>& props); |
| 41 |
DEMUX_PACKET* Read(); |
| 42 |
bool SwitchChannel(const kodi::addon::PVRChannel& channelinfo); |
| 43 |
int CurrentChannel() { return m_channelinfo.GetChannelNumber(); } |
| 44 |
bool GetSignalStatus(kodi::addon::PVRSignalStatus& qualityinfo); |
| 45 |
bool IsTimeshift() { return m_bTimeshift; } |
| 46 |
bool SeekTime(int time, bool backwards, double& startpts); |
| 47 |
bool GetStreamTimes(kodi::addon::PVRStreamTimes& times); |
| 48 |
|
| 49 |
protected: |
| 50 |
void StreamChange(cResponsePacket* resp); |
| 51 |
void StreamStatus(cResponsePacket* resp); |
| 52 |
void StreamSignalInfo(cResponsePacket* resp); |
| 53 |
bool StreamContentInfo(cResponsePacket* resp); |
| 54 |
void ReadStatus(); |
| 55 |
|
| 56 |
std::vector<kodi::addon::PVRStreamProperties> m_streams; |
| 57 |
kodi::addon::PVRChannel m_channelinfo; |
| 58 |
kodi::addon::PVRSignalStatus m_Quality; |
| 59 |
bool m_bTimeshift = false; |
| 60 |
uint32_t m_MuxPacketSerial = 0; |
| 61 |
time_t m_ReferenceTime = 0; |
| 62 |
double m_ReferenceDTS = 0.0; |
| 63 |
double m_minPTS = 0.0; |
| 64 |
double m_maxPTS = 0.0; |
| 65 |
CVNSIDemuxStatus m_statusCon; |
| 66 |
time_t m_lastStatus = 0; |
| 67 |
|
| 68 |
kodi::addon::CInstancePVRClient& m_instance; |
| 69 |
}; |