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_RECEIVER_FRAME_RECEIVER_H_ | 5 #ifndef MEDIA_CAST_RECEIVER_FRAME_RECEIVER_H_ |
6 #define MEDIA_CAST_RECEIVER_FRAME_RECEIVER_H_ | 6 #define MEDIA_CAST_RECEIVER_FRAME_RECEIVER_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/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 // the future to wait for missing/incomplete frames. | 85 // the future to wait for missing/incomplete frames. |
86 void EmitAvailableEncodedFrames(); | 86 void EmitAvailableEncodedFrames(); |
87 | 87 |
88 // Clears the |is_waiting_for_consecutive_frame_| flag and invokes | 88 // Clears the |is_waiting_for_consecutive_frame_| flag and invokes |
89 // EmitAvailableEncodedFrames(). | 89 // EmitAvailableEncodedFrames(). |
90 void EmitAvailableEncodedFramesAfterWaiting(); | 90 void EmitAvailableEncodedFramesAfterWaiting(); |
91 | 91 |
92 // Computes the playout time for a frame with the given |rtp_timestamp|. | 92 // Computes the playout time for a frame with the given |rtp_timestamp|. |
93 // Because lip-sync info is refreshed regularly, calling this method with the | 93 // Because lip-sync info is refreshed regularly, calling this method with the |
94 // same argument may return different results. | 94 // same argument may return different results. |
95 base::TimeTicks GetPlayoutTime(uint32 rtp_timestamp) const; | 95 base::TimeTicks GetPlayoutTime(const EncodedFrame& frame) const; |
96 | 96 |
97 // Schedule timing for the next cast message. | 97 // Schedule timing for the next cast message. |
98 void ScheduleNextCastMessage(); | 98 void ScheduleNextCastMessage(); |
99 | 99 |
100 // Schedule timing for the next RTCP report. | 100 // Schedule timing for the next RTCP report. |
101 void ScheduleNextRtcpReport(); | 101 void ScheduleNextRtcpReport(); |
102 | 102 |
103 // Actually send the next cast message. | 103 // Actually send the next cast message. |
104 void SendNextCastMessage(); | 104 void SendNextCastMessage(); |
105 | 105 |
(...skipping 17 matching lines...) Expand all Loading... |
123 | 123 |
124 // RTP timebase: The number of RTP units advanced per one second. | 124 // RTP timebase: The number of RTP units advanced per one second. |
125 const int rtp_timebase_; | 125 const int rtp_timebase_; |
126 | 126 |
127 // The total amount of time between a frame's capture/recording on the sender | 127 // The total amount of time between a frame's capture/recording on the sender |
128 // and its playback on the receiver (i.e., shown to a user). This is fixed as | 128 // and its playback on the receiver (i.e., shown to a user). This is fixed as |
129 // a value large enough to give the system sufficient time to encode, | 129 // a value large enough to give the system sufficient time to encode, |
130 // transmit/retransmit, receive, decode, and render; given its run-time | 130 // transmit/retransmit, receive, decode, and render; given its run-time |
131 // environment (sender/receiver hardware performance, network conditions, | 131 // environment (sender/receiver hardware performance, network conditions, |
132 // etc.). | 132 // etc.). |
133 const base::TimeDelta target_playout_delay_; | 133 base::TimeDelta target_playout_delay_; |
134 | 134 |
135 // Hack: This is used in logic that determines whether to skip frames. | 135 // Hack: This is used in logic that determines whether to skip frames. |
136 // TODO(miu): Revisit this. Logic needs to also account for expected decode | 136 // TODO(miu): Revisit this. Logic needs to also account for expected decode |
137 // time. | 137 // time. |
138 const base::TimeDelta expected_frame_duration_; | 138 const base::TimeDelta expected_frame_duration_; |
139 | 139 |
140 // Set to false initially, then set to true after scheduling the periodic | 140 // Set to false initially, then set to true after scheduling the periodic |
141 // sending of reports back to the sender. Reports are first scheduled just | 141 // sending of reports back to the sender. Reports are first scheduled just |
142 // after receiving a first packet (since the first packet identifies the | 142 // after receiving a first packet (since the first packet identifies the |
143 // sender for the remainder of the session). | 143 // sender for the remainder of the session). |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 // NOTE: Weak pointers must be invalidated before all other member variables. | 178 // NOTE: Weak pointers must be invalidated before all other member variables. |
179 base::WeakPtrFactory<FrameReceiver> weak_factory_; | 179 base::WeakPtrFactory<FrameReceiver> weak_factory_; |
180 | 180 |
181 DISALLOW_COPY_AND_ASSIGN(FrameReceiver); | 181 DISALLOW_COPY_AND_ASSIGN(FrameReceiver); |
182 }; | 182 }; |
183 | 183 |
184 } // namespace cast | 184 } // namespace cast |
185 } // namespace media | 185 } // namespace media |
186 | 186 |
187 #endif // MEDIA_CAST_RECEIVER_FRAME_RECEIVER_H_ | 187 #endif // MEDIA_CAST_RECEIVER_FRAME_RECEIVER_H_ |
OLD | NEW |