diff options
Diffstat (limited to 'xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxPVRClient.h')
| -rw-r--r-- | xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxPVRClient.h | 118 |
1 files changed, 118 insertions, 0 deletions
diff --git a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxPVRClient.h b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxPVRClient.h new file mode 100644 index 0000000..2fc3c63 --- /dev/null +++ b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxPVRClient.h | |||
| @@ -0,0 +1,118 @@ | |||
| 1 | #pragma once | ||
| 2 | /* | ||
| 3 | * Copyright (C) 2012-2013 Team XBMC | ||
| 4 | * http://xbmc.org | ||
| 5 | * | ||
| 6 | * This Program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License as published by | ||
| 8 | * the Free Software Foundation; either version 2, or (at your option) | ||
| 9 | * any later version. | ||
| 10 | * | ||
| 11 | * This Program is distributed in the hope that it will be useful, | ||
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 14 | * GNU General Public License for more details. | ||
| 15 | * | ||
| 16 | * You should have received a copy of the GNU General Public License | ||
| 17 | * along with XBMC; see the file COPYING. If not, see | ||
| 18 | * <http://www.gnu.org/licenses/>. | ||
| 19 | * | ||
| 20 | */ | ||
| 21 | |||
| 22 | #include "DVDDemux.h" | ||
| 23 | #include <map> | ||
| 24 | #include "pvr/addons/PVRClient.h" | ||
| 25 | |||
| 26 | extern "C" { | ||
| 27 | #include "libavcodec/avcodec.h" | ||
| 28 | #include "libavformat/avformat.h" | ||
| 29 | } | ||
| 30 | |||
| 31 | class CDVDDemuxPVRClient; | ||
| 32 | struct PVR_STREAM_PROPERTIES; | ||
| 33 | |||
| 34 | class CDemuxStreamPVRInternal | ||
| 35 | { | ||
| 36 | public: | ||
| 37 | CDemuxStreamPVRInternal(CDVDDemuxPVRClient *parent); | ||
| 38 | ~CDemuxStreamPVRInternal(); | ||
| 39 | |||
| 40 | void DisposeParser(); | ||
| 41 | |||
| 42 | CDVDDemuxPVRClient * m_parent; | ||
| 43 | AVCodecParserContext* m_parser; | ||
| 44 | AVCodecContext * m_context; | ||
| 45 | bool m_parser_split; | ||
| 46 | }; | ||
| 47 | |||
| 48 | class CDemuxStreamVideoPVRClient | ||
| 49 | : public CDemuxStreamVideo | ||
| 50 | , public CDemuxStreamPVRInternal | ||
| 51 | { | ||
| 52 | public: | ||
| 53 | CDemuxStreamVideoPVRClient(CDVDDemuxPVRClient *parent) | ||
| 54 | : CDemuxStreamPVRInternal(parent) | ||
| 55 | {} | ||
| 56 | virtual void GetStreamInfo(std::string& strInfo); | ||
| 57 | }; | ||
| 58 | |||
| 59 | class CDemuxStreamAudioPVRClient | ||
| 60 | : public CDemuxStreamAudio | ||
| 61 | , public CDemuxStreamPVRInternal | ||
| 62 | { | ||
| 63 | public: | ||
| 64 | CDemuxStreamAudioPVRClient(CDVDDemuxPVRClient *parent) | ||
| 65 | : CDemuxStreamPVRInternal(parent) | ||
| 66 | {} | ||
| 67 | virtual void GetStreamInfo(std::string& strInfo); | ||
| 68 | }; | ||
| 69 | |||
| 70 | class CDemuxStreamSubtitlePVRClient | ||
| 71 | : public CDemuxStreamSubtitle | ||
| 72 | , public CDemuxStreamPVRInternal | ||
| 73 | { | ||
| 74 | public: | ||
| 75 | CDemuxStreamSubtitlePVRClient(CDVDDemuxPVRClient *parent) | ||
| 76 | : CDemuxStreamPVRInternal(parent) | ||
| 77 | {} | ||
| 78 | virtual void GetStreamInfo(std::string& strInfo); | ||
| 79 | }; | ||
| 80 | |||
| 81 | |||
| 82 | class CDVDDemuxPVRClient : public CDVDDemux | ||
| 83 | { | ||
| 84 | friend class CDemuxStreamPVRInternal; | ||
| 85 | |||
| 86 | public: | ||
| 87 | |||
| 88 | CDVDDemuxPVRClient(); | ||
| 89 | ~CDVDDemuxPVRClient(); | ||
| 90 | |||
| 91 | bool Open(CDVDInputStream* pInput); | ||
| 92 | void Dispose(); | ||
| 93 | void Reset(); | ||
| 94 | void Abort(); | ||
| 95 | void Flush(); | ||
| 96 | DemuxPacket* Read(); | ||
| 97 | bool SeekTime(int time, bool backwords = false, double* startpts = NULL); | ||
| 98 | void SetSpeed(int iSpeed); | ||
| 99 | int GetStreamLength() { return 0; } | ||
| 100 | CDemuxStream* GetStream(int iStreamId); | ||
| 101 | int GetNrOfStreams(); | ||
| 102 | std::string GetFileName(); | ||
| 103 | virtual void GetStreamCodecName(int iStreamId, std::string &strName); | ||
| 104 | |||
| 105 | protected: | ||
| 106 | CDVDInputStream* m_pInput; | ||
| 107 | #ifndef MAX_STREAMS | ||
| 108 | #define MAX_STREAMS 100 | ||
| 109 | #endif | ||
| 110 | CDemuxStream* m_streams[MAX_STREAMS]; // maximum number of streams that ffmpeg can handle | ||
| 111 | std::shared_ptr<PVR::CPVRClient> m_pvrClient; | ||
| 112 | |||
| 113 | private: | ||
| 114 | void RequestStreams(); | ||
| 115 | void ParsePacket(DemuxPacket* pPacket); | ||
| 116 | void DisposeStream(int iStreamId); | ||
| 117 | }; | ||
| 118 | |||
