Bug 1315850 - Stub out ChromiumCDMVideoDecoder. r=jya
MozReview-Commit-ID: 6I9N1c1nNMF
new file mode 100644
--- /dev/null
+++ b/dom/media/platforms/agnostic/eme/ChromiumCDMVideoDecoder.cpp
@@ -0,0 +1,63 @@
+/* -*- 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/. */
+
+#include "ChromiumCDMVideoDecoder.h"
+#include "GMPService.h"
+#include "GMPVideoDecoder.h"
+
+namespace mozilla {
+
+ChromiumCDMVideoDecoder::ChromiumCDMVideoDecoder(
+ const GMPVideoDecoderParams& aParams,
+ CDMProxy* aCDMProxy)
+ : mConfig(aParams.mConfig)
+ , mCrashHelper(aParams.mCrashHelper)
+ , mGMPThread(GetGMPAbstractThread())
+ , mImageContainer(aParams.mImageContainer)
+{
+}
+
+ChromiumCDMVideoDecoder::~ChromiumCDMVideoDecoder()
+{
+}
+
+RefPtr<MediaDataDecoder::InitPromise>
+ChromiumCDMVideoDecoder::Init()
+{
+ return InitPromise::CreateAndResolve(TrackInfo::kUndefinedTrack, __func__);
+}
+
+RefPtr<MediaDataDecoder::DecodePromise>
+ChromiumCDMVideoDecoder::Decode(MediaRawData* aSample)
+{
+ return DecodePromise::CreateAndReject(
+ MediaResult(NS_ERROR_DOM_MEDIA_DECODE_ERR, RESULT_DETAIL("Unimplemented")),
+ __func__);
+}
+
+RefPtr<MediaDataDecoder::FlushPromise>
+ChromiumCDMVideoDecoder::Flush()
+{
+ return FlushPromise::CreateAndReject(
+ MediaResult(NS_ERROR_DOM_MEDIA_DECODE_ERR, RESULT_DETAIL("Unimplemented")),
+ __func__);
+}
+
+RefPtr<MediaDataDecoder::DecodePromise>
+ChromiumCDMVideoDecoder::Drain()
+{
+ return DecodePromise::CreateAndReject(
+ MediaResult(NS_ERROR_DOM_MEDIA_DECODE_ERR, RESULT_DETAIL("Unimplemented")),
+ __func__);
+}
+
+RefPtr<ShutdownPromise>
+ChromiumCDMVideoDecoder::Shutdown()
+{
+ return ShutdownPromise::CreateAndResolve(true, __func__);
+}
+
+} // namespace mozilla
new file mode 100644
--- /dev/null
+++ b/dom/media/platforms/agnostic/eme/ChromiumCDMVideoDecoder.h
@@ -0,0 +1,45 @@
+/* -*- 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 ChromiumCDMVideoDecoder_h_
+#define ChromiumCDMVideoDecoder_h_
+
+#include "PlatformDecoderModule.h"
+
+namespace mozilla {
+
+class CDMProxy;
+struct GMPVideoDecoderParams;
+
+class ChromiumCDMVideoDecoder : public MediaDataDecoder
+{
+public:
+ ChromiumCDMVideoDecoder(const GMPVideoDecoderParams& aParams,
+ CDMProxy* aCDMProxy);
+
+ RefPtr<InitPromise> Init() override;
+ RefPtr<DecodePromise> Decode(MediaRawData* aSample) override;
+ RefPtr<FlushPromise> Flush() override;
+ RefPtr<DecodePromise> Drain() override;
+ RefPtr<ShutdownPromise> Shutdown() override;
+ const char* GetDescriptionName() const override
+ {
+ return "Chromium CDM video decoder";
+ }
+
+private:
+ ~ChromiumCDMVideoDecoder();
+
+ const VideoInfo mConfig;
+ RefPtr<GMPCrashHelper> mCrashHelper;
+ RefPtr<AbstractThread> mGMPThread;
+ RefPtr<layers::ImageContainer> mImageContainer;
+ MozPromiseHolder<InitPromise> mInitPromise;
+};
+
+} // mozilla
+
+#endif // ChromiumCDMVideoDecoder_h_
--- a/dom/media/platforms/agnostic/eme/moz.build
+++ b/dom/media/platforms/agnostic/eme/moz.build
@@ -1,22 +1,24 @@
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# 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/.
EXPORTS += [
+ 'ChromiumCDMVideoDecoder.h',
'DecryptThroughputLimit.h',
'EMEDecoderModule.h',
'EMEVideoDecoder.h',
'SamplesWaitingForKey.h',
]
UNIFIED_SOURCES += [
+ 'ChromiumCDMVideoDecoder.cpp',
'EMEDecoderModule.cpp',
'EMEVideoDecoder.cpp',
'SamplesWaitingForKey.cpp',
]
include('/ipc/chromium/chromium-config.mozbuild')
FINAL_LIBRARY = 'xul'