Bug 1257777 - Part 1: AIDL interfaces for remote codec and manager service binders. r?nalexander draft
authorJohn Lin <jolin@mozilla.com>
Fri, 05 Aug 2016 15:28:04 +0800
changeset 397134 83e291503696b7aa763a28d7e1b2002fc6c921d7
parent 396804 0ba72e8027cfcbcbf3426770ac264a7ade2af090
child 397135 0f571c42d1485f897fc5f2da119a19af46bec851
child 397163 ec42c4b3713ba3c01e52aa106a2e4a2eea61adbf
push id25213
push userbmo:jolin@mozilla.com
push dateFri, 05 Aug 2016 08:21:05 +0000
reviewersnalexander
bugs1257777
milestone51.0a1
Bug 1257777 - Part 1: AIDL interfaces for remote codec and manager service binders. r?nalexander MozReview-Commit-ID: DAaJyWcyC0c
mobile/android/base/Makefile.in
mobile/android/base/aidl/org/mozilla/gecko/media/FormatParam.aidl
mobile/android/base/aidl/org/mozilla/gecko/media/ICodec.aidl
mobile/android/base/aidl/org/mozilla/gecko/media/ICodecCallbacks.aidl
mobile/android/base/aidl/org/mozilla/gecko/media/ICodecManager.aidl
mobile/android/base/aidl/org/mozilla/gecko/media/Sample.aidl
mobile/android/base/moz.build
--- a/mobile/android/base/Makefile.in
+++ b/mobile/android/base/Makefile.in
@@ -538,8 +538,17 @@ libs:: jni-stubs.inc GeneratedJNIWrapper
 	  echo && \
 	  echo '* Repeat the build, and check in any changes.       *' && \
 	  echo '*****************************************************' && \
 	  exit 1)
 endif
 
 libs:: classes.dex
 	$(INSTALL) classes.dex $(FINAL_TARGET)
+
+# Generate Java binder interfaces from AIDL files.
+aidl_src_path := $(srcdir)/aidl
+aidl_target_path := generated
+media_pkg := org/mozilla/gecko/media
+
+$(aidl_target_path)/$(media_pkg)/%.java:$(aidl_src_path)/$(media_pkg)/%.aidl
+	@echo "Processing AIDL: $< => $@"
+	$(AIDL) -p$(ANDROID_SDK)/framework.aidl -I$(aidl_src_path) -o$(aidl_target_path) $<
new file mode 100644
--- /dev/null
+++ b/mobile/android/base/aidl/org/mozilla/gecko/media/FormatParam.aidl
@@ -0,0 +1,7 @@
+/* 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/. */
+
+package org.mozilla.gecko.media;
+
+parcelable FormatParam;
\ No newline at end of file
new file mode 100644
--- /dev/null
+++ b/mobile/android/base/aidl/org/mozilla/gecko/media/ICodec.aidl
@@ -0,0 +1,23 @@
+/* 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/. */
+
+package org.mozilla.gecko.media;
+
+// Non-default types used in interface.
+import android.os.Bundle;
+import android.view.Surface;
+import org.mozilla.gecko.media.FormatParam;
+import org.mozilla.gecko.media.ICodecCallbacks;
+import org.mozilla.gecko.media.Sample;
+
+interface ICodec {
+    void setCallbacks(in ICodecCallbacks callbacks);
+    boolean configure(in FormatParam format, inout Surface surface, int flags);
+    oneway void start();
+    oneway void stop();
+    oneway void flush();
+    oneway void release();
+
+    oneway void queueInput(in Sample sample);
+}
new file mode 100644
--- /dev/null
+++ b/mobile/android/base/aidl/org/mozilla/gecko/media/ICodecCallbacks.aidl
@@ -0,0 +1,16 @@
+/* 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/. */
+
+package org.mozilla.gecko.media;
+
+// Non-default types used in interface.
+import org.mozilla.gecko.media.FormatParam;
+import org.mozilla.gecko.media.Sample;
+
+interface ICodecCallbacks {
+    oneway void onInputExhausted();
+    oneway void onOutputFormatChanged(in FormatParam format);
+    oneway void onOutput(in Sample sample);
+    oneway void onError(boolean fatal);
+}
\ No newline at end of file
new file mode 100644
--- /dev/null
+++ b/mobile/android/base/aidl/org/mozilla/gecko/media/ICodecManager.aidl
@@ -0,0 +1,13 @@
+/* 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/. */
+
+package org.mozilla.gecko.media;
+
+// Non-default types used in interface.
+import org.mozilla.gecko.media.ICodec;
+
+interface ICodecManager {
+    /** Creates a remote ICodec object. */
+    ICodec createCodec();
+}
new file mode 100644
--- /dev/null
+++ b/mobile/android/base/aidl/org/mozilla/gecko/media/Sample.aidl
@@ -0,0 +1,7 @@
+/* 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/. */
+
+package org.mozilla.gecko.media;
+
+parcelable Sample;
\ No newline at end of file
--- a/mobile/android/base/moz.build
+++ b/mobile/android/base/moz.build
@@ -1029,8 +1029,14 @@ if CONFIG['MOZ_ANDROID_SEARCH_ACTIVITY']
 FINAL_TARGET_PP_FILES += ['package-name.txt.in']
 
 DEFINES['OBJDIR'] = OBJDIR
 DEFINES['TOPOBJDIR'] = TOPOBJDIR
 
 OBJDIR_PP_FILES.mobile.android.base += [
     'AndroidManifest.xml.in',
 ]
+
+gbjar.sources += ['generated/org/mozilla/gecko/' + x for x in [
+    'media/ICodec.java',
+    'media/ICodecCallbacks.java',
+    'media/ICodecManager.java',
+]]