sbTranscodingConfigurator.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-2009 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 
26 #ifndef __SB_TRANSCODINGCONFIGURATOR_H__
27 #define __SB_TRANSCODINGCONFIGURATOR_H__
28 
29 // Songbird Includes
30 #include <sbIMediaInspector.h>
31 #include <sbITranscodingConfigurator.h>
32 
33 // Mozilla Includes
34 #include <nsCOMPtr.h>
35 #include <nsIPropertyBag.h>
36 #include <nsStringAPI.h>
37 
38 class nsIWritablePropertyBag2;
39 
40 #define SONGBIRD_TRANSCODINGCONFIGURATOR_CONTRACTID \
41  "@songbirdnest.com/Songbird/Mediacore/TranscodingConfigurator;1"
42 #define SONGBIRD_TRANSCODINGCONFIGURATOR_CLASSNAME \
43  "Songbird Transcoding Configurator Interface"
44 #define SONGBIRD_TRANSCODINGCONFIGURATOR_CID \
45  { /* f40ea6ad-4a39-464f-9e94-9f240e0a05ee */ \
46  0xf40ea6ad, \
47  0x4a39, \
48  0x464f, \
49  { 0x9e, 0x94, 0x9f, 0x24, 0x0e, 0x0a, 0x05, 0xee } \
50  }
51 
52 /*
53  */
55 {
56 public:
58  NS_DECL_SBITRANSCODINGCONFIGURATOR
59 
61 
62 protected:
64 
65 protected:
67  /* The various states of configuration this configurator can be in; this
68  * order must be preserved in chronological order so we can compare them
69  * numerically.
70  */
71  CONFIGURATE_NOT_STARTED, /* determineOutputType has not finished */
72  CONFIGURATE_OUTPUT_SET, /* determineOutputType finished, not configurated */
73  CONFIGURATE_FINISHED /* configurate has been successfully called */
74  };
75  // Have we configurated? Some of the properties below will not be ready
76  // until we have determined the output type or configurated.
78  // The input URI that is being transcoded
79  nsCOMPtr<nsIURI> mInputUri;
80  // The last transcode error seen
81  nsCOMPtr<sbITranscodeError> mLastError;
82  // Store the input format we will use to configurate.
83  nsCOMPtr<sbIMediaFormat> mInputFormat;
84  // String values of encoders and muxer, and whether they're in use at all.
85  PRBool mUseMuxer;
86  nsString mMuxer;
88  nsString mVideoEncoder;
90  nsString mAudioEncoder;
91  // The file extension to use
92  nsCString mFileExtension;
93  // The basic video format for data that is not specific to a particular codec.
94  nsCOMPtr<sbIMediaFormatVideo> mVideoFormat;
95  // The basic audio format for data that is not specific to a particular codec.
96  nsCOMPtr<sbIMediaFormatAudio> mAudioFormat;
97  // The video properties to set to encode a file as defined by configurate.
98  nsCOMPtr<nsIWritablePropertyBag2> mVideoEncoderProperties;
99  // The audio properties to set to encode a file as defined by configurate.
100  nsCOMPtr<nsIWritablePropertyBag2> mAudioEncoderProperties;
101 };
102 
103 #endif /*__SB_TRANSCODINGCONFIGURATOR_H__*/
Base interface for all Transcoding Configurators. This interface should be implemented by any Configu...
nsCOMPtr< sbITranscodeError > mLastError
nsCOMPtr< sbIMediaFormat > mInputFormat
nsCOMPtr< sbIMediaFormatVideo > mVideoFormat
nsCOMPtr< nsIWritablePropertyBag2 > mAudioEncoderProperties
nsCOMPtr< nsIWritablePropertyBag2 > mVideoEncoderProperties
NS_DECL_ISUPPORTS NS_DECL_SBITRANSCODINGCONFIGURATOR sbTranscodingConfigurator()
nsCOMPtr< sbIMediaFormatAudio > mAudioFormat