42 sbTranscodeProfile::~sbTranscodeProfile()
48 sbTranscodeProfile::GetId(nsAString & aId)
55 sbTranscodeProfile::SetId(nsAString
const & aId)
62 sbTranscodeProfile::GetPriority(PRUint32 *aPriority)
64 NS_ENSURE_ARG_POINTER(aPriority);
65 *aPriority = mPriority;
70 sbTranscodeProfile::SetPriority(PRUint32 aPriority)
72 mPriority = aPriority;
74 mPriorityMap[0.5] = aPriority;
79 sbTranscodeProfile::GetDescription(nsAString & aDescription)
81 aDescription = mDescription;
86 sbTranscodeProfile::SetDescription(nsAString
const & aDescription)
88 mDescription = aDescription;
93 sbTranscodeProfile::GetType(PRUint32 *aType)
95 NS_ENSURE_ARG_POINTER(aType);
102 sbTranscodeProfile::SetType(PRUint32 aType)
109 sbTranscodeProfile::GetContainerFormat(nsAString & aContainerFormat)
111 aContainerFormat = mContainerFormat;
116 sbTranscodeProfile::SetContainerFormat(nsAString
const & aContainerFormat)
118 mContainerFormat = aContainerFormat;
123 sbTranscodeProfile::GetFileExtension(nsACString & aFileExtension)
125 aFileExtension = mFileExtension;
130 sbTranscodeProfile::SetFileExtension(nsACString
const & aFileExtension)
132 mFileExtension = aFileExtension;
137 sbTranscodeProfile::GetAudioCodec(nsAString & aAudioCodec)
139 aAudioCodec = mAudioCodec;
144 sbTranscodeProfile::SetAudioCodec(nsAString
const & aAudioCodec)
146 mAudioCodec = aAudioCodec;
151 sbTranscodeProfile::GetVideoCodec(nsAString & aVideoCodec)
153 aVideoCodec = mVideoCodec;
158 sbTranscodeProfile::SetVideoCodec(nsAString
const & aVideoCodec)
160 mVideoCodec = aVideoCodec;
165 sbTranscodeProfile::GetAudioProperties(nsIArray * *aAudioProperties)
167 NS_ENSURE_ARG_POINTER(aAudioProperties);
169 NS_IF_ADDREF(*aAudioProperties = mAudioProperties);
174 sbTranscodeProfile::SetAudioProperties(nsIArray * aAudioProperties)
176 mAudioProperties = aAudioProperties;
181 sbTranscodeProfile::GetVideoProperties(nsIArray * *aVideoProperties)
183 NS_ENSURE_ARG_POINTER(aVideoProperties);
185 NS_IF_ADDREF(*aVideoProperties = mVideoProperties);
190 sbTranscodeProfile::SetVideoProperties(nsIArray * aVideoProperties)
192 mVideoProperties = aVideoProperties;
197 sbTranscodeProfile::GetContainerProperties(nsIArray * *aContainerProperties)
199 NS_ENSURE_ARG_POINTER(aContainerProperties);
201 NS_IF_ADDREF(*aContainerProperties = mContainerProperties);
206 sbTranscodeProfile::SetContainerProperties(nsIArray * aContainerProperties)
208 mContainerProperties = aContainerProperties;
213 sbTranscodeProfile::GetAudioAttributes(nsIArray * *aAudioAttributes)
215 NS_ENSURE_ARG_POINTER(aAudioAttributes);
217 NS_IF_ADDREF(*aAudioAttributes = mAudioAttributes);
222 sbTranscodeProfile::SetAudioAttributes(nsIArray * aAudioAttributes)
224 mAudioAttributes = aAudioAttributes;
229 sbTranscodeProfile::GetVideoAttributes(nsIArray * *aVideoAttributes)
231 NS_ENSURE_ARG_POINTER(aVideoAttributes);
233 NS_IF_ADDREF(*aVideoAttributes = mVideoAttributes);
238 sbTranscodeProfile::SetVideoAttributes(nsIArray * aVideoAttributes)
240 mVideoAttributes = aVideoAttributes;
245 sbTranscodeProfile::GetContainerAttributes(nsIArray * *aContainerAttributes)
247 NS_ENSURE_ARG_POINTER(aContainerAttributes);
249 NS_IF_ADDREF(*aContainerAttributes = mContainerAttributes);
254 sbTranscodeProfile::SetContainerAttributes(nsIArray * aContainerAttributes)
256 mContainerAttributes = aContainerAttributes;
264 typename std::map<double, T>::const_iterator end = aMap.end(),
266 upper = aMap.upper_bound(aQuality);
273 if (upper == aMap.begin()) {
275 return upper->second;
282 return lower->second;
285 double scale = (aQuality - lower->first) / (upper->first - lower->first);
286 T difference = (T)(scale * (upper->second - lower->second));
287 return lower->second + difference;
292 sbTranscodeProfile::GetEncoderProfilePriority(
double aQuality,
295 NS_ENSURE_ARG_POINTER(_retval);
302 sbTranscodeProfile::GetAudioBitrate(
double aQuality,
double *_retval)
304 NS_ENSURE_ARG_POINTER(_retval);
311 sbTranscodeProfile::GetVideoBitsPerPixel(
double aQuality,
double *_retval)
313 NS_ENSURE_ARG_POINTER(_retval);
322 NS_ENSURE_ARG_RANGE(aQuality, 0, 1);
323 mPriorityMap[aQuality] = aPriority;
330 NS_ENSURE_ARG_RANGE(aQuality, 0, 1);
331 mAudioBitrateMap[aQuality] = aBitrate;
338 NS_ENSURE_ARG_RANGE(aQuality, 0, 1);
339 mVideoBPPMap[aQuality] = aBPP;
NS_IMPL_THREADSAFE_ISUPPORTS2(sbTranscodeProfile, sbITranscodeProfile, sbITranscodeEncoderProfile) sbTranscodeProfile
An object defining a transcoding profile.
nsresult AddVideoBPP(double aQuality, double aBPP)
nsresult AddAudioBitrate(double aQuality, double aBitrate)
T getInterpolatedQuality(std::map< double, T > &aMap, double aQuality)
nsresult AddPriority(double aQuality, PRUint32 aPriority)