28 #include <nsArrayUtils.h>
29 #include <nsComponentManagerUtils.h>
30 #include <nsIFileURL.h>
31 #include <nsIInputStream.h>
32 #include <nsIIOService.h>
33 #include <nsIStringEnumerator.h>
34 #include <nsISupportsPrimitives.h>
35 #include <nsIWritablePropertyBag2.h>
36 #include <nsIVariant.h>
38 #include <nsServiceManagerUtils.h>
41 #include <sbIDeviceEvent.h>
42 #include <sbIJobCancelable.h>
43 #include <sbIMediacoreEventTarget.h>
44 #include <sbIMediaFormatMutable.h>
45 #include <sbIMediaInspector.h>
46 #include <sbITranscodeAlbumArt.h>
47 #include <sbITranscodeError.h>
48 #include <sbITranscodeManager.h>
49 #include <sbITranscodeVideoJob.h>
50 #include <sbITranscodingConfigurator.h>
71 extern PRLogModuleInfo* gBaseDeviceLog;
72 #define LOG(args) PR_LOG(gBaseDeviceLog, PR_LOG_WARN, args)
73 #define TRACE(args) PR_LOG(gBaseDeviceLog, PR_LOG_DEBUG, args)
75 #define LOG(args) do{ } while(0)
76 #define TRACE(args) do { } while(0)
79 sbDeviceTranscoding::sbDeviceTranscoding(
sbBaseDevice * aBaseDevice) :
80 mBaseDevice(aBaseDevice)
86 nsIArray **aSupportedProfiles)
89 if (!mTranscodeProfiles) {
93 getter_AddRefs(mTranscodeProfiles));
94 NS_ENSURE_SUCCESS(rv, rv);
97 NS_IF_ADDREF(*aSupportedProfiles = mTranscodeProfiles);
108 PRBool hasProfilePref = PR_FALSE;
110 nsCOMPtr<nsIVariant> profileIdVariant;
111 nsString prefProfileId;
113 NS_LITERAL_STRING(
"transcode_profile.profile_id"),
114 getter_AddRefs(profileIdVariant));
115 if (NS_SUCCEEDED(rv)) {
116 PRUint16 dataType = 0;
117 rv = profileIdVariant->GetDataType(&dataType);
118 if (NS_SUCCEEDED(rv) &&
119 dataType != nsIDataType::VTYPE_EMPTY &&
120 dataType != nsIDataType::VTYPE_VOID) {
121 hasProfilePref = PR_TRUE;
122 rv = profileIdVariant->GetAsAString(prefProfileId);
123 NS_ENSURE_SUCCESS(rv, rv);
124 TRACE((
"%s: found a profile", __FUNCTION__));
128 nsCOMPtr<nsIArray> supportedProfiles;
130 getter_AddRefs(supportedProfiles));
131 NS_ENSURE_SUCCESS(rv, rv);
133 PRUint32 bestPriority = 0;
134 nsCOMPtr<sbITranscodeProfile> bestProfile;
135 nsCOMPtr<sbITranscodeProfile> prefProfile;
138 rv = supportedProfiles->GetLength(&length);
139 NS_ENSURE_SUCCESS(rv, rv);
141 for (PRUint32 index = 0; index < length; ++index) {
142 nsCOMPtr<sbITranscodeProfile> profile =
143 do_QueryElementAt(supportedProfiles, index, &rv);
144 NS_ENSURE_SUCCESS(rv, rv);
147 PRUint32 profileContentType;
148 rv = profile->GetType(&profileContentType);
149 NS_ENSURE_SUCCESS(rv, rv);
153 if (profileContentType == transcodeType) {
154 if (hasProfilePref) {
156 rv = profile->GetId(profileId);
157 NS_ENSURE_SUCCESS(rv, rv);
159 if (profileId.Equals(prefProfileId))
160 prefProfile = profile;
165 rv = profile->GetPriority(&priority);
166 NS_ENSURE_SUCCESS(rv, rv);
168 if (!bestProfile || priority > bestPriority) {
169 bestProfile = profile;
170 bestPriority = priority;
174 TRACE((
"%s: skipping profile for content type %d",
176 profileContentType));
183 nsCOMPtr<nsIArray> audioProperties;
184 rv = prefProfile->GetAudioProperties(getter_AddRefs(audioProperties));
185 NS_ENSURE_SUCCESS(rv, rv);
189 NS_LITERAL_STRING(
"transcode_profile.audio_properties"));
190 NS_ENSURE_SUCCESS(rv, rv);
192 nsCOMPtr<nsIArray> videoProperties;
193 rv = prefProfile->GetVideoProperties(getter_AddRefs(videoProperties));
194 NS_ENSURE_SUCCESS(rv, rv);
198 NS_LITERAL_STRING(
"transcode_profile.video_properties"));
199 NS_ENSURE_SUCCESS(rv, rv);
201 nsCOMPtr<nsIArray> containerProperties;
202 rv = prefProfile->GetContainerProperties(
203 getter_AddRefs(containerProperties));
204 NS_ENSURE_SUCCESS(rv, rv);
208 NS_LITERAL_STRING(
"transcode_profile.container_properties"));
209 NS_ENSURE_SUCCESS(rv, rv);
211 prefProfile.forget(aProfile);
212 TRACE((
"%s: found pref profile", __FUNCTION__));
215 else if (bestProfile) {
216 TRACE((
"%s: using best-match profile", __FUNCTION__));
217 bestProfile.forget(aProfile);
222 TRACE((
"%s: no supported profiles available", __FUNCTION__));
223 return NS_ERROR_NOT_AVAILABLE;
234 TRACE((
"%s", __FUNCTION__));
238 if (aBatch.
empty()) {
242 nsCOMPtr<nsIArray> imageFormats;
245 if (rv != NS_ERROR_NOT_AVAILABLE) {
246 NS_ENSURE_SUCCESS(rv, rv);
269 PRBool isSupported = PR_FALSE;
274 if (NS_SUCCEEDED(rv) && isSupported) {
289 TRACE((
"%s: no transcode profile available", __FUNCTION__));
294 TRACE((
"%s: transcoding needed", __FUNCTION__));
299 request->
albumArt = do_CreateInstance(
301 NS_ENSURE_SUCCESS(rv, rv);
304 rv = request->
albumArt->Init(request->
item, imageFormats);
306 TRACE((
"%s: no album art available", __FUNCTION__));
320 nsString contentType;
321 rv = aMediaItem->GetContentType(contentType);
324 if (contentType.Equals(NS_LITERAL_STRING(
"audio"))) {
327 else if (contentType.Equals(NS_LITERAL_STRING(
"video"))) {
330 else if (contentType.Equals(NS_LITERAL_STRING(
"image"))) {
333 NS_WARNING(
"sbDeviceUtils::GetTranscodeType: "
334 "returning unknown transcoding type");
347 NS_ENSURE_ARG_POINTER(aError);
348 NS_ENSURE_ARG_POINTER(aDevice);
352 nsCOMPtr<nsIWritablePropertyBag2> bag =
353 do_CreateInstance(
"@songbirdnest.com/moz/xpcom/sbpropertybag;1", &rv);
354 NS_ENSURE_SUCCESS(rv, rv);
355 nsCOMPtr<nsISupportsString> errorString(do_QueryInterface(aError));
356 NS_ENSURE_TRUE(errorString, NS_ERROR_NO_INTERFACE);
358 rv = errorString->GetData(message);
359 if (NS_SUCCEEDED(rv)) {
360 rv = bag->SetPropertyAsAString(NS_LITERAL_STRING(
"message"),
362 NS_ENSURE_SUCCESS(rv, rv);
364 rv = bag->SetPropertyAsInterface(NS_LITERAL_STRING(
"transcode-error"),
366 NS_ENSURE_SUCCESS(rv, rv);
380 TRACE((
"%s", __FUNCTION__));
381 NS_ENSURE_ARG_POINTER(aMediaItem);
382 NS_ENSURE_ARG_POINTER(aProfile);
383 NS_ENSURE_ARG_POINTER(aDeviceCompatibility);
391 return NS_ERROR_NOT_AVAILABLE;
395 bool needsTranscoding =
false;
397 nsCOMPtr<sbIMediaFormat> mediaFormat;
398 rv =
GetMediaFormat(transcodeType, aMediaItem, getter_AddRefs(mediaFormat));
404 NS_ENSURE_SUCCESS(rv2, rv2);
405 nsTArray<nsString> params;
406 params.AppendElement(inputUri);
408 nsCOMPtr<sbITranscodeError> error;
414 getter_AddRefs(error));
415 NS_ENSURE_SUCCESS(rv2, rv2);
417 NS_ENSURE_SUCCESS(rv2, rv2);
419 if (rv == NS_ERROR_NOT_AVAILABLE) {
422 NS_ENSURE_SUCCESS(rv, rv);
427 NS_ENSURE_SUCCESS(rv, rv);
429 if (!needsTranscoding) {
434 nsCOMPtr<sbIDeviceTranscodingConfigurator> configurator;
436 getter_AddRefs(configurator));
437 NS_ENSURE_SUCCESS(rv, rv);
439 nsCOMPtr<nsIURI> inputUri;
440 rv = aMediaItem->GetContentSrc(getter_AddRefs(inputUri));
441 NS_ENSURE_SUCCESS(rv, rv);
442 rv = configurator->SetInputUri(inputUri);
443 NS_ENSURE_SUCCESS(rv, rv);
444 nsCOMPtr<sbIDevice> device =
445 do_QueryInterface(NS_ISUPPORTS_CAST(
sbIDevice*, mBaseDevice), &rv);
446 NS_ENSURE_SUCCESS(rv, rv);
447 rv = configurator->SetDevice(device);
448 NS_ENSURE_SUCCESS(rv, rv);
450 rv = configurator->DetermineOutputType();
451 if (NS_SUCCEEDED(rv)) {
456 nsCOMPtr<sbITranscodeError> error;
457 rv = configurator->GetLastError(getter_AddRefs(error));
458 if (NS_SUCCEEDED(rv) && error) {
459 rv = error->SetDestItem(aMediaItem);
460 NS_ENSURE_SUCCESS(rv, rv);
462 NS_ENSURE_SUCCESS(rv, rv);
473 nsCOMPtr<sbIMediaFormatMutable> format;
474 nsCOMPtr<sbIMediaFormatAudioMutable> audioFormat;
475 nsCOMPtr<sbIMediaFormatContainerMutable> containerFormat;
478 NS_ENSURE_SUCCESS (rv, rv);
482 PRUint32 channels = 0;
483 PRUint32 bitrate = 0;
493 formatInfo.
Codec =
"audio/x-unknown";
497 rv = audioFormat->SetAudioType(NS_ConvertASCIItoUTF16(formatInfo.
Codec));
498 NS_ENSURE_SUCCESS (rv, rv);
507 rv = audioFormat->SetSampleRate (rate);
508 NS_ENSURE_SUCCESS (rv, rv);
514 rv = audioFormat->SetChannels (channels);
515 NS_ENSURE_SUCCESS (rv, rv);
519 rv = audioFormat->SetBitRate (bitrate);
520 NS_ENSURE_SUCCESS (rv, rv);
524 NS_ENSURE_SUCCESS (rv, rv);
526 containerFormat->SetContainerType(
528 NS_ENSURE_SUCCESS (rv, rv);
531 NS_ENSURE_SUCCESS (rv, rv);
533 rv = format->SetContainer (containerFormat);
534 NS_ENSURE_SUCCESS (rv, rv);
535 rv = format->SetAudioStream (audioFormat);
536 NS_ENSURE_SUCCESS (rv, rv);
538 rv = CallQueryInterface(format.get(), aMediaFormat);
539 NS_ENSURE_SUCCESS (rv, rv);
555 NS_ENSURE_SUCCESS(rv, rv);
560 if (!mMediaInspector) {
562 NS_ENSURE_SUCCESS(rv, rv);
564 nsCOMPtr<sbIMediaFormat> mediaFormat;
565 rv = mMediaInspector->InspectMedia(aMediaItem, getter_AddRefs(mediaFormat));
566 NS_ENSURE_SUCCESS(rv, rv);
568 mediaFormat.forget(aMediaFormat);
577 if (!mMediaInspector) {
579 NS_ENSURE_SUCCESS(rv, rv);
581 NS_ADDREF(*_retval = mMediaInspector);
589 nsIURI * aDestinationURI,
590 nsIURI ** aTranscodedDestinationURI)
592 NS_ENSURE_ARG_POINTER(aMediaItem);
593 NS_ENSURE_ARG_POINTER(aDeviceStatusHelper);
594 NS_ENSURE_ARG_POINTER(aDestinationURI);
600 nsCOMPtr<nsISupports> tcJob;
601 nsCOMPtr<sbITranscodeManager> txMgr;
602 rv = GetTranscodeManager(getter_AddRefs(txMgr));
603 NS_ENSURE_SUCCESS(rv, rv);
604 rv = txMgr->GetTranscoderForMediaItem(aMediaItem,
605 getter_AddRefs(tcJob));
606 NS_ENSURE_SUCCESS(rv, rv);
608 nsCOMPtr<nsIThread>
target;
609 rv = NS_GetMainThread(getter_AddRefs(target));
610 NS_ENSURE_SUCCESS(rv, rv);
614 NS_ENSURE_SUCCESS(rv, rv);
616 nsCOMPtr<nsIURI> transcodedDestinationURI;
617 nsCOMPtr<nsIURI> transcodedDestinationURIProxy;
618 rv = ioService->NewURI(NS_LITERAL_CSTRING(
""),
621 getter_AddRefs(transcodedDestinationURI));
622 NS_ENSURE_SUCCESS(rv, rv);
625 transcodedDestinationURI,
626 NS_PROXY_SYNC | NS_PROXY_ALWAYS,
627 getter_AddRefs(transcodedDestinationURIProxy));
628 NS_ENSURE_SUCCESS(rv, rv);
629 transcodedDestinationURI = transcodedDestinationURIProxy;
631 nsCOMPtr<sbITranscodeVideoJob> transcodeJob = do_QueryInterface(tcJob, &rv);
632 NS_ENSURE_SUCCESS(rv, rv);
633 nsCOMPtr<sbITranscodeVideoJob> proxyTranscodeJob;
637 NS_PROXY_SYNC | NS_PROXY_ALWAYS,
638 getter_AddRefs(proxyTranscodeJob));
639 NS_ENSURE_SUCCESS(rv, rv);
641 transcodeJob.swap(proxyTranscodeJob);
645 nsCString destinationURISpec;
646 rv = aDestinationURI->GetSpec(destinationURISpec);
647 NS_ENSURE_SUCCESS(rv, rv);
648 rv = transcodeJob->SetDestURI(NS_ConvertUTF8toUTF16(destinationURISpec));
649 NS_ENSURE_SUCCESS(rv, rv);
651 nsCOMPtr<nsIURI> sourceURI;
652 rv = aMediaItem->GetContentSrc(getter_AddRefs(sourceURI));
653 NS_ENSURE_SUCCESS(rv, rv);
654 nsCString sourceURISpec;
655 rv = sourceURI->GetSpec(sourceURISpec);
656 NS_ENSURE_SUCCESS(rv, rv);
657 rv = transcodeJob->SetSourceURI(NS_ConvertUTF8toUTF16(sourceURISpec));
658 NS_ENSURE_SUCCESS(rv, rv);
660 nsCOMPtr<sbIPropertyArray> metadata;
661 rv = aMediaItem->GetProperties(nsnull, getter_AddRefs(metadata));
662 NS_ENSURE_SUCCESS(rv, rv);
663 rv = transcodeJob->SetMetadata(metadata);
664 NS_ENSURE_SUCCESS(rv, rv);
667 nsCOMPtr<sbIDeviceTranscodingConfigurator> configurator;
669 getter_AddRefs(configurator));
670 NS_ENSURE_SUCCESS(rv, rv);
672 rv = configurator->SetInputUri(sourceURI);
673 NS_ENSURE_SUCCESS(rv, rv);
674 nsCOMPtr<sbIDevice> device =
675 do_QueryInterface(NS_ISUPPORTS_CAST(
sbIDevice*, mBaseDevice), &rv);
676 NS_ENSURE_SUCCESS(rv, rv);
677 rv = configurator->SetDevice(device);
678 NS_ENSURE_SUCCESS(rv, rv);
680 nsCOMPtr<sbITranscodingConfigurator> qiConfigurator =
681 do_QueryInterface(configurator, &rv);
682 NS_ENSURE_SUCCESS(rv, rv);
684 rv = transcodeJob->SetConfigurator(qiConfigurator);
685 NS_ENSURE_SUCCESS(rv, rv);
689 nsCOMPtr<sbITranscodeAlbumArt> albumArt = do_CreateInstance(
691 NS_ENSURE_SUCCESS(rv, rv);
693 nsCOMPtr<nsIArray> imageFormats;
696 if (rv != NS_ERROR_NOT_AVAILABLE) {
697 NS_ENSURE_SUCCESS(rv, rv);
700 rv = albumArt->Init(aMediaItem, imageFormats);
701 if (NS_SUCCEEDED (rv)) {
702 nsCOMPtr<nsIInputStream> imageStream;
703 rv = albumArt->GetTranscodedArt(getter_AddRefs(imageStream));
704 if (imageStream && NS_SUCCEEDED(rv)) {
705 rv = transcodeJob->SetMetadataImage(imageStream);
706 NS_ENSURE_SUCCESS(rv, rv);
710 nsCOMPtr<sbIJobCancelable> cancel = do_QueryInterface(tcJob);
712 PRMonitor *
const stopMonitor =
714 NS_ENSURE_TRUE(stopMonitor, NS_ERROR_UNEXPECTED);
717 nsRefPtr<sbTranscodeProgressListener>
listener =
724 NS_ENSURE_TRUE(listener, NS_ERROR_OUT_OF_MEMORY);
727 nsCOMPtr<sbIJobProgress> progress = do_QueryInterface(tcJob, &rv);
728 NS_ENSURE_SUCCESS(rv, rv);
729 nsCOMPtr<sbIJobProgress> proxiedProgress;
733 NS_PROXY_SYNC | NS_PROXY_ALWAYS,
734 getter_AddRefs(proxiedProgress));
735 NS_ENSURE_SUCCESS(rv, rv);
736 rv = proxiedProgress->AddJobProgressListener(listener);
737 NS_ENSURE_SUCCESS(rv, rv);
740 nsCOMPtr<sbIMediacoreEventTarget>
eventTarget = do_QueryInterface(tcJob,
742 NS_ENSURE_SUCCESS(rv, rv);
743 rv = eventTarget->AddListener(listener);
744 NS_ENSURE_SUCCESS(rv, rv);
747 rv = transcodeJob->Transcode();
748 NS_ENSURE_SUCCESS(rv, rv);
753 PRBool isComplete = PR_FALSE;
754 while (!isComplete) {
756 nsAutoMonitor monitor(stopMonitor);
759 isComplete = listener->IsComplete();
767 nsAutoString destURI;
768 rv = transcodeJob->GetDestURI(destURI);
769 NS_ENSURE_SUCCESS(rv, rv);
770 rv = ioService->NewURI(NS_ConvertUTF16toUTF8(destURI),
773 getter_AddRefs(transcodedDestinationURI));
774 NS_ENSURE_SUCCESS(rv, rv);
777 transcodedDestinationURI,
778 NS_PROXY_SYNC | NS_PROXY_ALWAYS,
779 getter_AddRefs(transcodedDestinationURIProxy));
780 NS_ENSURE_SUCCESS(rv, rv);
781 transcodedDestinationURI = transcodedDestinationURIProxy;
783 if (aTranscodedDestinationURI)
784 transcodedDestinationURI.forget(aTranscodedDestinationURI);
787 if (listener->IsAborted()) {
788 nsCOMPtr<nsIFileURL> fileURL =
789 do_QueryInterface(transcodedDestinationURIProxy);
791 nsCOMPtr<nsIFile>
file;
792 rv = fileURL->GetFile(getter_AddRefs(file));
793 if(NS_SUCCEEDED(rv)) {
794 rv = file->Remove(PR_FALSE);
795 NS_WARN_IF_FALSE(NS_SUCCEEDED(rv),
796 "Failed to remove temporary file used for transcoding");
804 rv = progress->GetStatus(&status);
805 NS_ENSURE_SUCCESS(rv, rv);
811 nsCOMPtr<nsIStringEnumerator> errorMessageEnum;
812 rv = progress->GetErrorMessages(getter_AddRefs(errorMessageEnum));
815 if (NS_SUCCEEDED(rv)) {
817 rv = errorMessageEnum->HasMore(&hasMore);
822 nsAutoString errorMessage;
823 rv = errorMessageEnum->GetNext(errorMessage);
828 LOG((
"sbMSCDeviceBase::ReqTranscodeWrite error %s\n",
829 NS_ConvertUTF16toUTF8(errorMessage).
get()));
832 rv = errorMessageEnum->HasMore(&hasMore);
849 nsresult sbDeviceTranscoding::GetTranscodeManager(
853 if (!mTranscodeManager) {
857 (
"@songbirdnest.com/Songbird/Mediacore/TranscodeManager;1", &rv);
858 NS_ENSURE_SUCCESS(rv, rv);
861 *aTranscodeManager = mTranscodeManager;
862 NS_ADDREF(*aTranscodeManager);
const unsigned long TRANSCODE_TYPE_IMAGE
NS_IMETHOD GetPreference(const nsAString &aPrefName, nsIVariant **_retval)
nsresult GetMediaInspector(sbIMediaInspector **_retval)
nsresult CreateAndDispatchEvent(PRUint32 aType, nsIVariant *aData, PRBool aAsync=PR_TRUE, sbIDeviceEventTarget *aTarget=nsnull)
PRBool IsPlaylist() const
nsresult GetAudioFormatFromMediaItem(sbIMediaItem *aMediaItem, sbIMediaFormat **aMediaFormat)
nsRefPtr< sbDeviceRequestThreadQueue > mRequestThreadQueue
nsresult SB_NewTranscodeError(const nsAString &aMessageWithItem, const nsAString &aMessageWithoutItem, const nsAString &aDetails, const nsAString &aUri, sbIMediaItem *aMediaItem, sbITranscodeError **_retval)
Generic interface for exposing long running jobs to the UI.
An object capable of transcoding a source URI to a destination file.
static bool IsItemDRMProtected(sbIMediaItem *aMediaItem)
CompatibilityType destinationCompatibility
const unsigned long TRANSCODE_TYPE_AUDIO
const unsigned long TRANSCODE_TYPE_UNKNOWN
An object defining a transcoding profile.
const unsigned short STATUS_SUCCEEDED
Constant indicating that the job has completed.
nsresult do_GetProxyForObject(nsIEventTarget *aTarget, REFNSIID aIID, nsISupports *aObj, PRInt32 aProxyType, void **aProxyObject)
Songbird Variant Utility Definitions.
static nsresult ApplyPropertyPreferencesToProfile(sbIDevice *aDevice, nsIArray *aPropertyArray, nsString aPrefNameBase)
static nsresult GetSupportedTranscodeProfiles(PRUint32 aType, sbIDevice *aDevice, nsIArray **aProfiles)
nsresult TranscodeMediaItem(sbIMediaItem *aItem, sbDeviceStatusHelper *aDeviceStatusHelper, nsIURI *aDestinationURI, nsIURI **aTranscodedDestinationURI=nsnull)
const unsigned long TRANSCODE_TYPE_AUDIO_VIDEO
virtual PRBool IsRequestAborted()
const_iterator end() const
nsresult GetMediaFormat(PRUint32 aTranscodeType, sbIMediaItem *aMediaItem, sbIMediaFormat **aMediaFormat)
#define SONGBIRD_TRANSCODEALBUMART_CONTRACTID
const unsigned long REQUEST_WRITE
const sbCreateProxiedComponent do_ProxiedGetService(const nsCID &aCID, nsresult *error=0)
RequestItems::const_iterator const_iterator
const unsigned long EVENT_DEVICE_TRANSCODE_ERROR
nsresult FindTranscodeProfile(sbIMediaItem *aMediaItem, sbITranscodeProfile **aProfile, CompatibilityType *aDeviceCompatibility)
nsresult PrepareBatchForTranscoding(Batch &aBatch)
aBatch The batch to process
static nsresult GetFormatTypeForItem(sbIMediaItem *aItem, sbExtensionToContentFormatEntry_t &aFormatType, PRUint32 &aBitRate, PRUint32 &aSampleRate)
For a media item, get format information describing it (extension, mime type, etc.
virtual nsresult SupportsMediaItemDRM(sbIMediaItem *aMediaItem, PRBool aReportErrors, PRBool *_retval)
sbITranscodeProfile * transcodeProfile
static sbTranscodeProgressListener * New(sbBaseDevice *aDeviceBase, sbDeviceStatusHelper *aDeviceStatusHelper, sbIMediaItem *aItem, PRMonitor *aCompleteNotifyMonitor=nsnull, StatusProperty const &aStatusProperty=StatusProperty(), sbIJobCancelable *aCancel=nsnull)
StringArrayEnumerator prototype hasMore
static nsresult DoesItemNeedTranscoding(sbExtensionToContentFormatEntry_t &aFormatType, PRUint32 &aBitRate, PRUint32 &aSampleRate, sbIDevice *aDevice, bool &aNeedsTranscoding)
Determine if an item needs transcoding.
static nsresult DispatchTranscodeError(sbITranscodeError *aError, sbBaseDevice *aDevice)
Songbird Device Status Services Definitions.
nsresult GetSupportedAlbumArtFormats(nsIArray **aFormats)
virtual nsresult GetSupportedTranscodeProfiles(PRUint32 aType, nsIArray **aSupportedProfiles)
nsCOMPtr< sbIMediaItem > item
#define SB_PROPERTY_CONTENTURL
nsCOMPtr< sbITranscodeAlbumArt > albumArt
const_iterator begin() const
static nsresult GetTranscodingConfigurator(PRUint32 aTranscodeType, sbIDeviceTranscodingConfigurator **aConfigurator)
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.
char const * ContainerFormat
virtual nsresult GetSupportedTranscodeProfiles(PRUint32 aType, nsIArray **aSupportedProfiles)