Skip to content

Commit

Permalink
Bug 1257777 - Part 1: AIDL interfaces for remote codec and manager se…
Browse files Browse the repository at this point in the history
…rvice binders. r=nalexander

MozReview-Commit-ID: DAaJyWcyC0c

--HG--
extra : rebase_source : 95b82faa20a98801f6aaba424b263e8515f425fc
  • Loading branch information
jhlin committed Aug 5, 2016
1 parent 631a8b1 commit 5c07851
Show file tree
Hide file tree
Showing 8 changed files with 87 additions and 2 deletions.
8 changes: 6 additions & 2 deletions mobile/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ android {

defaultConfig {
targetSdkVersion 23
minSdkVersion 15
minSdkVersion 15
applicationId mozconfig.substs.ANDROID_PACKAGE_NAME
testApplicationId 'org.mozilla.roboexample.test'
testInstrumentationRunner 'org.mozilla.gecko.FennecInstrumentationTestRunner'
Expand All @@ -27,7 +27,7 @@ android {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}

dexOptions {
javaMaxHeapSize "2g"
}
Expand Down Expand Up @@ -84,6 +84,10 @@ android {
main {
manifest.srcFile "${project.buildDir}/generated/source/preprocessed_manifest/AndroidManifest.xml"

aidl {
srcDir "${topsrcdir}/mobile/android/base/aidl"
}

java {
srcDir "${topsrcdir}/mobile/android/geckoview/src/main/java"
srcDir "${topsrcdir}/mobile/android/base/java"
Expand Down
9 changes: 9 additions & 0 deletions mobile/android/base/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -543,3 +543,12 @@ 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) $<
Original file line number Diff line number Diff line change
@@ -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;
23 changes: 23 additions & 0 deletions mobile/android/base/aidl/org/mozilla/gecko/media/ICodec.aidl
Original file line number Diff line number Diff line change
@@ -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);
}
Original file line number Diff line number Diff line change
@@ -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);
}
Original file line number Diff line number Diff line change
@@ -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();
}
7 changes: 7 additions & 0 deletions mobile/android/base/aidl/org/mozilla/gecko/media/Sample.aidl
Original file line number Diff line number Diff line change
@@ -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;
6 changes: 6 additions & 0 deletions mobile/android/base/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -1034,3 +1034,9 @@ 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',
]]

0 comments on commit 5c07851

Please sign in to comment.