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

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

Issue 1287423004: MediaCodecPlayer implementation (stage 5 - reconfiguration) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mtplayer-cleanuptest
Patch Set: Deleted better 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_AUDIO_DECODER_H_ 5 #ifndef MEDIA_BASE_ANDROID_MEDIA_CODEC_AUDIO_DECODER_H_
6 #define MEDIA_BASE_ANDROID_MEDIA_CODEC_AUDIO_DECODER_H_ 6 #define MEDIA_BASE_ANDROID_MEDIA_CODEC_AUDIO_DECODER_H_
7 7
8 #include <vector> 8 #include <vector>
9 #include "media/base/android/media_codec_decoder.h" 9 #include "media/base/android/media_codec_decoder.h"
10 10
11 namespace media { 11 namespace media {
12 12
13 class AudioTimestampHelper; 13 class AudioTimestampHelper;
14 14
15 // Audio decoder for MediaCodecPlayer 15 // Audio decoder for MediaCodecPlayer
16 class MediaCodecAudioDecoder : public MediaCodecDecoder { 16 class MediaCodecAudioDecoder : public MediaCodecDecoder {
17 public: 17 public:
18 // For parameters see media_codec_decoder.h 18 // For parameters see media_codec_decoder.h
19 // update_current_time_cb: callback that reports current playback time. 19 // update_current_time_cb: callback that reports current playback time.
20 // Called for each rendered frame. 20 // Called for each rendered frame.
21 MediaCodecAudioDecoder( 21 MediaCodecAudioDecoder(
22 const scoped_refptr<base::SingleThreadTaskRunner>& media_runner, 22 const scoped_refptr<base::SingleThreadTaskRunner>& media_runner,
23 const base::Closure& request_data_cb, 23 const base::Closure& request_data_cb,
24 const base::Closure& starvation_cb, 24 const base::Closure& starvation_cb,
25 const base::Closure& decoder_drained_cb,
25 const base::Closure& stop_done_cb, 26 const base::Closure& stop_done_cb,
26 const base::Closure& error_cb, 27 const base::Closure& error_cb,
27 const SetTimeCallback& update_current_time_cb); 28 const SetTimeCallback& update_current_time_cb);
28 ~MediaCodecAudioDecoder() override; 29 ~MediaCodecAudioDecoder() override;
29 30
30 const char* class_name() const override; 31 const char* class_name() const override;
31 32
32 bool HasStream() const override; 33 bool HasStream() const override;
33 void SetDemuxerConfigs(const DemuxerConfigs& configs) override; 34 void SetDemuxerConfigs(const DemuxerConfigs& configs) override;
34 void Flush() override; 35 void Flush() override;
35 void ReleaseMediaCodec() override; 36 void ReleaseMediaCodec() override;
36 37
37 // Sets the volume of the audio output. 38 // Sets the volume of the audio output.
38 void SetVolume(double volume); 39 void SetVolume(double volume);
39 40
40 // Sets the base timestamp for |audio_timestamp_helper_|. 41 // Sets the base timestamp for |audio_timestamp_helper_|.
41 void SetBaseTimestamp(base::TimeDelta base_timestamp); 42 void SetBaseTimestamp(base::TimeDelta base_timestamp);
42 43
43 protected: 44 protected:
44 bool IsCodecReconfigureNeeded(const DemuxerConfigs& curr, 45 bool IsCodecReconfigureNeeded(const DemuxerConfigs& next) const override;
45 const DemuxerConfigs& next) const override;
46 ConfigStatus ConfigureInternal() override; 46 ConfigStatus ConfigureInternal() override;
47 void OnOutputFormatChanged() override; 47 void OnOutputFormatChanged() override;
48 void Render(int buffer_index, 48 void Render(int buffer_index,
49 size_t size, 49 size_t size,
50 RenderMode render_mode, 50 RenderMode render_mode,
51 base::TimeDelta pts, 51 base::TimeDelta pts,
52 bool eos_encountered) override; 52 bool eos_encountered) override;
53 53
54 private: 54 private:
55 // A helper method to set the volume. 55 // A helper method to set the volume.
(...skipping 28 matching lines...) Expand all
84 84
85 // Reports current playback time to the callee. 85 // Reports current playback time to the callee.
86 SetTimeCallback update_current_time_cb_; 86 SetTimeCallback update_current_time_cb_;
87 87
88 DISALLOW_COPY_AND_ASSIGN(MediaCodecAudioDecoder); 88 DISALLOW_COPY_AND_ASSIGN(MediaCodecAudioDecoder);
89 }; 89 };
90 90
91 } // namespace media 91 } // namespace media
92 92
93 #endif // MEDIA_BASE_ANDROID_MEDIA_CODEC_DECODER_H_ 93 #endif // MEDIA_BASE_ANDROID_MEDIA_CODEC_DECODER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698