| OLD | NEW |
| 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 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 public: | 21 public: |
| 22 // Creates a new AudioDecoderJob instance for decoding audio. | 22 // Creates a new AudioDecoderJob instance for decoding audio. |
| 23 // |request_data_cb| - Callback used to request more data for the decoder. | 23 // |request_data_cb| - Callback used to request more data for the decoder. |
| 24 // |on_demuxer_config_changed_cb| - Callback used to inform the caller that | 24 // |on_demuxer_config_changed_cb| - Callback used to inform the caller that |
| 25 // demuxer config has changed. | 25 // demuxer config has changed. |
| 26 AudioDecoderJob(const base::Closure& request_data_cb, | 26 AudioDecoderJob(const base::Closure& request_data_cb, |
| 27 const base::Closure& on_demuxer_config_changed_cb); | 27 const base::Closure& on_demuxer_config_changed_cb); |
| 28 virtual ~AudioDecoderJob(); | 28 virtual ~AudioDecoderJob(); |
| 29 | 29 |
| 30 // MediaDecoderJob implementation. | 30 // MediaDecoderJob implementation. |
| 31 virtual bool HasStream() const OVERRIDE; | 31 virtual bool HasStream() const override; |
| 32 | 32 |
| 33 // Sets the volume of the audio output. | 33 // Sets the volume of the audio output. |
| 34 void SetVolume(double volume); | 34 void SetVolume(double volume); |
| 35 | 35 |
| 36 // Sets the base timestamp for |audio_timestamp_helper_|. | 36 // Sets the base timestamp for |audio_timestamp_helper_|. |
| 37 void SetBaseTimestamp(base::TimeDelta base_timestamp); | 37 void SetBaseTimestamp(base::TimeDelta base_timestamp); |
| 38 | 38 |
| 39 private: | 39 private: |
| 40 // MediaDecoderJob implementation. | 40 // MediaDecoderJob implementation. |
| 41 virtual void ReleaseOutputBuffer( | 41 virtual void ReleaseOutputBuffer( |
| 42 int output_buffer_index, | 42 int output_buffer_index, |
| 43 size_t size, | 43 size_t size, |
| 44 bool render_output, | 44 bool render_output, |
| 45 base::TimeDelta current_presentation_timestamp, | 45 base::TimeDelta current_presentation_timestamp, |
| 46 const ReleaseOutputCompletionCallback& callback) OVERRIDE; | 46 const ReleaseOutputCompletionCallback& callback) override; |
| 47 virtual bool ComputeTimeToRender() const OVERRIDE; | 47 virtual bool ComputeTimeToRender() const override; |
| 48 virtual bool AreDemuxerConfigsChanged( | 48 virtual bool AreDemuxerConfigsChanged( |
| 49 const DemuxerConfigs& configs) const OVERRIDE; | 49 const DemuxerConfigs& configs) const override; |
| 50 virtual void UpdateDemuxerConfigs(const DemuxerConfigs& configs) OVERRIDE; | 50 virtual void UpdateDemuxerConfigs(const DemuxerConfigs& configs) override; |
| 51 virtual bool CreateMediaCodecBridgeInternal() OVERRIDE; | 51 virtual bool CreateMediaCodecBridgeInternal() override; |
| 52 | 52 |
| 53 // Helper method to set the audio output volume. | 53 // Helper method to set the audio output volume. |
| 54 void SetVolumeInternal(); | 54 void SetVolumeInternal(); |
| 55 | 55 |
| 56 // Audio configs from the demuxer. | 56 // Audio configs from the demuxer. |
| 57 AudioCodec audio_codec_; | 57 AudioCodec audio_codec_; |
| 58 int num_channels_; | 58 int num_channels_; |
| 59 int sampling_rate_; | 59 int sampling_rate_; |
| 60 std::vector<uint8> audio_extra_data_; | 60 std::vector<uint8> audio_extra_data_; |
| 61 double volume_; | 61 double volume_; |
| 62 int bytes_per_frame_; | 62 int bytes_per_frame_; |
| 63 | 63 |
| 64 // Base timestamp for the |audio_timestamp_helper_|. | 64 // Base timestamp for the |audio_timestamp_helper_|. |
| 65 base::TimeDelta base_timestamp_; | 65 base::TimeDelta base_timestamp_; |
| 66 | 66 |
| 67 // Object to calculate the current audio timestamp for A/V sync. | 67 // Object to calculate the current audio timestamp for A/V sync. |
| 68 scoped_ptr<AudioTimestampHelper> audio_timestamp_helper_; | 68 scoped_ptr<AudioTimestampHelper> audio_timestamp_helper_; |
| 69 | 69 |
| 70 DISALLOW_COPY_AND_ASSIGN(AudioDecoderJob); | 70 DISALLOW_COPY_AND_ASSIGN(AudioDecoderJob); |
| 71 }; | 71 }; |
| 72 | 72 |
| 73 } // namespace media | 73 } // namespace media |
| 74 | 74 |
| 75 #endif // MEDIA_BASE_ANDROID_AUDIO_DECODER_JOB_H_ | 75 #endif // MEDIA_BASE_ANDROID_AUDIO_DECODER_JOB_H_ |
| OLD | NEW |