bug 1299068 - part 2: add parameter to IPC method for rendering output or not.
MozReview-Commit-ID: 7Q5hdefoXIH
--- a/mobile/android/base/aidl/org/mozilla/gecko/media/ICodec.aidl
+++ b/mobile/android/base/aidl/org/mozilla/gecko/media/ICodec.aidl
@@ -18,10 +18,10 @@ interface ICodec {
oneway void start();
oneway void stop();
oneway void flush();
oneway void release();
Sample dequeueInput(int size);
oneway void queueInput(in Sample sample);
- oneway void releaseOutput(in Sample sample);
+ oneway void releaseOutput(in Sample sample, in boolean render);
}
--- a/mobile/android/base/java/org/mozilla/gecko/media/Codec.java
+++ b/mobile/android/base/java/org/mozilla/gecko/media/Codec.java
@@ -201,24 +201,24 @@ import java.util.concurrent.ConcurrentLi
if (DEBUG) Log.d(LOGTAG, "return dummy sample");
mCallbacks.onOutput(Sample.create(null, info, null));
} catch (RemoteException e) {
// Dead recipient.
e.printStackTrace();
}
}
- private synchronized void onRelease(Sample sample) {
+ private synchronized void onRelease(Sample sample, boolean render) {
Integer i = mSentIndices.poll();
Sample output = mSentOutputs.poll();
if (i == null || output == null) {
Log.d(LOGTAG, "output buffer#" + i + "(" + output + ")" + ": " + sample + " already released");
return;
}
- mCodec.releaseOutputBuffer(i, true);
+ mCodec.releaseOutputBuffer(i, render);
mSamplePool.recycleOutput(output);
sample.dispose();
}
private void onFormatChanged(MediaFormat format) {
try {
mCallbacks.onOutputFormatChanged(new FormatParam(format));
@@ -421,18 +421,18 @@ import java.util.concurrent.ConcurrentLi
}
@Override
public synchronized void queueInput(Sample sample) throws RemoteException {
mInputProcessor.onSample(sample);
}
@Override
- public synchronized void releaseOutput(Sample sample) {
- mOutputProcessor.onRelease(sample);
+ public synchronized void releaseOutput(Sample sample, boolean render) {
+ mOutputProcessor.onRelease(sample, render);
}
@Override
public synchronized void release() throws RemoteException {
if (DEBUG) Log.d(LOGTAG, "release " + this);
releaseCodec();
mSamplePool.reset();
mSamplePool = null;
--- a/mobile/android/base/java/org/mozilla/gecko/media/CodecProxy.java
+++ b/mobile/android/base/java/org/mozilla/gecko/media/CodecProxy.java
@@ -63,17 +63,17 @@ public final class CodecProxy {
@Override
public void onOutputFormatChanged(FormatParam format) throws RemoteException {
mCallbacks.onOutputFormatChanged(format.asFormat());
}
@Override
public void onOutput(Sample sample) throws RemoteException {
mCallbacks.onOutput(sample);
- mRemote.releaseOutput(sample);
+ mRemote.releaseOutput(sample, true);
sample.dispose();
}
@Override
public void onError(boolean fatal) throws RemoteException {
reportError(fatal);
}