Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(347)

Side by Side Diff: media/base/android/java/src/org/chromium/media/MediaCodecBridge.java

Issue 2461073002: Use MediaCodec.setOutputSurface() for fullscreen transitions on M. (Closed)
Patch Set: Rework logic. Fix nits. Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.media; 5 package org.chromium.media;
6 6
7 import android.annotation.TargetApi; 7 import android.annotation.TargetApi;
8 import android.media.AudioFormat; 8 import android.media.AudioFormat;
9 import android.media.MediaCodec; 9 import android.media.MediaCodec;
10 import android.media.MediaCrypto; 10 import android.media.MediaCrypto;
(...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after
613 break; 613 break;
614 default: 614 default:
615 name = null; 615 name = null;
616 break; 616 break;
617 } 617 }
618 if (name != null) { 618 if (name != null) {
619 format.setByteBuffer(name, ByteBuffer.wrap(bytes)); 619 format.setByteBuffer(name, ByteBuffer.wrap(bytes));
620 } 620 }
621 } 621 }
622 622
623 @TargetApi(Build.VERSION_CODES.M)
624 @CalledByNative
625 private void setSurface(Surface surface) {
626 try {
627 mMediaCodec.setOutputSurface(surface);
628 } catch (IllegalArgumentException | IllegalStateException e) {
629 Log.e(TAG, "Cannot set output surface", e);
630 }
watk 2016/11/08 22:59:03 Seems like this should return an error? If we fail
DaleCurtis 2016/11/08 23:50:10 Done.
631 }
632
623 @CalledByNative 633 @CalledByNative
624 private static void setFrameHasADTSHeader(MediaFormat format) { 634 private static void setFrameHasADTSHeader(MediaFormat format) {
625 format.setInteger(MediaFormat.KEY_IS_ADTS, 1); 635 format.setInteger(MediaFormat.KEY_IS_ADTS, 1);
626 } 636 }
627 637
628 @CalledByNative 638 @CalledByNative
629 private boolean configureAudio(MediaFormat format, MediaCrypto crypto, int f lags) { 639 private boolean configureAudio(MediaFormat format, MediaCrypto crypto, int f lags) {
630 try { 640 try {
631 mMediaCodec.configure(format, null, crypto, flags); 641 mMediaCodec.configure(format, null, crypto, flags);
632 return true; 642 return true;
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
665 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { 675 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
666 return AudioFormat.CHANNEL_OUT_7POINT1_SURROUND; 676 return AudioFormat.CHANNEL_OUT_7POINT1_SURROUND;
667 } else { 677 } else {
668 return AudioFormat.CHANNEL_OUT_7POINT1; 678 return AudioFormat.CHANNEL_OUT_7POINT1;
669 } 679 }
670 default: 680 default:
671 return AudioFormat.CHANNEL_OUT_DEFAULT; 681 return AudioFormat.CHANNEL_OUT_DEFAULT;
672 } 682 }
673 } 683 }
674 } 684 }
OLDNEW
« no previous file with comments | « no previous file | media/base/android/sdk_media_codec_bridge.h » ('j') | media/blink/webmediaplayer_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698