本文整理汇总了C++中CreateDecoderParams::AudioConfig方法的典型用法代码示例。如果您正苦于以下问题:C++ CreateDecoderParams::AudioConfig方法的具体用法?C++ CreateDecoderParams::AudioConfig怎么用?C++ CreateDecoderParams::AudioConfig使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CreateDecoderParams
的用法示例。
在下文中一共展示了CreateDecoderParams::AudioConfig方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AppleATDecoder
already_AddRefed<MediaDataDecoder>
AppleDecoderModule::CreateAudioDecoder(const CreateDecoderParams& aParams)
{
RefPtr<MediaDataDecoder> decoder =
new AppleATDecoder(aParams.AudioConfig(), aParams.mTaskQueue);
return decoder.forget();
}
示例2: GonkMediaDataDecoder
already_AddRefed<MediaDataDecoder>
GonkDecoderModule::CreateAudioDecoder(const CreateDecoderParams& aParams)
{
RefPtr<MediaDataDecoder> decoder =
new GonkMediaDataDecoder(new GonkAudioDecoderManager(aParams.AudioConfig()),
aParams.mCallback);
return decoder.forget();
}
示例3: CreateAudioDecoder
// Decode thread.
already_AddRefed<MediaDataDecoder>
CreateAudioDecoder(const CreateDecoderParams& aParams) override {
const AudioInfo& config = aParams.AudioConfig();
BlankAudioDataCreator* creator = new BlankAudioDataCreator(
config.mChannels, config.mRate);
RefPtr<MediaDataDecoder> decoder =
new BlankMediaDataDecoder<BlankAudioDataCreator>(creator, aParams);
return decoder.forget();
}
示例4: mInfo
VorbisDataDecoder::VorbisDataDecoder(const CreateDecoderParams& aParams)
: mInfo(aParams.AudioConfig())
, mTaskQueue(aParams.mTaskQueue)
, mPacketCount(0)
, mFrames(0)
{
// Zero these member vars to avoid crashes in Vorbis clear functions when
// destructor is called before |Init|.
PodZero(&mVorbisBlock);
PodZero(&mVorbisDsp);
PodZero(&mVorbisInfo);
PodZero(&mVorbisComment);
}
示例5: WMFMediaDataDecoder
already_AddRefed<MediaDataDecoder>
WMFDecoderModule::CreateAudioDecoder(const CreateDecoderParams& aParams)
{
nsAutoPtr<WMFAudioMFTManager> manager(new WMFAudioMFTManager(aParams.AudioConfig()));
if (!manager->Init()) {
return nullptr;
}
RefPtr<MediaDataDecoder> decoder =
new WMFMediaDataDecoder(manager.forget(), aParams.mTaskQueue, aParams.mCallback);
return decoder.forget();
}
示例6: LOG
already_AddRefed<MediaDataDecoder> AndroidDecoderModule::CreateAudioDecoder(
const CreateDecoderParams& aParams) {
const AudioInfo& config = aParams.AudioConfig();
if (config.mBitDepth != 16) {
// We only handle 16-bit audio.
return nullptr;
}
LOG("CreateAudioFormat with mimeType=%s, mRate=%d, channels=%d",
config.mMimeType.Data(), config.mRate, config.mChannels);
nsString drmStubId;
if (mProxy) {
drmStubId = mProxy->GetMediaDrmStubId();
}
RefPtr<MediaDataDecoder> decoder =
RemoteDataDecoder::CreateAudioDecoder(aParams, drmStubId, mProxy);
return decoder.forget();
}
示例7: result
already_AddRefed<MediaDataDecoder> RemoteDecoderModule::CreateAudioDecoder(
const CreateDecoderParams& aParams) {
LaunchRDDProcessIfNeeded();
if (!mManagerThread) {
return nullptr;
}
RefPtr<RemoteAudioDecoderChild> child = new RemoteAudioDecoderChild();
MediaResult result(NS_OK);
// We can use child as a ref here because this is a sync dispatch. In
// the error case for InitIPDL, we can't just let the RefPtr go out of
// scope at the end of the method because it will release the
// RemoteAudioDecoderChild on the wrong thread. This will assert in
// RemoteDecoderChild's destructor. Passing the RefPtr by reference
// allows us to release the RemoteAudioDecoderChild on the manager
// thread during this single dispatch.
RefPtr<Runnable> task =
NS_NewRunnableFunction("RemoteDecoderModule::CreateAudioDecoder", [&]() {
result = child->InitIPDL(aParams.AudioConfig(), aParams.mOptions);
if (NS_FAILED(result)) {
// Release RemoteAudioDecoderChild here, while we're on
// manager thread. Don't just let the RefPtr go out of scope.
child = nullptr;
}
});
SyncRunnable::DispatchToThread(mManagerThread, task);
if (NS_FAILED(result)) {
if (aParams.mError) {
*aParams.mError = result;
}
return nullptr;
}
RefPtr<RemoteMediaDataDecoder> object = new RemoteMediaDataDecoder(
child, mManagerThread,
RemoteDecoderManagerChild::GetManagerAbstractThread());
return object.forget();
}
示例8: LOG
already_AddRefed<MediaDataDecoder>
AndroidDecoderModule::CreateAudioDecoder(const CreateDecoderParams& aParams)
{
const AudioInfo& config = aParams.AudioConfig();
MOZ_ASSERT(config.mBitDepth == 16, "We only handle 16-bit audio!");
MediaFormat::LocalRef format;
LOG("CreateAudioFormat with mimeType=%s, mRate=%d, channels=%d",
config.mMimeType.Data(), config.mRate, config.mChannels);
NS_ENSURE_SUCCESS(MediaFormat::CreateAudioFormat(
config.mMimeType,
config.mRate,
config.mChannels,
&format), nullptr);
RefPtr<MediaDataDecoder> decoder = MediaPrefs::PDMAndroidRemoteCodecEnabled() ?
RemoteDataDecoder::CreateAudioDecoder(config, format, aParams.mCallback) :
MediaCodecDataDecoder::CreateAudioDecoder(config, format, aParams.mCallback);
return decoder.forget();
}
示例9: mInfo
WaveDataDecoder::WaveDataDecoder(const CreateDecoderParams& aParams)
: mInfo(aParams.AudioConfig())
, mTaskQueue(aParams.mTaskQueue)
{
}