Merge pull request #4314 from MartijnKaijser/beta1
[vuplus_xbmc] / xbmc / cores / dvdplayer / DVDPlayerSubtitle.h
1 #pragma once
2
3 /*
4  *      Copyright (C) 2005-2013 Team XBMC
5  *      http://xbmc.org
6  *
7  *  This Program is free software; you can redistribute it and/or modify
8  *  it under the terms of the GNU General Public License as published by
9  *  the Free Software Foundation; either version 2, or (at your option)
10  *  any later version.
11  *
12  *  This Program is distributed in the hope that it will be useful,
13  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  *  GNU General Public License for more details.
16  *
17  *  You should have received a copy of the GNU General Public License
18  *  along with XBMC; see the file COPYING.  If not, see
19  *  <http://www.gnu.org/licenses/>.
20  *
21  */
22
23 #include "DVDOverlayContainer.h"
24 #include "DVDSubtitles/DVDFactorySubtitle.h"
25 #include "DVDStreamInfo.h"
26 #include "DVDMessageQueue.h"
27 #include "DVDDemuxSPU.h"
28
29 class CDVDInputStream;
30 class CDVDSubtitleStream;
31 class CDVDSubtitleParser;
32 class CDVDInputStreamNavigator;
33 class CDVDOverlayCodec;
34
35 class CDVDPlayerSubtitle
36 {
37 public:
38   CDVDPlayerSubtitle(CDVDOverlayContainer* pOverlayContainer);
39   ~CDVDPlayerSubtitle();
40
41   void Process(double pts, double offset);
42   void Flush();
43   void FindSubtitles(const char* strFilename);
44   int GetSubtitleCount();
45
46   void UpdateOverlayInfo(CDVDInputStreamNavigator* pStream, int iAction) { m_pOverlayContainer->UpdateOverlayInfo(pStream, &m_dvdspus, iAction); }
47
48   bool AcceptsData();
49   void SendMessage(CDVDMsg* pMsg);
50   bool OpenStream(CDVDStreamInfo &hints, std::string& filename);
51   void CloseStream(bool flush);
52
53   bool IsStalled() { return m_pOverlayContainer->GetSize() == 0; }
54 private:
55   CDVDOverlayContainer* m_pOverlayContainer;
56
57   CDVDSubtitleStream* m_pSubtitleStream;
58   CDVDSubtitleParser* m_pSubtitleFileParser;
59   CDVDOverlayCodec*   m_pOverlayCodec;
60   CDVDDemuxSPU        m_dvdspus;
61
62   CDVDStreamInfo      m_streaminfo;
63   double              m_lastPts;
64
65
66   CCriticalSection    m_section;
67 };
68
69
70 //typedef struct SubtitleInfo
71 //{
72
73 //
74 //} SubtitleInfo;
75