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

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

Issue 1726103002: Disable adaptive resolution support for MediaCodec use by AVDA. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comment. Created 4 years, 10 months 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.AudioManager; 9 import android.media.AudioManager;
10 import android.media.AudioTrack; 10 import android.media.AudioTrack;
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 } catch (IllegalStateException e) { 403 } catch (IllegalStateException e) {
404 Log.e(TAG, "Failed to dequeue output buffer", e); 404 Log.e(TAG, "Failed to dequeue output buffer", e);
405 } 405 }
406 406
407 return new DequeueOutputResult( 407 return new DequeueOutputResult(
408 status, index, info.flags, info.offset, info.presentationTimeUs, info.size); 408 status, index, info.flags, info.offset, info.presentationTimeUs, info.size);
409 } 409 }
410 410
411 @CalledByNative 411 @CalledByNative
412 private boolean configureVideo(MediaFormat format, Surface surface, MediaCry pto crypto, 412 private boolean configureVideo(MediaFormat format, Surface surface, MediaCry pto crypto,
413 int flags) { 413 int flags, boolean allowAdaptivePlayback) {
414 try { 414 try {
415 if (mAdaptivePlaybackSupported) { 415 if (mAdaptivePlaybackSupported && allowAdaptivePlayback) {
416 format.setInteger(MediaFormat.KEY_MAX_WIDTH, MAX_ADAPTIVE_PLAYBA CK_WIDTH); 416 format.setInteger(MediaFormat.KEY_MAX_WIDTH, MAX_ADAPTIVE_PLAYBA CK_WIDTH);
417 format.setInteger(MediaFormat.KEY_MAX_HEIGHT, MAX_ADAPTIVE_PLAYB ACK_HEIGHT); 417 format.setInteger(MediaFormat.KEY_MAX_HEIGHT, MAX_ADAPTIVE_PLAYB ACK_HEIGHT);
418 } 418 }
419 mMediaCodec.configure(format, surface, crypto, flags); 419 mMediaCodec.configure(format, surface, crypto, flags);
420 return true; 420 return true;
421 } catch (IllegalArgumentException e) { 421 } catch (IllegalArgumentException e) {
422 Log.e(TAG, "Cannot configure the video codec, wrong format or surfac e", e); 422 Log.e(TAG, "Cannot configure the video codec, wrong format or surfac e", e);
423 } catch (IllegalStateException e) { 423 } catch (IllegalStateException e) {
424 Log.e(TAG, "Cannot configure the video codec", e); 424 Log.e(TAG, "Cannot configure the video codec", e);
425 } catch (MediaCodec.CryptoException e) { 425 } catch (MediaCodec.CryptoException e) {
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
608 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { 608 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
609 return AudioFormat.CHANNEL_OUT_7POINT1_SURROUND; 609 return AudioFormat.CHANNEL_OUT_7POINT1_SURROUND;
610 } else { 610 } else {
611 return AudioFormat.CHANNEL_OUT_7POINT1; 611 return AudioFormat.CHANNEL_OUT_7POINT1;
612 } 612 }
613 default: 613 default:
614 return AudioFormat.CHANNEL_OUT_DEFAULT; 614 return AudioFormat.CHANNEL_OUT_DEFAULT;
615 } 615 }
616 } 616 }
617 } 617 }
OLDNEW
« no previous file with comments | « content/common/gpu/media/android_video_decode_accelerator.cc ('k') | media/base/android/sdk_media_codec_bridge.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698