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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 // Processes ready-to-consume packets from |framer_|, decrypting each packet's | 82 // Processes ready-to-consume packets from |framer_|, decrypting each packet's |
83 // payload data, and then running the enqueued callbacks in order (one for | 83 // payload data, and then running the enqueued callbacks in order (one for |
84 // each packet). This method may post a delayed task to re-invoke itself in | 84 // each packet). This method may post a delayed task to re-invoke itself in |
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 // Helper that runs |callback|, passing ownership of |encoded_frame| to it. |
| 93 // This method is used by EmitAvailableEncodedFrames() to return to the event |
| 94 // loop, but make sure that FrameReceiver is still alive before the callback |
| 95 // is run. |
| 96 void EmitOneFrame(const ReceiveEncodedFrameCallback& callback, |
| 97 scoped_ptr<EncodedFrame> encoded_frame) const; |
| 98 |
92 // Computes the playout time for a frame with the given |rtp_timestamp|. | 99 // 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 | 100 // Because lip-sync info is refreshed regularly, calling this method with the |
94 // same argument may return different results. | 101 // same argument may return different results. |
95 base::TimeTicks GetPlayoutTime(const EncodedFrame& frame) const; | 102 base::TimeTicks GetPlayoutTime(const EncodedFrame& frame) const; |
96 | 103 |
97 // Schedule timing for the next cast message. | 104 // Schedule timing for the next cast message. |
98 void ScheduleNextCastMessage(); | 105 void ScheduleNextCastMessage(); |
99 | 106 |
100 // Schedule timing for the next RTCP report. | 107 // Schedule timing for the next RTCP report. |
101 void ScheduleNextRtcpReport(); | 108 void ScheduleNextRtcpReport(); |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 // NOTE: Weak pointers must be invalidated before all other member variables. | 185 // NOTE: Weak pointers must be invalidated before all other member variables. |
179 base::WeakPtrFactory<FrameReceiver> weak_factory_; | 186 base::WeakPtrFactory<FrameReceiver> weak_factory_; |
180 | 187 |
181 DISALLOW_COPY_AND_ASSIGN(FrameReceiver); | 188 DISALLOW_COPY_AND_ASSIGN(FrameReceiver); |
182 }; | 189 }; |
183 | 190 |
184 } // namespace cast | 191 } // namespace cast |
185 } // namespace media | 192 } // namespace media |
186 | 193 |
187 #endif // MEDIA_CAST_RECEIVER_FRAME_RECEIVER_H_ | 194 #endif // MEDIA_CAST_RECEIVER_FRAME_RECEIVER_H_ |
OLD | NEW |