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

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: Moved UpdateOutput() back to original location 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 void MediaCodecBridge::GetOutputSamplingRate(int* sampling_rate) {
291 JNIEnv* env = AttachCurrentThread();
292
293 *sampling_rate =
294 Java_MediaCodecBridge_getOutputSamplingRate(env, j_media_codec_.obj());
295 }
296
290 MediaCodecStatus MediaCodecBridge::QueueInputBuffer( 297 MediaCodecStatus MediaCodecBridge::QueueInputBuffer(
291 int index, 298 int index,
292 const uint8* data, 299 const uint8* data,
293 size_t data_size, 300 size_t data_size,
294 const base::TimeDelta& presentation_time) { 301 const base::TimeDelta& presentation_time) {
295 DVLOG(3) << __PRETTY_FUNCTION__ << index << ": " << data_size; 302 DVLOG(3) << __PRETTY_FUNCTION__ << index << ": " << data_size;
296 if (data_size > base::checked_cast<size_t>(kint32max)) 303 if (data_size > base::checked_cast<size_t>(kint32max))
297 return MEDIA_CODEC_ERROR; 304 return MEDIA_CODEC_ERROR;
298 if (data && !FillInputBuffer(index, data, data_size)) 305 if (data && !FillInputBuffer(index, data, data_size))
299 return MEDIA_CODEC_ERROR; 306 return MEDIA_CODEC_ERROR;
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after
789 return true; 796 return true;
790 JNIEnv* env = AttachCurrentThread(); 797 JNIEnv* env = AttachCurrentThread();
791 return Java_MediaCodecBridge_isAdaptivePlaybackSupported( 798 return Java_MediaCodecBridge_isAdaptivePlaybackSupported(
792 env, media_codec(), width, height); 799 env, media_codec(), width, height);
793 } 800 }
794 801
795 bool MediaCodecBridge::RegisterMediaCodecBridge(JNIEnv* env) { 802 bool MediaCodecBridge::RegisterMediaCodecBridge(JNIEnv* env) {
796 return RegisterNativesImpl(env); 803 return RegisterNativesImpl(env);
797 } 804 }
798 805
806 bool MediaCodecBridge::ReconfigureAudioTrack() {
807 JNIEnv* env = AttachCurrentThread();
808 return Java_MediaCodecBridge_reconfigureAudioTrack(env, media_codec());
809 }
810
799 } // namespace media 811 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698