예제 #1
0
bool
WMFDecoderModule::SupportsSharedDecoders(const VideoInfo& aConfig) const
{
    // If DXVA is enabled, but we're not going to use it for this specific config, then
    // we can't use the shared decoder.
    return !sDXVAEnabled || ShouldUseDXVA(aConfig);
}
예제 #2
0
already_AddRefed<MediaDataDecoder>
WMFDecoderModule::CreateVideoDecoder(const VideoInfo& aConfig,
                                     layers::LayersBackend aLayersBackend,
                                     layers::ImageContainer* aImageContainer,
                                     FlushableMediaTaskQueue* aVideoTaskQueue,
                                     MediaDataDecoderCallback* aCallback)
{
    nsRefPtr<MediaDataDecoder> decoder =
        new WMFMediaDataDecoder(new WMFVideoMFTManager(aConfig,
                                aLayersBackend,
                                aImageContainer,
                                sDXVAEnabled && ShouldUseDXVA(aConfig)),
                                aVideoTaskQueue,
                                aCallback);
    return decoder.forget();
}
예제 #3
0
already_AddRefed<MediaDataDecoder>
WMFDecoderModule::CreateVideoDecoder(const VideoInfo& aConfig,
                                     layers::LayersBackend aLayersBackend,
                                     layers::ImageContainer* aImageContainer,
                                     FlushableTaskQueue* aVideoTaskQueue,
                                     MediaDataDecoderCallback* aCallback)
{
  nsAutoPtr<WMFVideoMFTManager> manager =
    new WMFVideoMFTManager(aConfig,
                           aLayersBackend,
                           aImageContainer,
                           sDXVAEnabled && ShouldUseDXVA(aConfig));

  nsRefPtr<MFTDecoder> mft = manager->Init();

  if (!mft) {
    return nullptr;
  }

  nsRefPtr<MediaDataDecoder> decoder =
    new WMFMediaDataDecoder(manager.forget(), mft, aVideoTaskQueue, aCallback);

  return decoder.forget();
}