sbDeviceCapabilities.h
Go to the documentation of this file.
1 /*
2 //
3 // BEGIN SONGBIRD GPL
4 //
5 // This file is part of the Songbird web player.
6 //
7 // Copyright(c) 2005-2008 POTI, Inc.
8 // http://songbirdnest.com
9 //
10 // This file may be licensed under the terms of of the
11 // GNU General Public License Version 2 (the "GPL").
12 //
13 // Software distributed under the License is distributed
14 // on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
15 // express or implied. See the GPL for the specific language
16 // governing rights and limitations.
17 //
18 // You should have received a copy of the GPL along with this
19 // program. If not, go to http://www.gnu.org/licenses/gpl.html
20 // or write to the Free Software Foundation, Inc.,
21 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 //
23 // END SONGBIRD GPL
24 //
25 */
26 
27 #ifndef __SBDEVICECAPABILITIES_H__
28 #define __SBDEVICECAPABILITIES_H__
29 
30 #include <sbIDeviceCapabilities.h>
31 
32 #include <nsIArray.h>
33 #include <nsIClassInfo.h>
34 #include <nsCOMPtr.h>
35 #include <nsClassHashtable.h>
36 #include <nsInterfaceHashtable.h>
37 #include <nsTArray.h>
38 #include <nsMemory.h>
39 #include <nsIVariant.h>
40 #include <nsVoidArray.h>
41 
42 #include <sbFraction.h>
43 
45 {
46 public:
48  NS_DECL_SBIDEVICECAPABILITIES
49  NS_DECL_NSICLASSINFO
50 
52 
53 private:
54  ~sbDeviceCapabilities();
55 
56 protected:
57  PRBool isInitialized;
58  PRBool isConfigured;
59  typedef nsClassHashtable<nsUint32HashKey, nsTArray<PRUint32> > ContentTypes;
60  typedef nsClassHashtable<nsUint32HashKey, nsTArray<nsCString> > SupportedMimeTypes;
61  typedef nsClassHashtable<nsStringHashKey, nsTArray<nsCOMPtr<nsISupports> > > FormatTypes;
62  nsTArray<PRUint32> mFunctionTypes;
65  nsVoidArray mContentFormatTypes;
67  nsTArray<PRUint32> mSupportedEvents;
68 };
69 
74 {
75 public:
77  NS_DECL_SBIIMAGESIZE
78  NS_DECL_NSICLASSINFO
79 
81  mWidth(0),
82  mHeight(0) {}
83 
84 private:
85  ~sbImageSize();
86 
87  PRInt32 mWidth;
88  PRInt32 mHeight;
89 };
90 
95 {
96 public:
98  NS_DECL_SBIDEVCAPRANGE
99  NS_DECL_NSICLASSINFO
100 
101  sbDevCapRange() : mMin(0),
102  mMax(0),
103  mStep(0),
104  mValues(nsnull) {}
105 
106 private:
107  ~sbDevCapRange();
108 
109  PRInt32 mMin;
110  PRInt32 mMax;
111  PRInt32 mStep;
112  nsTArray<PRInt32> mValues;
113 };
114 
119 {
120 public:
122  NS_DECL_SBIDEVCAPFRACTION
123  NS_DECL_NSICLASSINFO
124 
125  sbDevCapFraction() : mNumerator(0),
126  mDenominator(0) {}
127 
128 private:
129  ~sbDevCapFraction();
130 
131  PRUint32 mNumerator;
132  PRUint32 mDenominator;
133 };
134 
139 {
140 public:
142  NS_DECL_SBIFORMATTYPECONSTRAINT
143  NS_DECL_NSICLASSINFO
144 
145 private:
147 
148  typedef nsCOMPtr<nsIVariant> Value;
149 
150  nsString mConstraintName;
151  Value mMinValue;
152  Value mMaxValue;
153 };
154 
159 {
160 public:
162  NS_DECL_SBIIMAGEFORMATTYPE
163  NS_DECL_NSICLASSINFO
164 
165 private:
167 
168  typedef nsCOMPtr<nsIArray> Sizes;
169  typedef nsCOMPtr<sbIDevCapRange> Widths;
170  typedef nsCOMPtr<sbIDevCapRange> Heights;
171 
172  nsCString mImageFormat;
173  Sizes mSupportedExplicitSizes;
174  Widths mSupportedWidths;
175  Heights mSupportedHeights;
176 };
177 
182 {
183 public:
185  NS_DECL_SBIAUDIOFORMATTYPE
186  NS_DECL_NSICLASSINFO
187 
188 private:
190 
191  typedef nsCOMPtr<sbIDevCapRange> Bitrates;
192  typedef nsCOMPtr<sbIDevCapRange> SampleRates;
193  typedef nsCOMPtr<sbIDevCapRange> SupportedChannels;
194  typedef nsCOMPtr<nsIArray> FormatConstraints;
195 
196  nsCString mContainerFormat;
197  nsCString mAudioCodec;
198  Bitrates mSupportedBitrates;
199  SampleRates mSupportedSampleRates;
200  SupportedChannels mSupportedChannels;
201  FormatConstraints mFormatSpecificConstraints;
202 };
203 
208 {
209 public:
211  NS_DECL_SBIDEVCAPVIDEOSTREAM
212  NS_DECL_NSICLASSINFO
213 
215 
216 private:
217  ~sbDevCapVideoStream();
218 
219  nsCString mType;
220  nsCOMPtr<nsIArray> mExplicitSizes;
221  nsCOMPtr<sbIDevCapRange> mWidths;
222  nsCOMPtr<sbIDevCapRange> mHeights;
223  PRBool mIsPARRange;
224  nsCOMPtr<nsIArray> mVideoPARs;
225  PRBool mIsFrameRatesRange;
226  nsCOMPtr<nsIArray> mVideoFrameRates;
227  nsCOMPtr<sbIDevCapRange> mBitRates;
228 };
229 
234 {
235 public:
237  NS_DECL_SBIDEVCAPAUDIOSTREAM
238  NS_DECL_NSICLASSINFO
239 
241 
242 private:
243  ~sbDevCapAudioStream();
244 
245  nsCString mType;
246  nsCOMPtr<sbIDevCapRange> mBitRates;
247  nsCOMPtr<sbIDevCapRange> mSampleRates;
248  nsCOMPtr<sbIDevCapRange> mChannels;
249 };
250 
255 {
256 public:
258  NS_DECL_SBIVIDEOFORMATTYPE
259  NS_DECL_NSICLASSINFO
260 
262 
263 private:
264  ~sbVideoFormatType();
265 
266  nsCString mContainerType;
267  nsCOMPtr<sbIDevCapVideoStream> mVideoStream;
268  nsCOMPtr<sbIDevCapAudioStream> mAudioStream;
269 };
270 
275 {
276 public:
278  NS_DECL_SBIPLAYLISTFORMATTYPE
279  NS_DECL_NSICLASSINFO
280 
282 
283 private:
284  virtual ~sbPlaylistFormatType();
285 
286  nsCString mPathSeparator;
287 };
288 
289 #endif /* __SBDEVICECAPABILITIES_H__ */
nsTArray< PRUint32 > mSupportedEvents
[UNIMPLEMENTED UNTIL AFTER 0.3]
NS_DECL_ISUPPORTS NS_DECL_SBIDEVICECAPABILITIES NS_DECL_NSICLASSINFO sbDeviceCapabilities()
NS_DECL_ISUPPORTS NS_DECL_SBIDEVCAPAUDIOSTREAM NS_DECL_NSICLASSINFO sbDevCapAudioStream()
NS_DECL_ISUPPORTS NS_DECL_SBIPLAYLISTFORMATTYPE NS_DECL_NSICLASSINFO sbPlaylistFormatType()
NS_DECL_ISUPPORTS NS_DECL_SBIDEVCAPRANGE NS_DECL_NSICLASSINFO sbDevCapRange()
NS_DECL_ISUPPORTS NS_DECL_SBIVIDEOFORMATTYPE NS_DECL_NSICLASSINFO sbVideoFormatType()
nsVoidArray mContentPreferredFormatTypes
nsClassHashtable< nsUint32HashKey, nsTArray< PRUint32 > > ContentTypes
nsClassHashtable< nsUint32HashKey, nsTArray< nsCString > > SupportedMimeTypes
nsClassHashtable< nsStringHashKey, nsTArray< nsCOMPtr< nsISupports > > > FormatTypes
SupportedMimeTypes mSupportedMimeTypes
NS_DECL_ISUPPORTS NS_DECL_SBIIMAGESIZE NS_DECL_NSICLASSINFO sbImageSize()
nsTArray< PRUint32 > mFunctionTypes
NS_DECL_ISUPPORTS NS_DECL_SBIDEVCAPVIDEOSTREAM NS_DECL_NSICLASSINFO sbDevCapVideoStream()
NS_DECL_ISUPPORTS NS_DECL_SBIDEVCAPFRACTION NS_DECL_NSICLASSINFO sbDevCapFraction()
Interface for storing a fractional value.