OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_SENDER_AUDIO_SENDER_H_ | 5 #ifndef MEDIA_CAST_SENDER_AUDIO_SENDER_H_ |
6 #define MEDIA_CAST_SENDER_AUDIO_SENDER_H_ | 6 #define MEDIA_CAST_SENDER_AUDIO_SENDER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 // This class owns all objects related to sending audio, objects that create RTP | 28 // This class owns all objects related to sending audio, objects that create RTP |
29 // packets, congestion control, audio encoder, parsing and sending of | 29 // packets, congestion control, audio encoder, parsing and sending of |
30 // RTCP packets. | 30 // RTCP packets. |
31 // Additionally it posts a bunch of delayed tasks to the main thread for various | 31 // Additionally it posts a bunch of delayed tasks to the main thread for various |
32 // timeouts. | 32 // timeouts. |
33 class AudioSender : public FrameSender, | 33 class AudioSender : public FrameSender, |
34 public base::NonThreadSafe, | 34 public base::NonThreadSafe, |
35 public base::SupportsWeakPtr<AudioSender> { | 35 public base::SupportsWeakPtr<AudioSender> { |
36 public: | 36 public: |
37 AudioSender(scoped_refptr<CastEnvironment> cast_environment, | 37 AudioSender(scoped_refptr<CastEnvironment> cast_environment, |
38 const AudioSenderConfig& audio_config, | 38 const FrameSenderConfig& audio_config, |
39 const StatusChangeCallback& status_change_cb, | 39 const StatusChangeCallback& status_change_cb, |
40 CastTransport* const transport_sender); | 40 CastTransport* const transport_sender); |
41 | 41 |
42 ~AudioSender() final; | 42 ~AudioSender() final; |
43 | 43 |
44 // Note: It is not guaranteed that |audio_frame| will actually be encoded and | 44 // Note: It is not guaranteed that |audio_frame| will actually be encoded and |
45 // sent, if AudioSender detects too many frames in flight. Therefore, clients | 45 // sent, if AudioSender detects too many frames in flight. Therefore, clients |
46 // should be careful about the rate at which this method is called. | 46 // should be careful about the rate at which this method is called. |
47 void InsertAudio(std::unique_ptr<AudioBus> audio_bus, | 47 void InsertAudio(std::unique_ptr<AudioBus> audio_bus, |
48 const base::TimeTicks& recorded_time); | 48 const base::TimeTicks& recorded_time); |
(...skipping 17 matching lines...) Expand all Loading... |
66 // NOTE: Weak pointers must be invalidated before all other member variables. | 66 // NOTE: Weak pointers must be invalidated before all other member variables. |
67 base::WeakPtrFactory<AudioSender> weak_factory_; | 67 base::WeakPtrFactory<AudioSender> weak_factory_; |
68 | 68 |
69 DISALLOW_COPY_AND_ASSIGN(AudioSender); | 69 DISALLOW_COPY_AND_ASSIGN(AudioSender); |
70 }; | 70 }; |
71 | 71 |
72 } // namespace cast | 72 } // namespace cast |
73 } // namespace media | 73 } // namespace media |
74 | 74 |
75 #endif // MEDIA_CAST_SENDER_AUDIO_SENDER_H_ | 75 #endif // MEDIA_CAST_SENDER_AUDIO_SENDER_H_ |
OLD | NEW |