bug 1299068 - part 2: add parameter to IPC method for rendering output or not. r=snorp
authorJohn Lin <jolin@mozilla.com>
Wed, 23 Nov 2016 15:18:09 +0800
changeset 325368 956f17ac252244a485d2d1ba2b8acfd82d9d3ec8
parent 325367 c871270d176ed40c4c076fe3fa43de6405270a64
child 325369 cd931b83e49951ad24f105762152d636941c075c
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
reviewerssnorp
bugs1299068
milestone53.0a1
bug 1299068 - part 2: add parameter to IPC method for rendering output or not. r=snorp MozReview-Commit-ID: 7Q5hdefoXIH
mobile/android/base/aidl/org/mozilla/gecko/media/ICodec.aidl
mobile/android/base/java/org/mozilla/gecko/media/Codec.java
mobile/android/base/java/org/mozilla/gecko/media/CodecProxy.java
--- 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);
         }