2014-07-24 13:47:00 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim:set ts=2 sw=2 sts=2 et cindent: */
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
#ifndef mozilla_AppleDecoderModule_h
|
|
|
|
#define mozilla_AppleDecoderModule_h
|
|
|
|
|
|
|
|
#include "PlatformDecoderModule.h"
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
|
|
|
|
class AppleDecoderModule : public PlatformDecoderModule {
|
|
|
|
public:
|
|
|
|
AppleDecoderModule();
|
|
|
|
virtual ~AppleDecoderModule();
|
|
|
|
|
|
|
|
// Perform any per-instance initialization.
|
|
|
|
// Main thread only.
|
|
|
|
nsresult Startup();
|
|
|
|
|
|
|
|
// Called when the decoders have shutdown. Main thread only.
|
|
|
|
// Does this really need to be main thread only????
|
|
|
|
virtual nsresult Shutdown() MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
// Decode thread.
|
2014-07-30 18:40:21 -07:00
|
|
|
virtual already_AddRefed<MediaDataDecoder>
|
2014-07-24 13:47:00 -07:00
|
|
|
CreateH264Decoder(const mp4_demuxer::VideoDecoderConfig& aConfig,
|
2014-07-30 18:40:14 -07:00
|
|
|
layers::LayersBackend aLayersBackend,
|
|
|
|
layers::ImageContainer* aImageContainer,
|
2014-07-24 13:47:00 -07:00
|
|
|
MediaTaskQueue* aVideoTaskQueue,
|
|
|
|
MediaDataDecoderCallback* aCallback) MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
// Decode thread.
|
2014-07-30 18:40:21 -07:00
|
|
|
virtual already_AddRefed<MediaDataDecoder>
|
2014-08-14 23:25:06 -07:00
|
|
|
CreateAudioDecoder(const mp4_demuxer::AudioDecoderConfig& aConfig,
|
|
|
|
MediaTaskQueue* aAudioTaskQueue,
|
|
|
|
MediaDataDecoderCallback* aCallback) MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual bool SupportsAudioMimeType(const char* aMimeType) MOZ_OVERRIDE;
|
2014-07-24 13:47:00 -07:00
|
|
|
|
|
|
|
static void Init();
|
2014-09-11 17:53:19 -07:00
|
|
|
static nsresult CanDecode();
|
|
|
|
|
2014-07-24 13:47:00 -07:00
|
|
|
private:
|
2014-09-11 17:53:19 -07:00
|
|
|
friend class InitTask;
|
|
|
|
friend class LinkTask;
|
|
|
|
friend class UnlinkTask;
|
|
|
|
|
|
|
|
static bool sInitialized;
|
2014-09-16 19:54:26 -07:00
|
|
|
static bool sIsVTAvailable;
|
2014-09-11 17:53:19 -07:00
|
|
|
static bool sIsVTHWAvailable;
|
2014-09-16 19:54:26 -07:00
|
|
|
static bool sIsVDAAvailable;
|
2014-09-11 17:53:19 -07:00
|
|
|
static bool sForceVDA;
|
2014-07-24 13:47:00 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // mozilla_AppleDecoderModule_h
|