| 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_CAST_AUDIO_SENDER_AUDIO_ENCODER_H_ | 5 #ifndef MEDIA_CAST_AUDIO_SENDER_AUDIO_ENCODER_H_ |
| 6 #define MEDIA_CAST_AUDIO_SENDER_AUDIO_ENCODER_H_ | 6 #define MEDIA_CAST_AUDIO_SENDER_AUDIO_ENCODER_H_ |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/threading/thread_checker.h" | 10 #include "base/threading/thread_checker.h" |
| 11 #include "media/cast/cast_config.h" | 11 #include "media/cast/cast_config.h" |
| 12 #include "media/cast/cast_environment.h" | 12 #include "media/cast/cast_environment.h" |
| 13 | 13 |
| 14 namespace base { | 14 namespace base { |
| 15 class TimeTicks; | 15 class TimeTicks; |
| 16 } | 16 } |
| 17 | 17 |
| 18 namespace media { | 18 namespace media { |
| 19 class AudioBus; | 19 class AudioBus; |
| 20 } | 20 } |
| 21 | 21 |
| 22 namespace media { | 22 namespace media { |
| 23 namespace cast { | 23 namespace cast { |
| 24 | 24 |
| 25 class AudioEncoder : public base::RefCountedThreadSafe<AudioEncoder> { | 25 class AudioEncoder : public base::RefCountedThreadSafe<AudioEncoder> { |
| 26 public: | 26 public: |
| 27 typedef base::Callback<void(scoped_ptr<transport::EncodedAudioFrame>, | 27 typedef base::Callback<void(scoped_ptr<EncodedAudioFrame>, |
| 28 const base::TimeTicks&)> FrameEncodedCallback; | 28 const base::TimeTicks&)> FrameEncodedCallback; |
| 29 | 29 |
| 30 AudioEncoder(const scoped_refptr<CastEnvironment>& cast_environment, | 30 AudioEncoder(const scoped_refptr<CastEnvironment>& cast_environment, |
| 31 const AudioSenderConfig& audio_config, | 31 const AudioSenderConfig& audio_config, |
| 32 const FrameEncodedCallback& frame_encoded_callback); | 32 const FrameEncodedCallback& frame_encoded_callback); |
| 33 | 33 |
| 34 // The |audio_bus| must be valid until the |done_callback| is called. | 34 // The |audio_bus| must be valid until the |done_callback| is called. |
| 35 // The callback is called from the main cast thread as soon as the encoder is | 35 // The callback is called from the main cast thread as soon as the encoder is |
| 36 // done with |audio_bus|; it does not mean that the encoded data has been | 36 // done with |audio_bus|; it does not mean that the encoded data has been |
| 37 // sent out. | 37 // sent out. |
| (...skipping 23 matching lines...) Expand all Loading... |
| 61 // Used to ensure only one thread invokes InsertAudio(). | 61 // Used to ensure only one thread invokes InsertAudio(). |
| 62 base::ThreadChecker insert_thread_checker_; | 62 base::ThreadChecker insert_thread_checker_; |
| 63 | 63 |
| 64 DISALLOW_COPY_AND_ASSIGN(AudioEncoder); | 64 DISALLOW_COPY_AND_ASSIGN(AudioEncoder); |
| 65 }; | 65 }; |
| 66 | 66 |
| 67 } // namespace cast | 67 } // namespace cast |
| 68 } // namespace media | 68 } // namespace media |
| 69 | 69 |
| 70 #endif // MEDIA_CAST_AUDIO_SENDER_AUDIO_ENCODER_H_ | 70 #endif // MEDIA_CAST_AUDIO_SENDER_AUDIO_ENCODER_H_ |
| OLD | NEW |