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

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

Issue 1681613002: Remove MediaCodecBridge::GetOutputBuffersCount() and GetOutputBuffersCapacity() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing comments 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 side-by-side diff with in-line comments
Download patch
Index: media/base/android/java/src/org/chromium/media/MediaCodecBridge.java
diff --git a/media/base/android/java/src/org/chromium/media/MediaCodecBridge.java b/media/base/android/java/src/org/chromium/media/MediaCodecBridge.java
index e62927b15fe023dcbace5670e9305f3c066a16a6..adc7f7747ba6cc06e6dcdac94df591864da070a7 100644
--- a/media/base/android/java/src/org/chromium/media/MediaCodecBridge.java
+++ b/media/base/android/java/src/org/chromium/media/MediaCodecBridge.java
@@ -299,23 +299,10 @@ class MediaCodecBridge {
}
@CalledByNative
- private int getOutputBuffersCount() {
- return mOutputBuffers != null ? mOutputBuffers.length : -1;
- }
-
- @CalledByNative
- private int getOutputBuffersCapacity() {
- return mOutputBuffers != null ? mOutputBuffers[0].capacity() : -1;
- }
-
- @CalledByNative
private int queueInputBuffer(
int index, int offset, int size, long presentationTimeUs, int flags) {
resetLastPresentationTimeIfNeeded(presentationTimeUs);
try {
- if (Build.VERSION.SDK_INT > Build.VERSION_CODES.KITKAT) {
- mMediaCodec.getInputBuffer(index);
- }
mMediaCodec.queueInputBuffer(index, offset, size, presentationTimeUs, flags);
} catch (Exception e) {
Log.e(TAG, "Failed to queue input buffer", e);
@@ -368,9 +355,6 @@ class MediaCodecBridge {
@CalledByNative
private void releaseOutputBuffer(int index, boolean render) {
try {
- if (Build.VERSION.SDK_INT > Build.VERSION_CODES.KITKAT) {
- mMediaCodec.getOutputBuffer(index);
- }
mMediaCodec.releaseOutputBuffer(index, render);
} catch (IllegalStateException e) {
// TODO(qinmin): May need to report the error to the caller. crbug.com/356498.
@@ -398,6 +382,7 @@ class MediaCodecBridge {
status = MEDIA_CODEC_OK;
index = indexOrStatus;
} else if (indexOrStatus == MediaCodec.INFO_OUTPUT_BUFFERS_CHANGED) {
+ assert Build.VERSION.SDK_INT <= Build.VERSION_CODES.KITKAT;
mOutputBuffers = mMediaCodec.getOutputBuffers();
status = MEDIA_CODEC_OUTPUT_BUFFERS_CHANGED;
} else if (indexOrStatus == MediaCodec.INFO_OUTPUT_FORMAT_CHANGED) {
« no previous file with comments | « content/common/gpu/media/android_video_encode_accelerator.cc ('k') | media/base/android/media_codec_bridge.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698