32 #include <nsIFileURL.h>
33 #include <nsIMutableArray.h>
35 #include <nsIVariant.h>
36 #include <nsIWritablePropertyBag.h>
37 #include <nsIWritablePropertyBag2.h>
40 #include <sbIDevice.h>
41 #include <sbIDeviceCapabilities.h>
42 #include <sbIMediaFormatMutable.h>
43 #include <sbITranscodeError.h>
44 #include <sbITranscodeManager.h>
45 #include <sbITranscodeProfile.h>
48 #include <nsCOMArray.h>
49 #include <nsComponentManagerUtils.h>
50 #include <nsNetUtil.h>
51 #include <nsArrayUtils.h>
65 # pragma warning (push)
66 # pragma warning (disable: 4244)
70 # pragma warning (pop)
87 static PRLogModuleInfo* gGstTranscodeConfiguratorLog = nsnull;
88 #define TRACE(args) PR_LOG(gGstTranscodeConfiguratorLog, PR_LOG_DEBUG, args)
89 #define LOG(args) PR_LOG(gGstTranscodeConfiguratorLog, PR_LOG_WARN, args)
91 #define __FUNCTION__ __PRETTY_FUNCTION__
113 TRACE((
"%s", __FUNCTION__));
114 NS_ENSURE_ARG_POINTER(aRange);
115 NS_ENSURE_ARG_POINTER(_retval);
119 PRInt32 result = PR_INT32_MIN, max = PR_INT32_MIN;
120 rv = aRange->GetValueCount(&count);
121 NS_ENSURE_SUCCESS(rv, rv);
123 for (PRUint32
i = 0;
i <
count; ++
i) {
126 NS_ENSURE_SUCCESS(rv, rv);
127 if ((result < aTarget || v < result) && v >= aTarget) {
134 if (result >= aTarget) {
140 return NS_SUCCESS_LOSS_OF_INSIGNIFICANT_DATA;
146 rv = aRange->GetMin(&min);
147 rv |= aRange->GetStep(&step);
148 rv |= aRange->GetMax(&max);
149 NS_ENSURE_SUCCESS(rv, rv);
150 NS_ENSURE_TRUE(step > 0, NS_ERROR_UNEXPECTED);
153 return NS_SUCCESS_LOSS_OF_INSIGNIFICANT_DATA;
160 *_retval = min + (aTarget - min + step - 1) / step * step;
171 mProfileFromPrefs(PR_FALSE),
172 mProfileFromGlobalPrefs(PR_FALSE)
175 if (!gGstTranscodeConfiguratorLog) {
176 gGstTranscodeConfiguratorLog =
177 PR_NewLogModule(
"sbGStreamerTranscodeAudioConfigurator");
180 TRACE((
"%s[%p]", __FUNCTION__,
this));
199 const nsACString& aMimeType,
200 nsIArray *aAttributes,
201 GstCaps** aResultCaps)
203 TRACE((
"%s", __FUNCTION__));
204 NS_ENSURE_ARG_POINTER(aAttributes);
205 NS_ENSURE_ARG_POINTER(aResultCaps);
209 nsCOMPtr<nsISimpleEnumerator> attrsEnum;
210 rv = aAttributes->Enumerate(getter_AddRefs(attrsEnum));
211 NS_ENSURE_SUCCESS(rv, rv);
214 NS_ENSURE_TRUE(caps, NS_ERROR_FAILURE);
215 GstStructure* capsStruct = gst_caps_get_structure(caps.get(), 0);
218 while (NS_SUCCEEDED(rv = attrsEnum->HasMoreElements(&hasMore)) && hasMore) {
219 nsCOMPtr<nsISupports> attrSupports;
220 rv = attrsEnum->GetNext(getter_AddRefs(attrSupports));
221 NS_ENSURE_SUCCESS(rv, rv);
222 nsCOMPtr<sbITranscodeProfileAttribute> attr =
223 do_QueryInterface(attrSupports, &rv);
224 NS_ENSURE_SUCCESS(rv, rv);
226 rv = attr->GetName(attrName);
227 NS_ENSURE_SUCCESS(rv, rv);
228 nsCOMPtr<nsIVariant> attrValue;
229 rv = attr->GetValue(getter_AddRefs(attrValue));
230 NS_ENSURE_SUCCESS(rv, rv);
232 rv = attrValue->GetDataType(&attrType);
233 NS_ENSURE_SUCCESS(rv, rv);
235 case nsIDataType::VTYPE_INT8:
case nsIDataType::VTYPE_UINT8:
236 case nsIDataType::VTYPE_INT16:
case nsIDataType::VTYPE_UINT16:
237 case nsIDataType::VTYPE_INT32:
case nsIDataType::VTYPE_UINT32:
238 case nsIDataType::VTYPE_INT64:
case nsIDataType::VTYPE_UINT64:
241 rv = attrValue->GetAsInt32(&intValue);
242 NS_ENSURE_SUCCESS(rv, rv);
243 gst_structure_set(capsStruct,
244 NS_LossyConvertUTF16toASCII(attrName).
get(),
250 case nsIDataType::VTYPE_UTF8STRING:
251 case nsIDataType::VTYPE_DOMSTRING:
252 case nsIDataType::VTYPE_CSTRING:
253 case nsIDataType::VTYPE_ASTRING:
255 nsCString stringValue;
256 rv = attrValue->GetAsACString(stringValue);
257 NS_ENSURE_SUCCESS (rv, rv);
259 gst_structure_set(capsStruct,
260 NS_LossyConvertUTF16toASCII(attrName).
get(),
262 stringValue.BeginReading(),
267 NS_NOTYETIMPLEMENTED(
"Unknown attribute type");
270 NS_ENSURE_SUCCESS(rv, rv);
272 *aResultCaps = caps.forget();
283 TRACE((
"%s[%p]", __FUNCTION__,
this));
284 NS_ENSURE_ARG_POINTER(aProfile);
290 rv = aProfile->GetType(&type);
291 NS_ENSURE_SUCCESS(rv, rv);
294 return NS_ERROR_NOT_AVAILABLE;
300 rv = aProfile->GetContainerFormat(capsName);
301 NS_ENSURE_SUCCESS(rv, rv);
302 if (!capsName.IsEmpty()) {
303 nsCOMPtr<nsIArray> attrs;
304 rv = aProfile->GetContainerAttributes(getter_AddRefs(attrs));
305 NS_ENSURE_SUCCESS(rv, rv);
307 GstCaps* caps = NULL;
309 NS_LossyConvertUTF16toASCII(capsName),
312 NS_ENSURE_SUCCESS(rv, rv);
315 if (!muxerCodecName) {
320 gst_caps_unref(caps);
321 if (!muxerCodecName) {
322 TRACE((
"no muxer available for %s",
323 NS_LossyConvertUTF16toASCII(capsName).
get()));
324 return NS_ERROR_UNEXPECTED;
326 elementNames.
muxer = muxerCodecName;
330 rv = aProfile->GetAudioCodec(capsName);
331 NS_ENSURE_SUCCESS(rv, rv);
332 if (!capsName.IsEmpty()) {
333 nsCOMPtr<nsIArray> attrs;
334 rv = aProfile->GetAudioAttributes(getter_AddRefs(attrs));
335 NS_ENSURE_SUCCESS(rv, rv);
337 GstCaps* caps = NULL;
339 NS_LossyConvertUTF16toASCII(capsName),
342 NS_ENSURE_SUCCESS(rv, rv);
345 gst_caps_unref(caps);
347 TRACE((
"no audio encoder available for %s",
348 NS_LossyConvertUTF16toASCII(capsName).
get()));
349 return NS_ERROR_UNEXPECTED;
355 NS_ENSURE_TRUE(success, NS_ERROR_OUT_OF_MEMORY);
370 TRACE((
"%s[%p]", __FUNCTION__,
this));
374 nsCOMPtr<sbIDeviceCapabilities> caps;
375 rv =
mDevice->GetCapabilities(getter_AddRefs(caps));
376 NS_ENSURE_SUCCESS(rv, rv);
378 PRUint32 mimeTypesCount;
383 NS_ENSURE_SUCCESS(rv, rv);
385 if (mimeTypesCount == 0) {
395 for (PRUint32 mimeTypeIndex = 0;
396 mimeTypeIndex < mimeTypesCount;
400 PRUint32 formatTypeCount;
402 NS_ConvertASCIItoUTF16(mimeTypes[mimeTypeIndex]),
405 NS_ENSURE_SUCCESS(rv, rv);
409 for (PRUint32 formatIndex = 0;
410 formatIndex < formatTypeCount;
413 nsCOMPtr<sbIAudioFormatType> format = do_QueryInterface(
414 formatTypes[formatIndex], &rv);
415 NS_ENSURE_SUCCESS(rv, rv);
418 nsCString formatContainer;
419 rv = format->GetContainerFormat(formatContainer);
420 NS_ENSURE_SUCCESS(rv, rv);
421 nsString encoderContainer;
422 rv = aProfile->GetContainerFormat(encoderContainer);
423 NS_ENSURE_SUCCESS(rv, rv);
425 if (!encoderContainer.Equals(NS_ConvertUTF8toUTF16(formatContainer))) {
431 nsString encoderAudioCodec;
432 rv = aProfile->GetAudioCodec(encoderAudioCodec);
433 NS_ENSURE_SUCCESS(rv, rv);
435 nsCString formatAudioCodec;
436 rv = format->GetAudioCodec(formatAudioCodec);
437 NS_ENSURE_SUCCESS(rv, rv);
438 if (!encoderAudioCodec.Equals(NS_ConvertUTF8toUTF16(formatAudioCodec))) {
444 NS_ADDREF (*aFormat = format);
449 return NS_ERROR_FAILURE;
463 TRACE((
"%s[%p]", __FUNCTION__,
this));
466 "attempted to select profile with no device");
468 nsCOMPtr<sbIAudioFormatType> prefFormat;
469 nsCOMPtr<sbIAudioFormatType> globalPrefFormat;
470 nsCOMPtr<sbIAudioFormatType> bestFormat;
471 nsCOMPtr<sbITranscodeProfile> prefProfile;
472 nsCOMPtr<sbITranscodeProfile> globalPrefProfile;
473 nsCOMPtr<sbITranscodeProfile> bestProfile;
474 PRBool hasProfilePref = PR_FALSE;
475 PRBool hasGlobalProfilePref = PR_FALSE;
476 PRUint32 bestPriority = 0;
481 nsString prefProfileId;
482 nsString globalPrefProfileId;
484 nsCOMPtr<nsIVariant> profileIdVariant;
485 rv =
mDevice->GetPreference(NS_LITERAL_STRING(
"transcode_profile.profile_id"),
486 getter_AddRefs(profileIdVariant));
487 if (NS_SUCCEEDED(rv))
489 rv = profileIdVariant->GetAsAString(prefProfileId);
490 NS_ENSURE_SUCCESS(rv, rv);
492 if (!prefProfileId.IsEmpty()) {
493 TRACE((
"%s: found a profile", __FUNCTION__));
494 hasProfilePref = PR_TRUE;
498 if (!hasProfilePref) {
500 NS_ENSURE_SUCCESS (rv, rv);
503 getter_AddRefs(profileIdVariant));
504 if (NS_SUCCEEDED(rv)) {
505 rv = profileIdVariant->GetAsAString(globalPrefProfileId);
506 NS_ENSURE_SUCCESS(rv, rv);
508 if (!globalPrefProfileId.IsEmpty()) {
509 TRACE((
"%s: found a global pref for profile", __FUNCTION__));
510 hasGlobalProfilePref = PR_TRUE;
517 nsCOMPtr<nsIArray> profilesArray;
519 NS_ENSURE_SUCCESS(rv, rv);
520 nsCOMPtr<nsISimpleEnumerator> profilesEnum;
521 rv = profilesArray->Enumerate(getter_AddRefs(profilesEnum));
522 NS_ENSURE_SUCCESS(rv, rv);
525 PRBool hasMoreProfiles;
526 while (NS_SUCCEEDED(profilesEnum->HasMoreElements(&hasMoreProfiles)) &&
529 nsCOMPtr<nsISupports> profileSupports;
530 rv = profilesEnum->GetNext(getter_AddRefs(profileSupports));
531 NS_ENSURE_SUCCESS(rv, rv);
533 nsCOMPtr<sbITranscodeProfile> profile =
534 do_QueryInterface(profileSupports, &rv);
535 NS_ENSURE_SUCCESS(rv, rv);
538 rv = profile->GetId(profileId);
539 NS_ENSURE_SUCCESS(rv, rv);
541 if (hasProfilePref) {
542 if (profileId.Equals(prefProfileId)) {
543 nsCOMPtr<sbIAudioFormatType> deviceFormat;
545 getter_AddRefs(deviceFormat));
546 if (NS_SUCCEEDED (rv)) {
547 prefProfile = profile;
548 prefFormat = deviceFormat;
553 if (hasGlobalProfilePref) {
554 if (profileId.Equals(globalPrefProfileId)) {
555 nsCOMPtr<sbIAudioFormatType> deviceFormat;
557 getter_AddRefs(deviceFormat));
558 if (NS_SUCCEEDED (rv)) {
559 globalPrefProfile = profile;
560 globalPrefFormat = deviceFormat;
568 rv = profile->GetPriority(&priority);
569 NS_ENSURE_SUCCESS(rv, rv);
571 if (!bestProfile || priority > bestPriority) {
572 nsCOMPtr<sbIAudioFormatType> deviceFormat;
574 getter_AddRefs(deviceFormat));
575 if (NS_SUCCEEDED (rv)) {
576 bestProfile = profile;
577 bestPriority = priority;
578 bestFormat = deviceFormat;
584 LOG((
"Using device pref profile"));
589 else if (globalPrefProfile) {
590 LOG((
"Using global pref profile"));
595 else if (bestProfile) {
596 LOG((
"Using best available profile"));
602 return NS_ERROR_FAILURE;
614 TRACE((
"%s[%p]", __FUNCTION__,
this));
616 "attempted to set audio properties without selecting profile");
622 NS_ENSURE_SUCCESS(rv, rv);
627 NS_ENSURE_SUCCESS(rv, rv);
630 rv =
mInputFormat->GetAudioStream(getter_AddRefs(inputFormat));
631 NS_ENSURE_SUCCESS(rv, rv);
635 return NS_ERROR_UNEXPECTED;
641 rv = inputFormat->GetSampleRate(&sampleRate);
642 NS_ENSURE_SUCCESS(rv, rv);
643 rv = audioFormat->SetSampleRate(sampleRate);
644 NS_ENSURE_SUCCESS(rv, rv);
647 rv = inputFormat->GetChannels(&channels);
648 NS_ENSURE_SUCCESS(rv, rv);
649 rv = audioFormat->SetChannels(channels);
650 NS_ENSURE_SUCCESS(rv, rv);
659 nsCOMPtr<sbIDevCapRange> sampleRateRange;
660 rv =
mSelectedFormat->GetSupportedSampleRates(getter_AddRefs(sampleRateRange));
661 NS_ENSURE_SUCCESS(rv, rv);
663 rv = inputFormat->GetSampleRate(&sampleRate);
664 NS_ENSURE_SUCCESS(rv, rv);
665 rv = sampleRateRange->IsValueInRange(sampleRate, &isInRange);
666 if (NS_FAILED(rv) || !isInRange) {
669 NS_ENSURE_SUCCESS(rv, rv);
671 rv = audioFormat->SetSampleRate(sampleRate);
672 NS_ENSURE_SUCCESS(rv, rv);
674 nsCOMPtr<sbIDevCapRange> channelsRange;
675 rv =
mSelectedFormat->GetSupportedChannels(getter_AddRefs(channelsRange));
676 NS_ENSURE_SUCCESS(rv, rv);
678 rv = inputFormat->GetChannels(&channels);
679 NS_ENSURE_SUCCESS(rv, rv);
680 rv = channelsRange->IsValueInRange(channels, &isInRange);
681 if (NS_FAILED(rv) || !isInRange) {
685 if (NS_SUCCEEDED(rv)) {
686 channels = newChannels;
690 channels = (channels < 2 ? 1 : 2);
693 rv = audioFormat->SetChannels(channels);
694 NS_ENSURE_SUCCESS(rv, rv);
708 TRACE((
"%s[%p]", __FUNCTION__,
this));
710 "attempted to set audio properties without selecting profile");
716 do_CreateInstance(
"@songbirdnest.com/moz/xpcom/sbpropertybag;1", &rv);
717 NS_ENSURE_SUCCESS(rv, rv);
720 nsCOMPtr<nsIWritablePropertyBag> writableBag =
722 NS_ENSURE_SUCCESS(rv, rv);
724 nsCOMPtr<nsIArray> propsSrc;
726 NS_ENSURE_SUCCESS(rv, rv);
734 NS_LITERAL_STRING(
"transcode_profile.audio_properties"));
735 NS_ENSURE_SUCCESS(rv, rv);
741 NS_LITERAL_STRING(
"songbird.device.transcode_profile.audio_properties"));
742 NS_ENSURE_SUCCESS(rv, rv);
746 NS_ENSURE_SUCCESS(rv, rv);
754 nsIArray *aPropertyArray,
755 nsString aPrefNameBase)
759 if(!aPropertyArray) {
764 PRUint32 numProperties;
765 rv = aPropertyArray->GetLength(&numProperties);
766 NS_ENSURE_SUCCESS(rv, rv);
768 for (PRUint32
i = 0;
i < numProperties;
i++) {
769 nsCOMPtr<sbITranscodeProfileProperty>
property =
770 do_QueryElementAt(aPropertyArray,
i, &rv);
771 NS_ENSURE_SUCCESS(rv, rv);
774 rv =
property->GetPropertyName(propName);
775 NS_ENSURE_SUCCESS(rv, rv);
777 nsCOMPtr<nsIVariant> prefVariant;
780 nsString prefName = aPrefNameBase;
781 prefName.AppendLiteral(
".");
782 prefName.Append(propName);
784 rv = aDevice->GetPreference(prefName, getter_AddRefs(prefVariant));
785 NS_ENSURE_SUCCESS(rv, rv);
789 NS_ENSURE_SUCCESS(rv, rv);
791 rv = prefs.
GetPreference(propName, getter_AddRefs(prefVariant));
792 NS_ENSURE_SUCCESS(rv, rv);
797 rv = prefVariant->GetDataType(&dataType);
798 NS_ENSURE_SUCCESS(rv, rv);
799 if (dataType != nsIDataType::VTYPE_VOID &&
800 dataType != nsIDataType::VTYPE_EMPTY)
802 rv =
property->SetValue(prefVariant);
803 NS_ENSURE_SUCCESS(rv, rv);
819 nsIWritablePropertyBag * aDstBag,
822 NS_ENSURE_ARG_POINTER(aSrcProps);
823 NS_ENSURE_ARG_POINTER(aDstBag);
827 nsCOMPtr<nsISimpleEnumerator> propsEnum;
828 rv = aSrcProps->Enumerate(getter_AddRefs(propsEnum));
829 NS_ENSURE_SUCCESS(rv, rv);
831 while (NS_SUCCEEDED(rv = propsEnum->HasMoreElements(&hasMore)) && hasMore) {
832 nsCOMPtr<nsISupports> supports;
833 rv = propsEnum->GetNext(getter_AddRefs(supports));
834 NS_ENSURE_SUCCESS(rv, rv);
835 nsCOMPtr<sbITranscodeProfileProperty> prop =
836 do_QueryInterface(supports, &rv);
837 NS_ENSURE_SUCCESS(rv, rv);
839 rv = prop->GetHidden(&hidden);
840 NS_ENSURE_SUCCESS(rv, rv);
845 rv = prop->GetPropertyName(propName);
846 NS_ENSURE_SUCCESS(rv, rv);
849 nsCOMPtr<nsIVariant>
value;
850 rv = prop->GetValue(getter_AddRefs(value));
851 NS_ENSURE_SUCCESS(rv, rv);
853 rv = aDstBag->SetProperty(propName, value);
854 NS_ENSURE_SUCCESS(rv, rv);
856 NS_ENSURE_SUCCESS(rv, rv);
864 TRACE((
"%s[%p]", __FUNCTION__,
this));
874 NS_ENSURE_TRUE(initSuccess, NS_ERROR_OUT_OF_MEMORY);
879 nsCOMPtr<nsISimpleEnumerator> dirEnum;
881 nsCOMPtr<nsIURI> profilesDirURI;
882 rv = NS_NewURI(getter_AddRefs(profilesDirURI),
883 NS_LITERAL_STRING(
"resource://app/gstreamer/encode-profiles"));
884 NS_ENSURE_SUCCESS(rv, rv);
886 nsCOMPtr<nsIFileURL> profilesDirFileURL =
887 do_QueryInterface(profilesDirURI, &rv);
888 NS_ENSURE_SUCCESS(rv, rv);
890 nsCOMPtr<nsIFile> profilesDir;
891 rv = profilesDirFileURL->GetFile(getter_AddRefs(profilesDir));
892 NS_ENSURE_SUCCESS(rv, rv);
894 nsCOMPtr<nsIMutableArray>
array =
895 do_CreateInstance(
"@songbirdnest.com/moz/xpcom/threadsafe-array;1", &rv);
896 NS_ENSURE_SUCCESS(rv, rv);
898 nsCOMPtr<sbITranscodeProfileLoader> profileLoader =
899 do_CreateInstance(
"@songbirdnest.com/Songbird/Transcode/ProfileLoader;1",
901 NS_ENSURE_SUCCESS (rv, rv);
903 rv = profilesDir->GetDirectoryEntries(getter_AddRefs(dirEnum));
904 NS_ENSURE_SUCCESS (rv, rv);
907 rv = dirEnum->HasMoreElements(&hasMoreElements);
908 NS_ENSURE_SUCCESS(rv, rv);
909 if (!hasMoreElements)
912 nsCOMPtr<nsIFile>
file;
913 rv = dirEnum->GetNext(getter_AddRefs(file));
914 NS_ENSURE_SUCCESS(rv, rv);
916 nsCOMPtr<sbITranscodeProfile> profile;
918 rv = profileLoader->LoadProfile(file, getter_AddRefs(profile));
928 rv = array->AppendElement(profile, PR_FALSE);
929 NS_ENSURE_SUCCESS (rv, rv);
933 NS_ENSURE_SUCCESS (rv, rv);
943 sbGStreamerTranscodeAudioConfigurator::GetDevice(
sbIDevice * *aDevice)
945 TRACE((
"%s[%p]", __FUNCTION__,
this));
946 NS_ENSURE_ARG_POINTER(aDevice);
947 NS_IF_ADDREF(*aDevice =
mDevice);
952 sbGStreamerTranscodeAudioConfigurator::SetDevice(
sbIDevice * aDevice)
954 TRACE((
"%s[%p]", __FUNCTION__,
this));
956 NS_ERROR_ALREADY_INITIALIZED);
967 TRACE((
"%s[%p]", __FUNCTION__,
this));
969 NS_ENSURE_TRUE(
mDevice, NS_ERROR_NOT_INITIALIZED);
971 NS_ERROR_ALREADY_INITIALIZED);
977 NS_ENSURE_SUCCESS(rv, rv);
981 NS_ENSURE_TRUE (success, NS_ERROR_UNEXPECTED);
992 NS_ENSURE_SUCCESS (rv, rv);
1004 TRACE((
"%s[%p]", __FUNCTION__,
this));
1006 NS_ENSURE_TRUE(
mInputFormat, NS_ERROR_NOT_INITIALIZED);
1008 NS_ERROR_ALREADY_INITIALIZED);
1015 NS_ENSURE_SUCCESS(rv, rv);
1019 rv =
mInputFormat->GetAudioStream(getter_AddRefs(audioFormat));
1020 NS_ENSURE_SUCCESS(rv, rv);
1026 NS_ENSURE_SUCCESS(rv, rv);
1030 NS_ENSURE_SUCCESS(rv, rv);
1034 LOG((
"No audio, cannot configurate for audio-only"));
1035 return NS_ERROR_NOT_AVAILABLE;
nsCOMPtr< sbITranscodeProfile > mSelectedProfile
readonly attribute AString audioEncoder
The audio encoder to use. The name is specific to the transcoder (for example, this may be a gstreame...
readonly attribute sbIMediaFormatAudio audioFormat
The basic audio format for data that is not specific to a particular codec.
nsresult CopyPropertiesIntoBag(nsIArray *aSrcProps, nsIWritablePropertyBag *aDstBag, PRBool aIsVideo)
const unsigned long TRANSCODE_TYPE_AUDIO
NS_IMPL_ISUPPORTS_INHERITED1(sbGStreamerTranscodeAudioConfigurator, sbTranscodingConfigurator, sbIDeviceTranscodingConfigurator)
An object defining a transcoding profile.
Songbird Variant Utility Definitions.
nsresult EnsureProfileAvailable(sbITranscodeProfile *aProfile)
nsDataHashtable< nsISupportsHashKey, EncoderProfileData > mElementNames
nsresult GetPreference(const nsAString &aPrefName, nsIVariant **_retval)
NS_IMETHOD DetermineOutputType()
nsresult SelectOutputAudioFormat()
nsCOMPtr< sbIDevice > mDevice
nsCOMPtr< sbIMediaFormat > mInputFormat
nsresult SetAudioProperties()
CONFIGURATE_STATE mConfigurateState
nsresult CheckProfileSupportedByDevice(sbITranscodeProfile *aProfile, sbIAudioFormatType **aFormat)
nsCOMPtr< sbIAudioFormatType > mSelectedFormat
NS_IMETHOD GetAvailableProfiles(nsIArray **aProfiles)
nsCOMPtr< nsIWritablePropertyBag2 > mAudioEncoderProperties
SimpleArrayEnumerator prototype hasMoreElements
PRBool mProfileFromGlobalPrefs
StringArrayEnumerator prototype hasMore
const PRUint32 CONTENT_AUDIO
nsCOMPtr< nsIArray > mAvailableProfiles
long GetValue(in unsigned long aIndex)
sbGStreamerTranscodeAudioConfigurator()
attribute sbIMediaFormat inputFormat
The input format to use when configuring the transcode profile.
static nsresult MakeCapsFromAttributes(enum sbGstCapsMapType aType, const nsACString &aMimeType, nsIArray *aAttributes, GstCaps **aResultCaps)
nsCOMPtr< sbIMediaFormatAudio > mAudioFormat
_getSelectedPageStyle s i
static nsresult GetDevCapRangeUpper(sbIDevCapRange *aRange, PRInt32 aTarget, PRInt32 *_retval)
nsresult ApplyPreferencesToPropertyArray(sbIDevice *aDevice, nsIArray *aPropertyArray, nsString aPrefNameBase)
virtual ~sbGStreamerTranscodeAudioConfigurator()