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 "base/basictypes.h" | 12 #include "base/basictypes.h" |
13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
15 #include "base/time/time.h" | 15 #include "base/time/time.h" |
16 #include "media/cast/cast_environment.h" | 16 #include "media/cast/cast_environment.h" |
17 #include "media/cast/net/rtcp/rtcp.h" | 17 #include "media/cast/net/rtcp/rtcp.h" |
18 #include "media/cast/sender/congestion_control.h" | 18 #include "media/cast/sender/congestion_control.h" |
19 | 19 |
20 namespace media { | 20 namespace media { |
21 namespace cast { | 21 namespace cast { |
22 | 22 |
23 // Starting playout time when we enter interactive mode. | |
24 const int kInteractiveModeStartPlayoutTimeMs = 120; | |
miu
2015/12/01 21:15:27
Rather than as constants, these should be plumbed-
Irfan
2015/12/02 22:32:44
I thought about this and have gone with following:
| |
25 | |
26 // Starting playout time when we encounter a need to drop a frame while in | |
27 // non-interactive mode. This is chosen to be a value that is known to work | |
28 // well for animation content in order to minimize freezing while switching | |
29 // between interactive and non-interactive mode. | |
30 const int kNonInteractiveModeStartPlayoutTimeMs = 400; | |
31 | |
23 struct SenderEncodedFrame; | 32 struct SenderEncodedFrame; |
24 | 33 |
25 class FrameSender { | 34 class FrameSender { |
26 public: | 35 public: |
27 FrameSender(scoped_refptr<CastEnvironment> cast_environment, | 36 FrameSender(scoped_refptr<CastEnvironment> cast_environment, |
28 bool is_audio, | 37 bool is_audio, |
29 CastTransportSender* const transport_sender, | 38 CastTransportSender* const transport_sender, |
30 int rtp_timebase, | 39 int rtp_timebase, |
31 uint32 ssrc, | 40 uint32 ssrc, |
32 double max_frame_rate, | 41 double max_frame_rate, |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
172 // NOTE: Weak pointers must be invalidated before all other member variables. | 181 // NOTE: Weak pointers must be invalidated before all other member variables. |
173 base::WeakPtrFactory<FrameSender> weak_factory_; | 182 base::WeakPtrFactory<FrameSender> weak_factory_; |
174 | 183 |
175 DISALLOW_COPY_AND_ASSIGN(FrameSender); | 184 DISALLOW_COPY_AND_ASSIGN(FrameSender); |
176 }; | 185 }; |
177 | 186 |
178 } // namespace cast | 187 } // namespace cast |
179 } // namespace media | 188 } // namespace media |
180 | 189 |
181 #endif // MEDIA_CAST_SENDER_FRAME_SENDER_H_ | 190 #endif // MEDIA_CAST_SENDER_FRAME_SENDER_H_ |
OLD | NEW |