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 // This is the base class for an object that send frames to a receiver. | 5 // This is the base class for an object that send frames to a receiver. |
6 // TODO(hclam): Refactor such that there is no separate AudioSender vs. | 6 // TODO(hclam): Refactor such that there is no separate AudioSender vs. |
7 // VideoSender, and the functionality of both is rolled into this class. | 7 // VideoSender, and the functionality of both is rolled into this class. |
8 | 8 |
9 #ifndef MEDIA_CAST_SENDER_FRAME_SENDER_H_ | 9 #ifndef MEDIA_CAST_SENDER_FRAME_SENDER_H_ |
10 #define MEDIA_CAST_SENDER_FRAME_SENDER_H_ | 10 #define MEDIA_CAST_SENDER_FRAME_SENDER_H_ |
11 | 11 |
12 #include <stdint.h> | 12 #include <stdint.h> |
13 | 13 |
14 #include "base/macros.h" | 14 #include "base/macros.h" |
15 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
16 #include "base/memory/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" |
17 #include "base/time/time.h" | 17 #include "base/time/time.h" |
| 18 #include "media/cast/cast_config.h" |
18 #include "media/cast/cast_environment.h" | 19 #include "media/cast/cast_environment.h" |
19 #include "media/cast/net/cast_transport.h" | 20 #include "media/cast/net/cast_transport.h" |
20 #include "media/cast/net/rtcp/rtcp_defines.h" | 21 #include "media/cast/net/rtcp/rtcp_defines.h" |
21 #include "media/cast/sender/congestion_control.h" | 22 #include "media/cast/sender/congestion_control.h" |
22 | 23 |
23 namespace media { | 24 namespace media { |
24 namespace cast { | 25 namespace cast { |
25 | 26 |
26 struct SenderEncodedFrame; | 27 struct SenderEncodedFrame; |
27 | 28 |
28 class FrameSender { | 29 class FrameSender { |
29 public: | 30 public: |
30 FrameSender(scoped_refptr<CastEnvironment> cast_environment, | 31 FrameSender(scoped_refptr<CastEnvironment> cast_environment, |
31 bool is_audio, | |
32 CastTransport* const transport_sender, | 32 CastTransport* const transport_sender, |
33 int rtp_timebase, | 33 const FrameSenderConfig& config, |
34 uint32_t ssrc, | |
35 double max_frame_rate, | |
36 base::TimeDelta min_playout_delay, | |
37 base::TimeDelta max_playout_delay, | |
38 base::TimeDelta animated_playout_delay, | |
39 CongestionControl* congestion_control); | 34 CongestionControl* congestion_control); |
40 virtual ~FrameSender(); | 35 virtual ~FrameSender(); |
41 | 36 |
42 int rtp_timebase() const { return rtp_timebase_; } | 37 int rtp_timebase() const { return rtp_timebase_; } |
43 | 38 |
44 // Calling this function is only valid if the receiver supports the | 39 // Calling this function is only valid if the receiver supports the |
45 // "extra_playout_delay", rtp extension. | 40 // "extra_playout_delay", rtp extension. |
46 void SetTargetPlayoutDelay(base::TimeDelta new_target_playout_delay); | 41 void SetTargetPlayoutDelay(base::TimeDelta new_target_playout_delay); |
47 | 42 |
48 base::TimeDelta GetTargetPlayoutDelay() const { | 43 base::TimeDelta GetTargetPlayoutDelay() const { |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 // NOTE: Weak pointers must be invalidated before all other member variables. | 198 // NOTE: Weak pointers must be invalidated before all other member variables. |
204 base::WeakPtrFactory<FrameSender> weak_factory_; | 199 base::WeakPtrFactory<FrameSender> weak_factory_; |
205 | 200 |
206 DISALLOW_COPY_AND_ASSIGN(FrameSender); | 201 DISALLOW_COPY_AND_ASSIGN(FrameSender); |
207 }; | 202 }; |
208 | 203 |
209 } // namespace cast | 204 } // namespace cast |
210 } // namespace media | 205 } // namespace media |
211 | 206 |
212 #endif // MEDIA_CAST_SENDER_FRAME_SENDER_H_ | 207 #endif // MEDIA_CAST_SENDER_FRAME_SENDER_H_ |
OLD | NEW |