OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_VIDEO_RECEIVER_VIDEO_RECEIVER_H_ | 5 #ifndef MEDIA_CAST_VIDEO_RECEIVER_VIDEO_RECEIVER_H_ |
6 #define MEDIA_CAST_VIDEO_RECEIVER_VIDEO_RECEIVER_H_ | 6 #define MEDIA_CAST_VIDEO_RECEIVER_VIDEO_RECEIVER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 // outstanding requests (perhaps to just one or two). | 51 // outstanding requests (perhaps to just one or two). |
52 // | 52 // |
53 // This class is not thread safe. Should only be called from the Main cast | 53 // This class is not thread safe. Should only be called from the Main cast |
54 // thread. | 54 // thread. |
55 class VideoReceiver : public RtpReceiver, | 55 class VideoReceiver : public RtpReceiver, |
56 public RtpPayloadFeedback, | 56 public RtpPayloadFeedback, |
57 public base::NonThreadSafe, | 57 public base::NonThreadSafe, |
58 public base::SupportsWeakPtr<VideoReceiver> { | 58 public base::SupportsWeakPtr<VideoReceiver> { |
59 public: | 59 public: |
60 VideoReceiver(scoped_refptr<CastEnvironment> cast_environment, | 60 VideoReceiver(scoped_refptr<CastEnvironment> cast_environment, |
61 const VideoReceiverConfig& video_config, | 61 const FrameReceiverConfig& video_config, |
62 transport::PacedPacketSender* const packet_sender); | 62 transport::PacedPacketSender* const packet_sender); |
63 | 63 |
64 virtual ~VideoReceiver(); | 64 virtual ~VideoReceiver(); |
65 | 65 |
66 // Request a decoded video frame. | 66 // Request a decoded video frame. |
67 // | 67 // |
68 // The given |callback| is guaranteed to be run at some point in the future, | 68 // The given |callback| is guaranteed to be run at some point in the future, |
69 // even if to respond with NULL at shutdown time. | 69 // even if to respond with NULL at shutdown time. |
70 void GetRawVideoFrame(const VideoFrameDecodedCallback& callback); | 70 void GetRawVideoFrame(const VideoFrameDecodedCallback& callback); |
71 | 71 |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 const base::TimeTicks& playout_time, | 135 const base::TimeTicks& playout_time, |
136 const scoped_refptr<VideoFrame>& video_frame, | 136 const scoped_refptr<VideoFrame>& video_frame, |
137 bool is_continuous); | 137 bool is_continuous); |
138 | 138 |
139 const scoped_refptr<CastEnvironment> cast_environment_; | 139 const scoped_refptr<CastEnvironment> cast_environment_; |
140 | 140 |
141 // Subscribes to raw events. | 141 // Subscribes to raw events. |
142 // Processes raw audio events to be sent over to the cast sender via RTCP. | 142 // Processes raw audio events to be sent over to the cast sender via RTCP. |
143 ReceiverRtcpEventSubscriber event_subscriber_; | 143 ReceiverRtcpEventSubscriber event_subscriber_; |
144 | 144 |
145 // Configured audio codec. | 145 // Configured video codec. |
146 const transport::VideoCodec codec_; | 146 const transport::VideoCodec codec_; |
147 | 147 |
148 // The total amount of time between a frame's capture/recording on the sender | 148 // The total amount of time between a frame's capture/recording on the sender |
149 // and its playback on the receiver (i.e., shown to a user). This is fixed as | 149 // and its playback on the receiver (i.e., shown to a user). This is fixed as |
150 // a value large enough to give the system sufficient time to encode, | 150 // a value large enough to give the system sufficient time to encode, |
151 // transmit/retransmit, receive, decode, and render; given its run-time | 151 // transmit/retransmit, receive, decode, and render; given its run-time |
152 // environment (sender/receiver hardware performance, network conditions, | 152 // environment (sender/receiver hardware performance, network conditions, |
153 // etc.). | 153 // etc.). |
154 const base::TimeDelta target_playout_delay_; | 154 const base::TimeDelta target_playout_delay_; |
155 | 155 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 // NOTE: Weak pointers must be invalidated before all other member variables. | 197 // NOTE: Weak pointers must be invalidated before all other member variables. |
198 base::WeakPtrFactory<VideoReceiver> weak_factory_; | 198 base::WeakPtrFactory<VideoReceiver> weak_factory_; |
199 | 199 |
200 DISALLOW_COPY_AND_ASSIGN(VideoReceiver); | 200 DISALLOW_COPY_AND_ASSIGN(VideoReceiver); |
201 }; | 201 }; |
202 | 202 |
203 } // namespace cast | 203 } // namespace cast |
204 } // namespace media | 204 } // namespace media |
205 | 205 |
206 #endif // MEDIA_CAST_VIDEO_RECEIVER_VIDEO_RECEIVER_H_ | 206 #endif // MEDIA_CAST_VIDEO_RECEIVER_VIDEO_RECEIVER_H_ |
OLD | NEW |