sbGStreamerTranscodeAudioConfigurator Class Reference

#include <sbGStreamerTranscodeAudioConfigurator.h>

Inheritance diagram for sbGStreamerTranscodeAudioConfigurator:
[legend]
Collaboration diagram for sbGStreamerTranscodeAudioConfigurator:
[legend]

Classes

struct  EncoderProfileData
 

Public Member Functions

NS_IMETHOD GetInputUri (nsIURI **aUri)
 
NS_IMETHOD SetInputUri (nsIURI *aUri)
 
NS_IMETHOD GetInputFormat (sbIMediaFormat **aInputFormat)
 
NS_IMETHOD SetInputFormat (sbIMediaFormat *aInputFormat)
 
NS_IMETHOD GetLastError (sbITranscodeError **aLastError)
 
NS_IMETHOD GetMuxer (nsAString &aMuxer)
 
NS_IMETHOD GetUseMuxer (PRBool *aUseMuxer)
 
NS_IMETHOD GetFileExtension (nsACString &aFileExtension)
 
NS_IMETHOD GetVideoEncoder (nsAString &aVideoEncoder)
 
NS_IMETHOD GetUseVideoEncoder (PRBool *aUseVideoEncoder)
 
NS_IMETHOD GetVideoFormat (sbIMediaFormatVideo **aVideoFormat)
 
NS_IMETHOD GetAudioEncoder (nsAString &aAudioEncoder)
 
NS_IMETHOD GetUseAudioEncoder (PRBool *aUseAudioEncoder)
 
NS_IMETHOD GetAudioFormat (sbIMediaFormatAudio **aAudioFormat)
 
NS_IMETHOD GetVideoEncoderProperties (nsIPropertyBag **aVideoEncoderProperties)
 
NS_IMETHOD GetAudioEncoderProperties (nsIPropertyBag **aAudioEncoderProperties)
 
NS_IMETHOD DetermineOutputType ()
 
NS_IMETHOD Configurate ()
 
NS_IMETHOD GetAvailableProfiles (nsIArray **aProfiles)
 
 sbGStreamerTranscodeAudioConfigurator ()
 
- Public Member Functions inherited from sbTranscodingConfigurator
NS_DECL_ISUPPORTS
NS_DECL_SBITRANSCODINGCONFIGURATOR 
sbTranscodingConfigurator ()
 
- Public Member Functions inherited from sbITranscodingConfigurator
void determineOutputType ()
 Determine the trancode destination format to use, based on the target device and desired output quality settings. The device must be set before calling this function. This will only determine the file format settings, not the details such as dimensions or bitrates. The muxer and encoder attributes below may be read after calling this method, but not the format details or properties. More...
 
void configurate ()
 Determine the transcode settings to use based on the input given. Both the device and the input format must be set before calling this function. Once this is called, the functions below may be called (they will throw an error if called before this function is called). More...
 

Protected Member Functions

virtual ~sbGStreamerTranscodeAudioConfigurator ()
 
nsresult EnsureProfileAvailable (sbITranscodeProfile *aProfile)
 
nsresult CheckProfileSupportedByDevice (sbITranscodeProfile *aProfile, sbIAudioFormatType **aFormat)
 
nsresult SelectProfile ()
 
nsresult SelectOutputAudioFormat ()
 
nsresult SetAudioProperties ()
 
nsresult CopyPropertiesIntoBag (nsIArray *aSrcProps, nsIWritablePropertyBag *aDstBag, PRBool aIsVideo)
 
nsresult ApplyPreferencesToPropertyArray (sbIDevice *aDevice, nsIArray *aPropertyArray, nsString aPrefNameBase)
 
- Protected Member Functions inherited from sbTranscodingConfigurator
virtual ~sbTranscodingConfigurator ()
 

Protected Attributes

nsDataHashtable
< nsISupportsHashKey,
EncoderProfileData
mElementNames
 
nsCOMPtr< sbIDevicemDevice
 
nsCOMPtr< nsIArray > mAvailableProfiles
 
nsCOMPtr< sbITranscodeProfilemSelectedProfile
 
nsCOMPtr< sbIAudioFormatTypemSelectedFormat
 
PRBool mProfileFromPrefs
 
PRBool mProfileFromGlobalPrefs
 
- Protected Attributes inherited from sbTranscodingConfigurator
CONFIGURATE_STATE mConfigurateState
 
