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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 class VideoCodingModule; | 49 class VideoCodingModule; |
50 class VideoDecoder; | 50 class VideoDecoder; |
51 class VideoRenderCallback; | 51 class VideoRenderCallback; |
52 class VoEVideoSync; | 52 class VoEVideoSync; |
53 | 53 |
54 enum StreamType { | 54 enum StreamType { |
55 kViEStreamTypeNormal = 0, // Normal media stream | 55 kViEStreamTypeNormal = 0, // Normal media stream |
56 kViEStreamTypeRtx = 1 // Retransmission media stream | 56 kViEStreamTypeRtx = 1 // Retransmission media stream |
57 }; | 57 }; |
58 | 58 |
59 class ViEChannel : public VCMFrameTypeCallback, | 59 class ViEChannel : public Module, |
| 60 public VCMFrameTypeCallback, |
60 public VCMReceiveCallback, | 61 public VCMReceiveCallback, |
61 public VCMReceiveStatisticsCallback, | 62 public VCMReceiveStatisticsCallback, |
62 public VCMDecoderTimingCallback, | 63 public VCMDecoderTimingCallback, |
63 public VCMPacketRequestCallback, | 64 public VCMPacketRequestCallback, |
64 public RtpFeedback { | 65 public RtpFeedback { |
65 public: | 66 public: |
66 friend class ChannelStatsObserver; | 67 friend class ChannelStatsObserver; |
67 friend class ViEChannelProtectionCallback; | 68 friend class ViEChannelProtectionCallback; |
68 | 69 |
69 ViEChannel(uint32_t number_of_cores, | 70 ViEChannel(uint32_t number_of_cores, |
70 Transport* transport, | 71 Transport* transport, |
71 ProcessThread* module_process_thread, | 72 ProcessThread* module_process_thread, |
72 RtcpIntraFrameObserver* intra_frame_observer, | 73 RtcpIntraFrameObserver* intra_frame_observer, |
73 RtcpBandwidthObserver* bandwidth_observer, | 74 RtcpBandwidthObserver* bandwidth_observer, |
74 TransportFeedbackObserver* transport_feedback_observer, | 75 TransportFeedbackObserver* transport_feedback_observer, |
75 RemoteBitrateEstimator* remote_bitrate_estimator, | 76 RemoteBitrateEstimator* remote_bitrate_estimator, |
76 RtcpRttStats* rtt_stats, | 77 RtcpRttStats* rtt_stats, |
77 PacedSender* paced_sender, | 78 PacedSender* paced_sender, |
78 PacketRouter* packet_router, | 79 PacketRouter* packet_router, |
79 size_t max_rtp_streams, | 80 size_t max_rtp_streams, |
80 bool sender); | 81 bool sender); |
81 ~ViEChannel(); | 82 ~ViEChannel(); |
82 | 83 |
83 int32_t Init(); | 84 int32_t Init(); |
84 | 85 |
85 // Sets the encoder to use for the channel. |new_stream| indicates the encoder | 86 // Runs all RTP modules. Done since all modules have to be registered on the |
86 // type has changed and we should start a new RTP stream. | 87 // main thread, but we allocate/deallocate on the encoding thread. |
87 int32_t SetSendCodec(const VideoCodec& video_codec, bool new_stream = true); | 88 int64_t TimeUntilNextProcess() override; |
| 89 int32_t Process() override; |
| 90 |
| 91 // Sets the encoder to use for the channel. |
| 92 void SetSendCodec(const VideoCodec& video_codec); |
88 int32_t SetReceiveCodec(const VideoCodec& video_codec); | 93 int32_t SetReceiveCodec(const VideoCodec& video_codec); |
89 // Registers an external decoder. | 94 // Registers an external decoder. |
90 void RegisterExternalDecoder(const uint8_t pl_type, VideoDecoder* decoder); | 95 void RegisterExternalDecoder(const uint8_t pl_type, VideoDecoder* decoder); |
91 int32_t ReceiveCodecStatistics(uint32_t* num_key_frames, | 96 int32_t ReceiveCodecStatistics(uint32_t* num_key_frames, |
92 uint32_t* num_delta_frames); | 97 uint32_t* num_delta_frames); |
93 uint32_t DiscardedPackets() const; | 98 uint32_t DiscardedPackets() const; |
94 | 99 |
95 // Returns the estimated delay in milliseconds. | 100 // Returns the estimated delay in milliseconds. |
96 int ReceiveDelay() const; | 101 int ReceiveDelay() const; |
97 | 102 |
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
445 size_t num_rtts_ GUARDED_BY(crit_); | 450 size_t num_rtts_ GUARDED_BY(crit_); |
446 | 451 |
447 // RtpRtcp modules, declared last as they use other members on construction. | 452 // RtpRtcp modules, declared last as they use other members on construction. |
448 const std::vector<RtpRtcp*> rtp_rtcp_modules_; | 453 const std::vector<RtpRtcp*> rtp_rtcp_modules_; |
449 size_t num_active_rtp_rtcp_modules_ GUARDED_BY(crit_); | 454 size_t num_active_rtp_rtcp_modules_ GUARDED_BY(crit_); |
450 }; | 455 }; |
451 | 456 |
452 } // namespace webrtc | 457 } // namespace webrtc |
453 | 458 |
454 #endif // WEBRTC_VIDEO_VIE_CHANNEL_H_ | 459 #endif // WEBRTC_VIDEO_VIE_CHANNEL_H_ |
OLD | NEW |