| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 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 |
| 11 #ifndef WEBRTC_VIDEO_PAYLOAD_ROUTER_H_ | 11 #ifndef WEBRTC_VIDEO_PAYLOAD_ROUTER_H_ |
| 12 #define WEBRTC_VIDEO_PAYLOAD_ROUTER_H_ | 12 #define WEBRTC_VIDEO_PAYLOAD_ROUTER_H_ |
| 13 | 13 |
| 14 #include <vector> | 14 #include <vector> |
| 15 | 15 |
| 16 #include "webrtc/base/constructormagic.h" | 16 #include "webrtc/base/constructormagic.h" |
| 17 #include "webrtc/base/criticalsection.h" | 17 #include "webrtc/base/criticalsection.h" |
| 18 #include "webrtc/base/thread_annotations.h" | 18 #include "webrtc/base/thread_annotations.h" |
| 19 #include "webrtc/common_types.h" | 19 #include "webrtc/common_types.h" |
| 20 #include "webrtc/config.h" | 20 #include "webrtc/config.h" |
| 21 #include "webrtc/modules/video_coding/utility/simulcast_state.h" |
| 21 #include "webrtc/video_encoder.h" | 22 #include "webrtc/video_encoder.h" |
| 22 #include "webrtc/system_wrappers/include/atomic32.h" | 23 #include "webrtc/system_wrappers/include/atomic32.h" |
| 23 | 24 |
| 24 namespace webrtc { | 25 namespace webrtc { |
| 25 | 26 |
| 26 class RTPFragmentationHeader; | 27 class RTPFragmentationHeader; |
| 27 class RtpRtcp; | 28 class RtpRtcp; |
| 28 struct RTPVideoHeader; | 29 struct RTPVideoHeader; |
| 29 | 30 |
| 30 // PayloadRouter routes outgoing data to the correct sending RTP module, based | 31 // PayloadRouter routes outgoing data to the correct sending RTP module, based |
| (...skipping 14 matching lines...) Expand all Loading... |
| 45 bool active(); | 46 bool active(); |
| 46 | 47 |
| 47 // Implements EncodedImageCallback. | 48 // Implements EncodedImageCallback. |
| 48 // Returns 0 if the packet was routed / sent, -1 otherwise. | 49 // Returns 0 if the packet was routed / sent, -1 otherwise. |
| 49 int32_t Encoded(const EncodedImage& encoded_image, | 50 int32_t Encoded(const EncodedImage& encoded_image, |
| 50 const CodecSpecificInfo* codec_specific_info, | 51 const CodecSpecificInfo* codec_specific_info, |
| 51 const RTPFragmentationHeader* fragmentation) override; | 52 const RTPFragmentationHeader* fragmentation) override; |
| 52 | 53 |
| 53 // Configures current target bitrate. | 54 // Configures current target bitrate. |
| 54 void SetTargetSendBitrate(uint32_t bitrate_bps); | 55 void SetTargetSendBitrate(uint32_t bitrate_bps); |
| 56 // Update simulcast configuration when reconfiguring encoders. |
| 57 void UpdateSimulcastState(const SimulcastState& state); |
| 55 | 58 |
| 56 // Returns the maximum allowed data payload length, given the configured MTU | 59 // Returns the maximum allowed data payload length, given the configured MTU |
| 57 // and RTP headers. | 60 // and RTP headers. |
| 58 size_t MaxPayloadLength() const; | 61 size_t MaxPayloadLength() const; |
| 59 | 62 |
| 60 private: | 63 private: |
| 61 void UpdateModuleSendingState() EXCLUSIVE_LOCKS_REQUIRED(crit_); | 64 void UpdateModuleSendingState() EXCLUSIVE_LOCKS_REQUIRED(crit_); |
| 62 | 65 |
| 63 rtc::CriticalSection crit_; | 66 rtc::CriticalSection crit_; |
| 64 bool active_ GUARDED_BY(crit_); | 67 bool active_ GUARDED_BY(crit_); |
| 65 std::vector<VideoStream> streams_ GUARDED_BY(crit_); | 68 std::vector<VideoStream> streams_ GUARDED_BY(crit_); |
| 66 size_t num_sending_modules_ GUARDED_BY(crit_); | 69 size_t num_sending_modules_ GUARDED_BY(crit_); |
| 70 SimulcastState simulcast_state_ GUARDED_BY(crit_); |
| 67 | 71 |
| 68 // Rtp modules are assumed to be sorted in simulcast index order. Not owned. | 72 // Rtp modules are assumed to be sorted in simulcast index order. Not owned. |
| 69 const std::vector<RtpRtcp*> rtp_modules_; | 73 const std::vector<RtpRtcp*> rtp_modules_; |
| 70 const int payload_type_; | 74 const int payload_type_; |
| 71 | 75 |
| 72 RTC_DISALLOW_COPY_AND_ASSIGN(PayloadRouter); | 76 RTC_DISALLOW_COPY_AND_ASSIGN(PayloadRouter); |
| 73 }; | 77 }; |
| 74 | 78 |
| 75 } // namespace webrtc | 79 } // namespace webrtc |
| 76 | 80 |
| 77 #endif // WEBRTC_VIDEO_PAYLOAD_ROUTER_H_ | 81 #endif // WEBRTC_VIDEO_PAYLOAD_ROUTER_H_ |
| OLD | NEW |