Bug 1257777 - Part 1: AIDL interfaces for remote codec and manager service binders. r?nalexander
MozReview-Commit-ID: DAaJyWcyC0c
--- 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',
+]]