nsCOMPtr< nsIURI > mInputUri
 
nsCOMPtr< sbITranscodeErrormLastError
 
nsCOMPtr< sbIMediaFormatmInputFormat
 
PRBool mUseMuxer
 
nsString mMuxer
 
PRBool mUseVideoEncoder
 
nsString mVideoEncoder
 
PRBool mUseAudioEncoder
 
nsString mAudioEncoder
 
nsCString mFileExtension
 
nsCOMPtr< sbIMediaFormatVideomVideoFormat
 
nsCOMPtr< sbIMediaFormatAudiomAudioFormat
 
nsCOMPtr< nsIWritablePropertyBag2 > mVideoEncoderProperties
 
nsCOMPtr< nsIWritablePropertyBag2 > mAudioEncoderProperties
 

Additional Inherited Members

- Public Attributes inherited from sbITranscodingConfigurator
readonly attribute nsIArray availableProfiles
 
attribute nsIURI inputUri
 
attribute sbIMediaFormat inputFormat
 The input format to use when configuring the transcode profile. More...
 
readonly attribute
sbITranscodeError 
lastError
 
readonly attribute AString muxer
 The muxer to use. The name is specific to the transcoder (for example, this may be a gstreamer element name for a gstreamer-based transcoder). More...
 
readonly attribute boolean useMuxer
 Whether a muxer is in use. e.g. for a bare FLAC audio file it won't be. More...
 
readonly attribute ACString fileExtension
 The file extension to use for transcoded files. This may depend on the muxer or the used codecs. It may also depend on nothing at all; it's all up to the configurator. More...
 
readonly attribute AString videoEncoder
 The video encoder to use. The name is specific to the transcoder (for example, this may be a gstreamer element name for a gstreamer-based transcoder). More...
 
readonly attribute boolean useVideoEncoder
 Whether a video encoder is in use. If this is true, the videoEncoder attribute must be non-empty. More...
 
readonly attribute AString audioEncoder
 The audio encoder to use. The name is specific to the transcoder (for example, this may be a gstreamer element name for a gstreamer-based transcoder). This may be a void string if raw audio is desired. More...
 
readonly attribute boolean useAudioEncoder
 Whether a audio encoder is in use. If this is true, the audioEncoder attribute may be empty; indicating that raw audio is desired. More...
 
readonly attribute
sbIMediaFormatVideo 
videoFormat
 The basic video format for data that is not specific to a particular codec. More...
 
readonly attribute
sbIMediaFormatAudio 
audioFormat
 The basic audio format for data that is not specific to a particular codec. More...
 
readonly attribute nsIPropertyBag videoEncoderProperties
 With the input given, return the properties to set on the encoder to encode this format. This is used to e.g. select a bitrate for the video encoder. More...
 
readonly attribute nsIPropertyBag audioEncoderProperties
 With the input given, return the properties to set on the encoder to encode this format. This is used to e.g. select a bitrate for the audio encoder. More...
 
- Public Attributes inherited from sbIDeviceTranscodingConfigurator
attribute sbIDevice device
 Set the device that we get the capabilities from, using the capabilities of the device this function will set inputFormat for the configurate function to use so we can limit the transcoding to only what this device supports. More...
 
- Protected Types inherited from sbTranscodingConfigurator
enum  CONFIGURATE_STATE { CONFIGURATE_NOT_STARTED, CONFIGURATE_OUTPUT_SET, CONFIGURATE_FINISHED }
 

Detailed Description

Definition at line 55 of file sbGStreamerTranscodeAudioConfigurator.h.

Constructor & Destructor Documentation

sbGStreamerTranscodeAudioConfigurator::sbGStreamerTranscodeAudioConfigurator ( )

Definition at line 170 of file sbGStreamerTranscodeAudioConfigurator.cpp.

sbGStreamerTranscodeAudioConfigurator::~sbGStreamerTranscodeAudioConfigurator ( )
protectedvirtual

Definition at line 184 of file sbGStreamerTranscodeAudioConfigurator.cpp.

Member Function Documentation

nsresult sbGStreamerTranscodeAudioConfigurator::ApplyPreferencesToPropertyArray ( sbIDevice aDevice,
nsIArray *  aPropertyArray,
nsString  aPrefNameBase 
)
protected

