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

Side by Side Diff: media/base/android/webaudio_media_codec_bridge.h

Issue 21618002: Fix slow playback of 1-channel MP3 and AAC files for WebAudio on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 4 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 #ifndef MEDIA_BASE_ANDROID_WEBAUDIO_MEDIA_CODEC_BRIDGE_H_ 5 #ifndef MEDIA_BASE_ANDROID_WEBAUDIO_MEDIA_CODEC_BRIDGE_H_
6 #define MEDIA_BASE_ANDROID_WEBAUDIO_MEDIA_CODEC_BRIDGE_H_ 6 #define MEDIA_BASE_ANDROID_WEBAUDIO_MEDIA_CODEC_BRIDGE_H_
7 7
8 #include <jni.h> 8 #include <jni.h>
9 9
10 #include "base/file_descriptor_posix.h" 10 #include "base/file_descriptor_posix.h"
(...skipping 23 matching lines...) Expand all
34 // Start MediaCodec to process the encoded data in 34 // Start MediaCodec to process the encoded data in
35 // |encoded_audio_handle|. The PCM samples are sent to |pcm_output|. 35 // |encoded_audio_handle|. The PCM samples are sent to |pcm_output|.
36 static void RunWebAudioMediaCodec( 36 static void RunWebAudioMediaCodec(
37 base::SharedMemoryHandle encoded_audio_handle, 37 base::SharedMemoryHandle encoded_audio_handle,
38 base::FileDescriptor pcm_output, 38 base::FileDescriptor pcm_output,
39 uint32_t data_size); 39 uint32_t data_size);
40 40
41 void OnChunkDecoded(JNIEnv* env, 41 void OnChunkDecoded(JNIEnv* env,
42 jobject /*java object*/, 42 jobject /*java object*/,
43 jobject buf, 43 jobject buf,
44 jint buf_size); 44 jint buf_size,
45 jint input_channel_count,
46 jint output_channel_count);
45 47
46 void InitializeDestination(JNIEnv* env, 48 void InitializeDestination(JNIEnv* env,
47 jobject /*java object*/, 49 jobject /*java object*/,
48 jint channel_count, 50 jint channel_count,
49 jint sample_rate, 51 jint sample_rate,
50 jlong duration_us); 52 jlong duration_us);
51 53
52 private: 54 private:
53 // Handles MediaCodec processing of the encoded data in 55 // Handles MediaCodec processing of the encoded data in
54 // |encoded_audio_handle_| and sends the pcm data to |pcm_output_|. 56 // |encoded_audio_handle_| and sends the pcm data to |pcm_output_|.
(...skipping 14 matching lines...) Expand all
69 int pcm_output_; 71 int pcm_output_;
70 72
71 // The length of the encoded data. 73 // The length of the encoded data.
72 uint32_t data_size_; 74 uint32_t data_size_;
73 75
74 DISALLOW_COPY_AND_ASSIGN(WebAudioMediaCodecBridge); 76 DISALLOW_COPY_AND_ASSIGN(WebAudioMediaCodecBridge);
75 }; 77 };
76 78
77 } // namespace media 79 } // namespace media
78 #endif // MEDIA_BASE_ANDROID_WEBAUDIO_MEDIA_CODEC_BRIDGE_H_ 80 #endif // MEDIA_BASE_ANDROID_WEBAUDIO_MEDIA_CODEC_BRIDGE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698