sbDeviceTranscoding.h
Go to the documentation of this file.
1 /*
2  *=BEGIN SONGBIRD GPL
3  *
4  * This file is part of the Songbird web player.
5  *
6  * Copyright(c) 2005-2011 POTI, Inc.
7  * http://www.songbirdnest.com
8  *
9  * This file may be licensed under the terms of of the
10  * GNU General Public License Version 2 (the ``GPL'').
11  *
12  * Software distributed under the License is distributed
13  * on an ``AS IS'' basis, WITHOUT WARRANTY OF ANY KIND, either
14  * express or implied. See the GPL for the specific language
15  * governing rights and limitations.
16  *
17  * You should have received a copy of the GPL along with this
18  * program. If not, go to http://www.gnu.org/licenses/gpl.html
19  * or write to the Free Software Foundation, Inc.,
20  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21  *
22  *=END SONGBIRD GPL
23  */
24 
25 #ifndef SBDEVICETRANSCODING_H_
26 #define SBDEVICETRANSCODING_H_
27 
28 // Standard includes
29 #include <list>
30 
31 // Mozilla includes
32 #include <nsIArray.h>
33 
34 // Songbird interfaces
35 #include <sbIMediaItem.h>
36 #include <sbITranscodeManager.h>
37 #include <sbITranscodeJob.h>
38 #include <sbITranscodeProfile.h>
39 
40 // Songbird local includes
41 #include "sbBaseDevice.h"
42 
43 class sbIMediaInspector;
46 
48 {
49 public:
50  friend class sbBaseDevice;
51 
58 
59 
60  /* Get an array of all the sbITranscodeProfile instances supported for this
61  * The default implementation filters all available profiles by the
62  * capabilities of the device.
63  */
64  virtual nsresult GetSupportedTranscodeProfiles(PRUint32 aType,
65  nsIArray **aSupportedProfiles);
66 
78  nsresult FindTranscodeProfile(sbIMediaItem * aMediaItem,
79  sbITranscodeProfile ** aProfile,
80  CompatibilityType * aDeviceCompatibility);
81 
92  nsresult SelectTranscodeProfile(PRUint32 aTranscodeType,
93  sbITranscodeProfile **aProfile);
94 
101  nsresult PrepareBatchForTranscoding(Batch & aBatch);
102 
106  static PRUint32 GetTranscodeType(sbIMediaItem * aMediaItem);
107 
112  nsresult GetMediaFormat(PRUint32 aTranscodeType,
113  sbIMediaItem* aMediaItem,
114  sbIMediaFormat** aMediaFormat);
115 
120  nsresult GetAudioFormatFromMediaItem(sbIMediaItem* aMediaItem,
121  sbIMediaFormat** aMediaFormat);
125  nsresult GetMediaInspector(sbIMediaInspector** _retval);
126 
133  nsresult TranscodeMediaItem(sbIMediaItem *aItem,
134  sbDeviceStatusHelper * aDeviceStatusHelper,
135  nsIURI * aDestinationURI,
136  nsIURI ** aTranscodedDestinationURI = nsnull);
137 private:
138  sbDeviceTranscoding(sbBaseDevice * aBaseDevice);
139  nsresult GetTranscodeManager(sbITranscodeManager ** aTranscodeManager);
140 
141  sbBaseDevice * mBaseDevice;
142  nsCOMPtr<nsIArray> mTranscodeProfiles;
143  nsCOMPtr<sbIMediaInspector> mMediaInspector;
144  nsCOMPtr<sbITranscodeManager> mTranscodeManager;
145 };
146 
147 #endif
nsresult GetMediaInspector(sbIMediaInspector **_retval)
nsresult GetAudioFormatFromMediaItem(sbIMediaItem *aMediaItem, sbIMediaFormat **aMediaFormat)
An object capable of transcoding a source URI to a destination file.
An object defining a transcoding profile.
sbBaseDevice::TransferRequest::CompatibilityType CompatibilityType
friend class sbDeviceTranscoding
Definition: sbBaseDevice.h:104
nsresult TranscodeMediaItem(sbIMediaItem *aItem, sbDeviceStatusHelper *aDeviceStatusHelper, nsIURI *aDestinationURI, nsIURI **aTranscodedDestinationURI=nsnull)
sbBaseDevice::TransferRequest TransferRequest
nsresult GetMediaFormat(PRUint32 aTranscodeType, sbIMediaItem *aMediaItem, sbIMediaFormat **aMediaFormat)
nsresult FindTranscodeProfile(sbIMediaItem *aMediaItem, sbITranscodeProfile **aProfile, CompatibilityType *aDeviceCompatibility)
nsresult PrepareBatchForTranscoding(Batch &aBatch)
aBatch The batch to process
virtual nsresult GetSupportedTranscodeProfiles(PRUint32 aType, nsIArray **aSupportedProfiles)
Interface that defines a single item of media in the system.
sbBaseDevice::Batch Batch
static PRUint32 GetTranscodeType(sbIMediaItem *aMediaItem)
nsresult SelectTranscodeProfile(PRUint32 aTranscodeType, sbITranscodeProfile **aProfile)
Select a transcode profile to use when transcoding to this device.
The manager from which to request a transcoding job, transcoding profiles, etc.