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

Side by Side Diff: media/base/android/media_codec_bridge.cc

Issue 805273007: Android: Propagate sample rate change to audio decoder job (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove reconfigureAudioTrack Created 5 years, 11 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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 #include "media/base/android/media_codec_bridge.h" 5 #include "media/base/android/media_codec_bridge.h"
6 6
7 #include <jni.h> 7 #include <jni.h>
8 #include <string> 8 #include <string>
9 9
10 #include "base/android/build_info.h" 10 #include "base/android/build_info.h"
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 Java_MediaCodecBridge_stop(env, j_media_codec_.obj()); 280 Java_MediaCodecBridge_stop(env, j_media_codec_.obj());
281 } 281 }
282 282
283 void MediaCodecBridge::GetOutputFormat(int* width, int* height) { 283 void MediaCodecBridge::GetOutputFormat(int* width, int* height) {
284 JNIEnv* env = AttachCurrentThread(); 284 JNIEnv* env = AttachCurrentThread();
285 285
286 *width = Java_MediaCodecBridge_getOutputWidth(env, j_media_codec_.obj()); 286 *width = Java_MediaCodecBridge_getOutputWidth(env, j_media_codec_.obj());
287 *height = Java_MediaCodecBridge_getOutputHeight(env, j_media_codec_.obj()); 287 *height = Java_MediaCodecBridge_getOutputHeight(env, j_media_codec_.obj());
288 } 288 }
289 289
290 int MediaCodecBridge::GetOutputSamplingRate() {
291 JNIEnv* env = AttachCurrentThread();
292
293 return Java_MediaCodecBridge_getOutputSamplingRate(env, j_media_codec_.obj());
294 }
295
290 MediaCodecStatus MediaCodecBridge::QueueInputBuffer( 296 MediaCodecStatus MediaCodecBridge::QueueInputBuffer(
291 int index, 297 int index,
292 const uint8* data, 298 const uint8* data,
293 size_t data_size, 299 size_t data_size,
294 const base::TimeDelta& presentation_time) { 300 const base::TimeDelta& presentation_time) {
295 DVLOG(3) << __PRETTY_FUNCTION__ << index << ": " << data_size; 301 DVLOG(3) << __PRETTY_FUNCTION__ << index << ": " << data_size;
296 if (data_size > base::checked_cast<size_t>(kint32max)) 302 if (data_size > base::checked_cast<size_t>(kint32max))
297 return MEDIA_CODEC_ERROR; 303 return MEDIA_CODEC_ERROR;
298 if (data && !FillInputBuffer(index, data, data_size)) 304 if (data && !FillInputBuffer(index, data, data_size))
299 return MEDIA_CODEC_ERROR; 305 return MEDIA_CODEC_ERROR;
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after
790 JNIEnv* env = AttachCurrentThread(); 796 JNIEnv* env = AttachCurrentThread();
791 return Java_MediaCodecBridge_isAdaptivePlaybackSupported( 797 return Java_MediaCodecBridge_isAdaptivePlaybackSupported(
792 env, media_codec(), width, height); 798 env, media_codec(), width, height);
793 } 799 }
794 800
795 bool MediaCodecBridge::RegisterMediaCodecBridge(JNIEnv* env) { 801 bool MediaCodecBridge::RegisterMediaCodecBridge(JNIEnv* env) {
796 return RegisterNativesImpl(env); 802 return RegisterNativesImpl(env);
797 } 803 }
798 804
799 } // namespace media 805 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698