Definition at line 752 of file sbGStreamerTranscodeAudioConfigurator.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult sbGStreamerTranscodeAudioConfigurator::CheckProfileSupportedByDevice ( sbITranscodeProfile aProfile,
sbIAudioFormatType **  aFormat 
)
protected

Definition at line 366 of file sbGStreamerTranscodeAudioConfigurator.cpp.

Here is the caller graph for this function:

NS_IMETHODIMP sbGStreamerTranscodeAudioConfigurator::Configurate ( )

Definition at line 1002 of file sbGStreamerTranscodeAudioConfigurator.cpp.

Here is the call graph for this function:

nsresult sbGStreamerTranscodeAudioConfigurator::CopyPropertiesIntoBag ( nsIArray *  aSrcProps,
nsIWritablePropertyBag *  aDstBag,
PRBool  aIsVideo 
)
protected

Copy properties, either audio or video.

Parameters
aSrcPropsthe properties to copy from
aDstBagthe property bag to output
aIsVideotrue if this is for video, false for audio

Definition at line 818 of file sbGStreamerTranscodeAudioConfigurator.cpp.

Here is the caller graph for this function:

NS_IMETHODIMP sbGStreamerTranscodeAudioConfigurator::DetermineOutputType ( )

Definition at line 965 of file sbGStreamerTranscodeAudioConfigurator.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult sbGStreamerTranscodeAudioConfigurator::EnsureProfileAvailable ( sbITranscodeProfile aProfile)
protected

Make sure the given transcode profile does not use any gstreamer elements that we do not have access to.

Parameters
aProfilethe profile to test
Exceptions
NS_ERROR_NOT_AVAILABLEif the profile uses elements that are not found

Check that we have an audio encoder available

Definition at line 281 of file sbGStreamerTranscodeAudioConfigurator.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

NS_IMETHOD sbGStreamerTranscodeAudioConfigurator::GetAudioEncoder ( nsAString &  aAudioEncoder)
inline

Definition at line 78 of file sbGStreamerTranscodeAudioConfigurator.h.

NS_IMETHOD sbGStreamerTranscodeAudioConfigurator::GetAudioEncoderProperties ( nsIPropertyBag **  aAudioEncoderProperties)
inline

Definition at line 82 of file sbGStreamerTranscodeAudioConfigurator.h.

NS_IMETHOD sbGStreamerTranscodeAudioConfigurator::GetAudioFormat ( sbIMediaFormatAudio **  aAudioFormat)
inline

Definition at line 80 of file sbGStreamerTranscodeAudioConfigurator.h.

NS_IMETHODIMP sbGStreamerTranscodeAudioConfigurator::GetAvailableProfiles ( nsIArray **  aProfiles)

Definition at line 862 of file sbGStreamerTranscodeAudioConfigurator.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

NS_IMETHOD sbGStreamerTranscodeAudioConfigurator::GetFileExtension ( nsACString &  aFileExtension)
inline

Definition at line 74 of file sbGStreamerTranscodeAudioConfigurator.h.

NS_IMETHOD sbGStreamerTranscodeAudioConfigurator::GetInputFormat ( sbIMediaFormat **  aInputFormat)
inline

Definition at line 69 of file sbGStreamerTranscodeAudioConfigurator.h.

NS_IMETHOD sbGStreamerTranscodeAudioConfigurator::GetInputUri ( nsIURI **  aUri)
inline

Definition at line 67 of file sbGStreamerTranscodeAudioConfigurator.h.

NS_IMETHOD sbGStreamerTranscodeAudioConfigurator::GetLastError ( sbITranscodeError **  aLastError)
inline

Definition at line 71 of file sbGStreamerTranscodeAudioConfigurator.h.

NS_IMETHOD sbGStreamerTranscodeAudioConfigurator::GetMuxer ( nsAString &  aMuxer)
inline

Definition at line 72 of file sbGStreamerTranscodeAudioConfigurator.h.

NS_IMETHOD sbGStreamerTranscodeAudioConfigurator::GetUseAudioEncoder ( PRBool *  aUseAudioEncoder)
inline

Definition at line 79 of file sbGStreamerTranscodeAudioConfigurator.h.

NS_IMETHOD sbGStreamerTranscodeAudioConfigurator::GetUseMuxer ( PRBool *  aUseMuxer)
inline

Definition at line 73 of file sbGStreamerTranscodeAudioConfigurator.h.

