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

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

Issue 238053004: Revert of Fix an issue that audio and video may run out of sync (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | media/base/android/audio_decoder_job.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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_AUDIO_DECODER_JOB_H_ 5 #ifndef MEDIA_BASE_ANDROID_AUDIO_DECODER_JOB_H_
6 #define MEDIA_BASE_ANDROID_AUDIO_DECODER_JOB_H_ 6 #define MEDIA_BASE_ANDROID_AUDIO_DECODER_JOB_H_
7 7
8 #include <jni.h> 8 #include <jni.h>
9 9
10 #include "media/base/android/media_decoder_job.h" 10 #include "media/base/android/media_decoder_job.h"
11 11
12 namespace media { 12 namespace media {
13 13
14 class AudioCodecBridge; 14 class AudioCodecBridge;
15 class AudioTimestampHelper;
16 15
17 // Class for managing audio decoding jobs. 16 // Class for managing audio decoding jobs.
18 class AudioDecoderJob : public MediaDecoderJob { 17 class AudioDecoderJob : public MediaDecoderJob {
19 public: 18 public:
20 virtual ~AudioDecoderJob(); 19 virtual ~AudioDecoderJob();
21 20
22 // Creates a new AudioDecoderJob instance for decoding audio. 21 // Creates a new AudioDecoderJob instance for decoding audio.
23 // |audio_codec| - The audio format the object needs to decode. 22 // |audio_codec| - The audio format the object needs to decode.
24 // |sample_rate| - The sample rate of the decoded output. 23 // |sample_rate| - The sample rate of the decoded output.
25 // |channel_count| - The number of channels in the decoded output. 24 // |channel_count| - The number of channels in the decoded output.
26 // |extra_data|, |extra_data_size| - Extra data buffer needed for initializing 25 // |extra_data|, |extra_data_size| - Extra data buffer needed for initializing
27 // the decoder. 26 // the decoder.
28 // |media_crypto| - Handle to a Java object that handles the encryption for 27 // |media_crypto| - Handle to a Java object that handles the encryption for
29 // the audio data. 28 // the audio data.
30 // |request_data_cb| - Callback used to request more data for the decoder. 29 // |request_data_cb| - Callback used to request more data for the decoder.
31 static AudioDecoderJob* Create( 30 static AudioDecoderJob* Create(
32 const AudioCodec audio_codec, int sample_rate, int channel_count, 31 const AudioCodec audio_codec, int sample_rate, int channel_count,
33 const uint8* extra_data, size_t extra_data_size, jobject media_crypto, 32 const uint8* extra_data, size_t extra_data_size, jobject media_crypto,
34 const base::Closure& request_data_cb); 33 const base::Closure& request_data_cb);
35 34
36 void SetVolume(double volume); 35 void SetVolume(double volume);
37 36
38 // Sets the base timestamp for |audio_timestamp_helper_|.
39 void SetBaseTimestamp(base::TimeDelta base_timestamp);
40
41 private: 37 private:
42 AudioDecoderJob(scoped_ptr<AudioTimestampHelper> audio_timestamp_helper, 38 AudioDecoderJob(scoped_ptr<AudioCodecBridge> audio_decoder_bridge,
43 scoped_ptr<AudioCodecBridge> audio_decoder_bridge,
44 int bytes_per_frame,
45 const base::Closure& request_data_cb); 39 const base::Closure& request_data_cb);
46 40
47 // MediaDecoderJob implementation. 41 // MediaDecoderJob implementation.
48 virtual void ReleaseOutputBuffer( 42 virtual void ReleaseOutputBuffer(
49 int output_buffer_index, 43 int output_buffer_index,
50 size_t size, 44 size_t size,
51 bool render_output, 45 bool render_output,
52 base::TimeDelta current_presentation_timestamp,
53 const ReleaseOutputCompletionCallback& callback) OVERRIDE; 46 const ReleaseOutputCompletionCallback& callback) OVERRIDE;
54 47
55 virtual bool ComputeTimeToRender() const OVERRIDE; 48 virtual bool ComputeTimeToRender() const OVERRIDE;
56 49
57 // number of bytes per audio frame;
58 int bytes_per_frame_;
59
60 scoped_ptr<AudioCodecBridge> audio_codec_bridge_; 50 scoped_ptr<AudioCodecBridge> audio_codec_bridge_;
61
62 // Object to calculate the current audio timestamp for A/V sync.
63 scoped_ptr<AudioTimestampHelper> audio_timestamp_helper_;
64 }; 51 };
65 52
66 } // namespace media 53 } // namespace media
67 54
68 #endif // MEDIA_BASE_ANDROID_AUDIO_DECODER_JOB_H_ 55 #endif // MEDIA_BASE_ANDROID_AUDIO_DECODER_JOB_H_
OLDNEW
« no previous file with comments | « no previous file | media/base/android/audio_decoder_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698