| OLD | NEW |
| 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 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 449 // to notify the native code the the frame has a wrong presentat
ion | 449 // to notify the native code the the frame has a wrong presentat
ion |
| 450 // timestamp and should be skipped. | 450 // timestamp and should be skipped. |
| 451 info.presentationTimeUs = mLastPresentationTimeUs; | 451 info.presentationTimeUs = mLastPresentationTimeUs; |
| 452 } | 452 } |
| 453 mLastPresentationTimeUs = info.presentationTimeUs; | 453 mLastPresentationTimeUs = info.presentationTimeUs; |
| 454 | 454 |
| 455 if (indexOrStatus >= 0) { // index! | 455 if (indexOrStatus >= 0) { // index! |
| 456 status = MEDIA_CODEC_OK; | 456 status = MEDIA_CODEC_OK; |
| 457 index = indexOrStatus; | 457 index = indexOrStatus; |
| 458 } else if (indexOrStatus == MediaCodec.INFO_OUTPUT_BUFFERS_CHANGED)
{ | 458 } else if (indexOrStatus == MediaCodec.INFO_OUTPUT_BUFFERS_CHANGED)
{ |
| 459 assert Build.VERSION.SDK_INT <= Build.VERSION_CODES.KITKAT; | 459 // TODO(crbug.com/665478) |
| 460 // assert Build.VERSION.SDK_INT <= Build.VERSION_CODES.KITKAT; |
| 460 mOutputBuffers = mMediaCodec.getOutputBuffers(); | 461 mOutputBuffers = mMediaCodec.getOutputBuffers(); |
| 461 status = MEDIA_CODEC_OUTPUT_BUFFERS_CHANGED; | 462 status = MEDIA_CODEC_OUTPUT_BUFFERS_CHANGED; |
| 462 } else if (indexOrStatus == MediaCodec.INFO_OUTPUT_FORMAT_CHANGED) { | 463 } else if (indexOrStatus == MediaCodec.INFO_OUTPUT_FORMAT_CHANGED) { |
| 463 status = MEDIA_CODEC_OUTPUT_FORMAT_CHANGED; | 464 status = MEDIA_CODEC_OUTPUT_FORMAT_CHANGED; |
| 464 MediaFormat newFormat = mMediaCodec.getOutputFormat(); | 465 MediaFormat newFormat = mMediaCodec.getOutputFormat(); |
| 465 } else if (indexOrStatus == MediaCodec.INFO_TRY_AGAIN_LATER) { | 466 } else if (indexOrStatus == MediaCodec.INFO_TRY_AGAIN_LATER) { |
| 466 status = MEDIA_CODEC_DEQUEUE_OUTPUT_AGAIN_LATER; | 467 status = MEDIA_CODEC_DEQUEUE_OUTPUT_AGAIN_LATER; |
| 467 } else { | 468 } else { |
| 468 Log.e(TAG, "Unexpected index_or_status: " + indexOrStatus); | 469 Log.e(TAG, "Unexpected index_or_status: " + indexOrStatus); |
| 469 assert false; | 470 assert false; |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 677 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { | 678 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { |
| 678 return AudioFormat.CHANNEL_OUT_7POINT1_SURROUND; | 679 return AudioFormat.CHANNEL_OUT_7POINT1_SURROUND; |
| 679 } else { | 680 } else { |
| 680 return AudioFormat.CHANNEL_OUT_7POINT1; | 681 return AudioFormat.CHANNEL_OUT_7POINT1; |
| 681 } | 682 } |
| 682 default: | 683 default: |
| 683 return AudioFormat.CHANNEL_OUT_DEFAULT; | 684 return AudioFormat.CHANNEL_OUT_DEFAULT; |
| 684 } | 685 } |
| 685 } | 686 } |
| 686 } | 687 } |
| OLD | NEW |