NS_IMETHOD sbGStreamerTranscodeAudioConfigurator::GetUseVideoEncoder ( PRBool *  aUseVideoEncoder)
inline

Definition at line 76 of file sbGStreamerTranscodeAudioConfigurator.h.

NS_IMETHOD sbGStreamerTranscodeAudioConfigurator::GetVideoEncoder ( nsAString &  aVideoEncoder)
inline

Definition at line 75 of file sbGStreamerTranscodeAudioConfigurator.h.

NS_IMETHOD sbGStreamerTranscodeAudioConfigurator::GetVideoEncoderProperties ( nsIPropertyBag **  aVideoEncoderProperties)
inline

Definition at line 81 of file sbGStreamerTranscodeAudioConfigurator.h.

NS_IMETHOD sbGStreamerTranscodeAudioConfigurator::GetVideoFormat ( sbIMediaFormatVideo **  aVideoFormat)
inline

Definition at line 77 of file sbGStreamerTranscodeAudioConfigurator.h.

nsresult sbGStreamerTranscodeAudioConfigurator::SelectOutputAudioFormat ( )
protected

Select and set the output format (sample rate/channels/etc)

Definition at line 612 of file sbGStreamerTranscodeAudioConfigurator.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult sbGStreamerTranscodeAudioConfigurator::SelectProfile ( )
protected

Select the encoding profile to use

the device has been set the quality has been set mSelectedProfile is the encoder profile to use mSelectedFormat is ths device format matching the profile mMuxer, mVideoEncoder, mAudioEncoder are the required element names

Select the encoding profile to use

the device has been set mSelectedProfile is the encoder profile to use mSelectedFormat is the device format matching the profile (or NULL if no specific format is in use)

Definition at line 461 of file sbGStreamerTranscodeAudioConfigurator.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult sbGStreamerTranscodeAudioConfigurator::SetAudioProperties ( )
protected

Set audio-related properties

a profile has been selected mAudioEncoderProperties contains the audio properties desired

Definition at line 706 of file sbGStreamerTranscodeAudioConfigurator.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

NS_IMETHOD sbGStreamerTranscodeAudioConfigurator::SetInputFormat ( sbIMediaFormat aInputFormat)
inline

Definition at line 70 of file sbGStreamerTranscodeAudioConfigurator.h.

NS_IMETHOD sbGStreamerTranscodeAudioConfigurator::SetInputUri ( nsIURI *  aUri)
inline

Definition at line 68 of file sbGStreamerTranscodeAudioConfigurator.h.

Member Data Documentation

nsCOMPtr<nsIArray> sbGStreamerTranscodeAudioConfigurator::mAvailableProfiles
protected

A cache of the encoder profiles available (should only be used via GetAvailableProfiles)

Definition at line 173 of file sbGStreamerTranscodeAudioConfigurator.h.

nsCOMPtr<sbIDevice> sbGStreamerTranscodeAudioConfigurator::mDevice
protected

The device to transcode to

Definition at line 168 of file sbGStreamerTranscodeAudioConfigurator.h.

nsDataHashtable<nsISupportsHashKey, EncoderProfileData> sbGStreamerTranscodeAudioConfigurator::mElementNames
protected

Definition at line 163 of file sbGStreamerTranscodeAudioConfigurator.h.

PRBool sbGStreamerTranscodeAudioConfigurator::mProfileFromGlobalPrefs
protected

As above, but for whether we chose the profile from a global preference (not per-device).

Definition at line 193 of file sbGStreamerTranscodeAudioConfigurator.h.

PRBool sbGStreamerTranscodeAudioConfigurator::mProfileFromPrefs
protected

True if we selected our profile based on something set in the device preferences; in such a case we should also look for property values from preferences.

Definition at line 188 of file sbGStreamerTranscodeAudioConfigurator.h.

nsCOMPtr<sbIAudioFormatType> sbGStreamerTranscodeAudioConfigurator::mSelectedFormat
protected

The device audio format that corresponds with mSelectedProfile; set by SelectProfile()

Definition at line 182 of file sbGStreamerTranscodeAudioConfigurator.h.

nsCOMPtr<sbITranscodeProfile> sbGStreamerTranscodeAudioConfigurator::mSelectedProfile
protected

The encoder profile selected; set by SelectProfile()

Definition at line 177 of file sbGStreamerTranscodeAudioConfigurator.h.


The documentation for this class was generated from the following files: