Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 143 lines (119 sloc) 4.028 kb
45285e8 step 3/4: Move linuxport to trunk. How'd I get roped into this?
AlTheKiller authored
1 #pragma once
2 /*
3 * Copyright (C) 2005-2008 Team XBMC
4 * http://www.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, write to
18 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
19 * http://www.gnu.org/copyleft/gpl.html
20 *
21 */
22
23 #include "Archive.h"
5d0f6cf added: ISerializable interface, in order to serialize object into a C…
blinkseb authored
24 #include "ISerializable.h"
45285e8 step 3/4: Move linuxport to trunk. How'd I get roped into this?
AlTheKiller authored
25 #include <vector>
26
27 class CStreamDetails;
28
5d0f6cf added: ISerializable interface, in order to serialize object into a C…
blinkseb authored
29 class CStreamDetail : public IArchivable, public ISerializable
45285e8 step 3/4: Move linuxport to trunk. How'd I get roped into this?
AlTheKiller authored
30 {
31 public:
32 enum StreamType {
33 VIDEO,
34 AUDIO,
35 SUBTITLE
36 };
37
38 CStreamDetail(StreamType type) : m_eType(type) {};
5d0f6cf added: ISerializable interface, in order to serialize object into a C…
blinkseb authored
39 virtual void Archive(CArchive& ar);
40 virtual void Serialize(CVariant& value);
45285e8 step 3/4: Move linuxport to trunk. How'd I get roped into this?
AlTheKiller authored
41 virtual bool IsWorseThan(CStreamDetail *that) { return true; };
42
43 const StreamType m_eType;
44
45 protected:
46 CStreamDetails *m_pParent;
47 friend class CStreamDetails;
48 };
49
50 class CStreamDetailVideo : public CStreamDetail
51 {
52 public:
53 CStreamDetailVideo();
5d0f6cf added: ISerializable interface, in order to serialize object into a C…
blinkseb authored
54 virtual void Archive(CArchive& ar);
55 virtual void Serialize(CVariant& value);
45285e8 step 3/4: Move linuxport to trunk. How'd I get roped into this?
AlTheKiller authored
56 virtual bool IsWorseThan(CStreamDetail *that);
57
58 int m_iWidth;
59 int m_iHeight;
60 float m_fAspect;
d499076 fixed: initialize m_fAspect before m_iDuration
vdrfan authored
61 int m_iDuration;
45285e8 step 3/4: Move linuxport to trunk. How'd I get roped into this?
AlTheKiller authored
62 CStdString m_strCodec;
63 };
64
65 class CStreamDetailAudio : public CStreamDetail
66 {
67 public:
68 CStreamDetailAudio();
5d0f6cf added: ISerializable interface, in order to serialize object into a C…
blinkseb authored
69 virtual void Archive(CArchive& ar);
70 virtual void Serialize(CVariant& value);
45285e8 step 3/4: Move linuxport to trunk. How'd I get roped into this?
AlTheKiller authored
71 virtual bool IsWorseThan(CStreamDetail *that);
72
73 int m_iChannels;
74 CStdString m_strCodec;
75 CStdString m_strLanguage;
76 };
77
78 class CStreamDetailSubtitle : public CStreamDetail
79 {
80 public:
81 CStreamDetailSubtitle();
5d0f6cf added: ISerializable interface, in order to serialize object into a C…
blinkseb authored
82 virtual void Archive(CArchive& ar);
83 virtual void Serialize(CVariant& value);
45285e8 step 3/4: Move linuxport to trunk. How'd I get roped into this?
AlTheKiller authored
84 virtual bool IsWorseThan(CStreamDetail *that);
85
86 CStdString m_strLanguage;
87 };
88
5d0f6cf added: ISerializable interface, in order to serialize object into a C…
blinkseb authored
89 class CStreamDetails : public IArchivable, public ISerializable
45285e8 step 3/4: Move linuxport to trunk. How'd I get roped into this?
AlTheKiller authored
90 {
91 public:
92 CStreamDetails() { Reset(); };
93 CStreamDetails(const CStreamDetails &that);
94 ~CStreamDetails() { Reset(); };
95 CStreamDetails& operator=(const CStreamDetails &that);
96
da44e02 [chd] have dvdplayervideo drain ready queue before sending more demux…
davilla authored
97 static CStdString VideoDimsToResolutionDescription(int iWidth, int iHeight);
45285e8 step 3/4: Move linuxport to trunk. How'd I get roped into this?
AlTheKiller authored
98 static CStdString VideoAspectToAspectDescription(float fAspect);
d5c23e3 cosmetics
spiff_ authored
99
45285e8 step 3/4: Move linuxport to trunk. How'd I get roped into this?
AlTheKiller authored
100 bool HasItems(void) const { return m_vecItems.size() > 0; };
101 int GetStreamCount(CStreamDetail::StreamType type) const;
102 int GetVideoStreamCount(void) const;
103 int GetAudioStreamCount(void) const;
104 int GetSubtitleStreamCount(void) const;
105 const CStreamDetail* GetNthStream(CStreamDetail::StreamType type, int idx) const;
106
107 CStdString GetVideoCodec(int idx = 0) const;
108 float GetVideoAspect(int idx = 0) const;
109 int GetVideoWidth(int idx = 0) const;
110 int GetVideoHeight(int idx = 0) const;
d386b24 fixed: Ticket #6780 - Read running time from video file
vdrfan authored
111 int GetVideoDuration(int idx = 0) const;
45285e8 step 3/4: Move linuxport to trunk. How'd I get roped into this?
AlTheKiller authored
112
113 CStdString GetAudioCodec(int idx = 0) const;
114 CStdString GetAudioLanguage(int idx = 0) const;
115 int GetAudioChannels(int idx = 0) const;
116
117 CStdString GetSubtitleLanguage(int idx = 0) const;
118
119 void AddStream(CStreamDetail *item);
120 void Reset(void);
121 void DetermineBestStreams(void);
122
5d0f6cf added: ISerializable interface, in order to serialize object into a C…
blinkseb authored
123 virtual void Archive(CArchive& ar);
124 virtual void Serialize(CVariant& value);
45285e8 step 3/4: Move linuxport to trunk. How'd I get roped into this?
AlTheKiller authored
125
126 // Language to use for "best" subtitle stream
d5c23e3 cosmetics
spiff_ authored
127 CStdString m_strLanguage;
45285e8 step 3/4: Move linuxport to trunk. How'd I get roped into this?
AlTheKiller authored
128
129 private:
130 CStreamDetail *NewStream(CStreamDetail::StreamType type);
131 std::vector<CStreamDetail *> m_vecItems;
132 CStreamDetailVideo *m_pBestVideo;
133 CStreamDetailAudio *m_pBestAudio;
134 CStreamDetailSubtitle *m_pBestSubtitle;
135 };
136
137 class IStreamDetailsObserver
138 {
139 public:
140 virtual ~IStreamDetailsObserver() {}
141 virtual void OnStreamDetails(const CStreamDetails &details, const CStdString &strFileName, long lFileId) = 0;
142 };
Something went wrong with that request. Please try again.