OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 public VCMDecoderTimingCallback, | 61 public VCMDecoderTimingCallback, |
62 public VCMPacketRequestCallback, | 62 public VCMPacketRequestCallback, |
63 public RtpFeedback { | 63 public RtpFeedback { |
64 public: | 64 public: |
65 friend class ChannelStatsObserver; | 65 friend class ChannelStatsObserver; |
66 friend class ViEChannelProtectionCallback; | 66 friend class ViEChannelProtectionCallback; |
67 | 67 |
68 ViEChannel(uint32_t number_of_cores, | 68 ViEChannel(uint32_t number_of_cores, |
69 Transport* transport, | 69 Transport* transport, |
70 ProcessThread* module_process_thread, | 70 ProcessThread* module_process_thread, |
| 71 PayloadRouter* send_payload_router, |
| 72 VideoCodingModule* vcm, |
71 RtcpIntraFrameObserver* intra_frame_observer, | 73 RtcpIntraFrameObserver* intra_frame_observer, |
72 RtcpBandwidthObserver* bandwidth_observer, | 74 RtcpBandwidthObserver* bandwidth_observer, |
73 TransportFeedbackObserver* transport_feedback_observer, | 75 TransportFeedbackObserver* transport_feedback_observer, |
74 RemoteBitrateEstimator* remote_bitrate_estimator, | 76 RemoteBitrateEstimator* remote_bitrate_estimator, |
75 RtcpRttStats* rtt_stats, | 77 RtcpRttStats* rtt_stats, |
76 PacedSender* paced_sender, | 78 PacedSender* paced_sender, |
77 PacketRouter* packet_router, | 79 PacketRouter* packet_router, |
78 size_t max_rtp_streams, | 80 size_t max_rtp_streams, |
79 bool sender); | 81 bool sender); |
80 ~ViEChannel(); | 82 ~ViEChannel(); |
81 | 83 |
82 int32_t Init(); | 84 int32_t Init(); |
83 | 85 |
84 // Sets the encoder to use for the channel. |new_stream| indicates the encoder | 86 // Sets the encoder to use for the channel. |new_stream| indicates the encoder |
85 // type has changed and we should start a new RTP stream. | 87 // type has changed and we should start a new RTP stream. |
86 int32_t SetSendCodec(const VideoCodec& video_codec, bool new_stream = true); | 88 int32_t SetSendCodec(const VideoCodec& video_codec, bool new_stream = true); |
87 int32_t SetReceiveCodec(const VideoCodec& video_codec); | 89 int32_t SetReceiveCodec(const VideoCodec& video_codec); |
88 // Registers an external decoder. | 90 // Registers an external decoder. |
89 void RegisterExternalDecoder(const uint8_t pl_type, VideoDecoder* decoder); | 91 void RegisterExternalDecoder(const uint8_t pl_type, VideoDecoder* decoder); |
90 int32_t ReceiveCodecStatistics(uint32_t* num_key_frames, | 92 int32_t ReceiveCodecStatistics(uint32_t* num_key_frames, |
91 uint32_t* num_delta_frames); | 93 uint32_t* num_delta_frames); |
92 uint32_t DiscardedPackets() const; | |
93 | |
94 // Returns the estimated delay in milliseconds. | |
95 int ReceiveDelay() const; | |
96 | |
97 void SetExpectedRenderDelay(int delay_ms); | 94 void SetExpectedRenderDelay(int delay_ms); |
98 | 95 |
99 void SetRTCPMode(const RtcpMode rtcp_mode); | 96 void SetRTCPMode(const RtcpMode rtcp_mode); |
100 void SetProtectionMode(bool enable_nack, | 97 void SetProtectionMode(bool enable_nack, |
101 bool enable_fec, | 98 bool enable_fec, |
102 int payload_type_red, | 99 int payload_type_red, |
103 int payload_type_fec); | 100 int payload_type_fec); |
104 bool IsSendingFecEnabled(); | 101 bool IsSendingFecEnabled(); |
105 int SetSenderBufferingMode(int target_delay_ms); | 102 int SetSenderBufferingMode(int target_delay_ms); |
106 int SetSendTimestampOffsetStatus(bool enable, int id); | 103 int SetSendTimestampOffsetStatus(bool enable, int id); |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 const PacketTime& packet_time); | 204 const PacketTime& packet_time); |
208 int32_t ReceivedRTCPPacket(const void* rtcp_packet, | 205 int32_t ReceivedRTCPPacket(const void* rtcp_packet, |
209 const size_t rtcp_packet_length); | 206 const size_t rtcp_packet_length); |
210 | 207 |
211 // Sets the maximum transfer unit size for the network link, i.e. including | 208 // Sets the maximum transfer unit size for the network link, i.e. including |
212 // IP, UDP and RTP headers. | 209 // IP, UDP and RTP headers. |
213 int32_t SetMTU(uint16_t mtu); | 210 int32_t SetMTU(uint16_t mtu); |
214 | 211 |
215 // Gets the modules used by the channel. | 212 // Gets the modules used by the channel. |
216 RtpRtcp* rtp_rtcp(); | 213 RtpRtcp* rtp_rtcp(); |
217 rtc::scoped_refptr<PayloadRouter> send_payload_router(); | |
218 VCMProtectionCallback* vcm_protection_callback(); | 214 VCMProtectionCallback* vcm_protection_callback(); |
219 | 215 |
220 | 216 |
221 CallStatsObserver* GetStatsObserver(); | 217 CallStatsObserver* GetStatsObserver(); |
222 | 218 |
223 // Implements VCMReceiveCallback. | 219 // Implements VCMReceiveCallback. |
224 virtual int32_t FrameToRender(VideoFrame& video_frame); // NOLINT | 220 virtual int32_t FrameToRender(VideoFrame& video_frame); // NOLINT |
225 | 221 |
226 // Implements VCMReceiveCallback. | 222 // Implements VCMReceiveCallback. |
227 virtual int32_t ReceivedDecodedReferenceFrame( | 223 virtual int32_t ReceivedDecodedReferenceFrame( |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
394 | 390 |
395 private: | 391 private: |
396 std::map<uint32_t, RtcpPacketTypeCounter> counter_map_ | 392 std::map<uint32_t, RtcpPacketTypeCounter> counter_map_ |
397 GUARDED_BY(critsect_); | 393 GUARDED_BY(critsect_); |
398 } rtcp_packet_type_counter_observer_; | 394 } rtcp_packet_type_counter_observer_; |
399 | 395 |
400 const uint32_t number_of_cores_; | 396 const uint32_t number_of_cores_; |
401 const bool sender_; | 397 const bool sender_; |
402 | 398 |
403 ProcessThread* const module_process_thread_; | 399 ProcessThread* const module_process_thread_; |
| 400 PayloadRouter* const send_payload_router_; |
404 | 401 |
405 // Used for all registered callbacks except rendering. | 402 // Used for all registered callbacks except rendering. |
406 rtc::CriticalSection crit_; | 403 rtc::CriticalSection crit_; |
407 | 404 |
408 // Owned modules/classes. | 405 // Owned modules/classes. |
409 rtc::scoped_refptr<PayloadRouter> send_payload_router_; | |
410 rtc::scoped_ptr<ViEChannelProtectionCallback> vcm_protection_callback_; | 406 rtc::scoped_ptr<ViEChannelProtectionCallback> vcm_protection_callback_; |
411 | 407 |
412 VideoCodingModule* const vcm_; | 408 VideoCodingModule* const vcm_; |
413 ViEReceiver vie_receiver_; | 409 ViEReceiver vie_receiver_; |
414 ViESyncModule vie_sync_; | 410 ViESyncModule vie_sync_; |
415 | 411 |
416 // Helper to report call statistics. | 412 // Helper to report call statistics. |
417 rtc::scoped_ptr<ChannelStatsObserver> stats_observer_; | 413 rtc::scoped_ptr<ChannelStatsObserver> stats_observer_; |
418 | 414 |
419 // Not owned. | 415 // Not owned. |
(...skipping 22 matching lines...) Expand all Loading... |
442 size_t num_rtts_ GUARDED_BY(crit_); | 438 size_t num_rtts_ GUARDED_BY(crit_); |
443 | 439 |
444 // RtpRtcp modules, declared last as they use other members on construction. | 440 // RtpRtcp modules, declared last as they use other members on construction. |
445 const std::vector<RtpRtcp*> rtp_rtcp_modules_; | 441 const std::vector<RtpRtcp*> rtp_rtcp_modules_; |
446 size_t num_active_rtp_rtcp_modules_ GUARDED_BY(crit_); | 442 size_t num_active_rtp_rtcp_modules_ GUARDED_BY(crit_); |
447 }; | 443 }; |
448 | 444 |
449 } // namespace webrtc | 445 } // namespace webrtc |
450 | 446 |
451 #endif // WEBRTC_VIDEO_VIE_CHANNEL_H_ | 447 #endif // WEBRTC_VIDEO_VIE_CHANNEL_H_ |
OLD | NEW |