Bug 904177 - Create MediaCodecDecoder. r=sotaro, r=cpearce
authorBruce Sun <brsun@mozilla.com>
Wed, 16 Jul 2014 15:38:14 +0800
changeset 216495 40a5725d7f92a7429978155efded3f57fd33707c
parent 216494 3de3edf0c6983caf87acd9cf9571fbe1ca65f510
child 216496 7056b101fbb0a6c318c899e0cacdf78d59a5e8c6
push id515
push userraliiev@mozilla.com
push dateMon, 06 Oct 2014 12:51:51 +0000
treeherdermozilla-release@267c7a481bef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssotaro, cpearce
bugs904177
milestone33.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 904177 - Create MediaCodecDecoder. r=sotaro, r=cpearce
content/media/omx/MediaCodecDecoder.cpp
content/media/omx/MediaCodecDecoder.h
content/media/omx/moz.build
new file mode 100644
--- /dev/null
+++ b/content/media/omx/MediaCodecDecoder.cpp
@@ -0,0 +1,25 @@
+/* -*- 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 "MediaCodecDecoder.h"
+#include "MediaCodecReader.h"
+#include "MediaDecoderStateMachine.h"
+
+namespace mozilla {
+
+MediaDecoder*
+MediaCodecDecoder::Clone()
+{
+  return new MediaCodecDecoder();
+}
+
+MediaDecoderStateMachine*
+MediaCodecDecoder::CreateStateMachine()
+{
+  return new MediaDecoderStateMachine(this, new MediaCodecReader(this));
+}
+
+} // namespace mozilla
new file mode 100644
--- /dev/null
+++ b/content/media/omx/MediaCodecDecoder.h
@@ -0,0 +1,26 @@
+/* -*- 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 MEDIA_CODEC_DECODER_H
+#define MEDIA_CODEC_DECODER_H
+
+#include "MediaDecoder.h"
+
+namespace mozilla {
+
+// MediaDecoder that uses MediaCodecReader.
+class MediaCodecDecoder : public MediaDecoder
+{
+public:
+
+  virtual MediaDecoder* Clone();
+
+  virtual MediaDecoderStateMachine* CreateStateMachine();
+};
+
+} // namespace mozilla
+
+#endif // MEDIA_CODEC_DECODER_H
--- a/content/media/omx/moz.build
+++ b/content/media/omx/moz.build
@@ -45,21 +45,23 @@ if 'rtsp' in CONFIG['NECKO_PROTOCOLS']:
     ]
     SOURCES += [
         'RtspOmxDecoder.cpp',
         'RtspOmxReader.cpp',
     ]
 
 if int(CONFIG['ANDROID_VERSION']) >= 16:
     EXPORTS += [
+        'MediaCodecDecoder.h',
         'MediaCodecProxy.h',
         'MediaCodecReader.h',
     ]
     SOURCES += [
         'I420ColorConverterHelper.cpp',
+        'MediaCodecDecoder.cpp',
         'MediaCodecProxy.cpp',
         'MediaCodecReader.cpp',
     ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'gklayout'
 LOCAL_INCLUDES += [