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 #ifndef WEBRTC_TEST_LAYER_FILTERING_TRANSPORT_H_ | 10 #ifndef WEBRTC_TEST_LAYER_FILTERING_TRANSPORT_H_ |
11 #define WEBRTC_TEST_LAYER_FILTERING_TRANSPORT_H_ | 11 #define WEBRTC_TEST_LAYER_FILTERING_TRANSPORT_H_ |
12 | 12 |
13 #include "webrtc/test/direct_transport.h" | 13 #include "webrtc/test/direct_transport.h" |
14 #include "webrtc/test/fake_network_pipe.h" | 14 #include "webrtc/test/fake_network_pipe.h" |
15 | 15 |
16 #include <map> | 16 #include <map> |
17 | 17 |
18 namespace webrtc { | 18 namespace webrtc { |
19 | 19 |
20 namespace test { | 20 namespace test { |
21 | 21 |
22 class LayerFilteringTransport : public test::DirectTransport { | 22 class LayerFilteringTransport : public test::DirectTransport { |
23 public: | 23 public: |
24 LayerFilteringTransport(const FakeNetworkPipe::Config& config, | 24 LayerFilteringTransport(const FakeNetworkPipe::Config& config, |
25 uint8_t vp8_video_payload_type, | 25 uint8_t vp8_video_payload_type, |
26 uint8_t vp9_video_payload_type, | 26 uint8_t vp9_video_payload_type, |
27 uint8_t tl_discard_threshold, | 27 int selected_tl, |
28 uint8_t sl_discard_threshold); | 28 int selected_sl); |
| 29 bool DiscardedLastPacket() const; |
29 bool SendRtp(const uint8_t* data, | 30 bool SendRtp(const uint8_t* data, |
30 size_t length, | 31 size_t length, |
31 const PacketOptions& options) override; | 32 const PacketOptions& options) override; |
32 | 33 |
33 private: | 34 private: |
34 uint16_t NextSequenceNumber(uint32_t ssrc); | 35 uint16_t NextSequenceNumber(uint32_t ssrc); |
35 // Used to distinguish between VP8 and VP9. | 36 // Used to distinguish between VP8 and VP9. |
36 const uint8_t vp8_video_payload_type_; | 37 const uint8_t vp8_video_payload_type_; |
37 const uint8_t vp9_video_payload_type_; | 38 const uint8_t vp9_video_payload_type_; |
38 // Discard all temporal/spatial layers with id greater or equal the | 39 // Discard or invalidate all temporal/spatial layers with id greater than the |
39 // threshold. 0 to disable. | 40 // selected one. -1 to disable filtering. |
40 const uint8_t tl_discard_threshold_; | 41 const int selected_tl_; |
41 const uint8_t sl_discard_threshold_; | 42 const int selected_sl_; |
42 // Current sequence number for each SSRC separately. | 43 // Current sequence number for each SSRC separately. |
43 std::map<uint32_t, uint16_t> current_seq_nums_; | 44 std::map<uint32_t, uint16_t> current_seq_nums_; |
| 45 bool discarded_last_packet_; |
44 }; | 46 }; |
45 | 47 |
46 } // namespace test | 48 } // namespace test |
47 } // namespace webrtc | 49 } // namespace webrtc |
48 | 50 |
49 #endif // WEBRTC_TEST_LAYER_FILTERING_TRANSPORT_H_ | 51 #endif // WEBRTC_TEST_LAYER_FILTERING_TRANSPORT_H_ |
OLD | NEW |