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

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

Issue 1254293003: MediaCodecPlayer implementation (stage 4 - preroll) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mtplayer-browserseek
Patch Set: Save the first post-preroll audio buffer and replay it when preroll is done Created 5 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_MEDIA_CODEC_BRIDGE_H_ 5 #ifndef MEDIA_BASE_ANDROID_MEDIA_CODEC_BRIDGE_H_
6 #define MEDIA_BASE_ANDROID_MEDIA_CODEC_BRIDGE_H_ 6 #define MEDIA_BASE_ANDROID_MEDIA_CODEC_BRIDGE_H_
7 7
8 #include <jni.h> 8 #include <jni.h>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 bool Start(const AudioCodec& codec, int sample_rate, int channel_count, 231 bool Start(const AudioCodec& codec, int sample_rate, int channel_count,
232 const uint8* extra_data, size_t extra_data_size, 232 const uint8* extra_data, size_t extra_data_size,
233 int64 codec_delay_ns, int64 seek_preroll_ns, 233 int64 codec_delay_ns, int64 seek_preroll_ns,
234 bool play_audio, jobject media_crypto) WARN_UNUSED_RESULT; 234 bool play_audio, jobject media_crypto) WARN_UNUSED_RESULT;
235 235
236 // Play the output buffer. This call must be called after 236 // Play the output buffer. This call must be called after
237 // DequeueOutputBuffer() and before ReleaseOutputBuffer. Returns the playback 237 // DequeueOutputBuffer() and before ReleaseOutputBuffer. Returns the playback
238 // head position expressed in frames. 238 // head position expressed in frames.
239 int64 PlayOutputBuffer(int index, size_t size); 239 int64 PlayOutputBuffer(int index, size_t size);
240 240
241 // Same but with explicit memory block.
242 int64 PlayOutputBuffer(uint8* buffer, size_t size);
243
241 // Set the volume of the audio output. 244 // Set the volume of the audio output.
242 void SetVolume(double volume); 245 void SetVolume(double volume);
243 246
244 private: 247 private:
245 explicit AudioCodecBridge(const std::string& mime); 248 explicit AudioCodecBridge(const std::string& mime);
246 249
247 // Configure the java MediaFormat object with the extra codec data passed in. 250 // Configure the java MediaFormat object with the extra codec data passed in.
248 bool ConfigureMediaFormat(jobject j_format, const AudioCodec& codec, 251 bool ConfigureMediaFormat(jobject j_format, const AudioCodec& codec,
249 const uint8* extra_data, size_t extra_data_size, 252 const uint8* extra_data, size_t extra_data_size,
250 int64 codec_delay_ns, int64 seek_preroll_ns); 253 int64 codec_delay_ns, int64 seek_preroll_ns);
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 VideoCodecBridge(const std::string& mime, 297 VideoCodecBridge(const std::string& mime,
295 bool is_secure, 298 bool is_secure,
296 MediaCodecDirection direction); 299 MediaCodecDirection direction);
297 300
298 int adaptive_playback_supported_for_testing_; 301 int adaptive_playback_supported_for_testing_;
299 }; 302 };
300 303
301 } // namespace media 304 } // namespace media
302 305
303 #endif // MEDIA_BASE_ANDROID_MEDIA_CODEC_BRIDGE_H_ 306 #endif // MEDIA_BASE_ANDROID_MEDIA_CODEC_BRIDGE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698