ivica | 7f6a6fc | 2015-09-08 02:40:29 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. |
| 3 | * |
| 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 |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 10 | #ifndef TEST_LAYER_FILTERING_TRANSPORT_H_ |
| 11 | #define TEST_LAYER_FILTERING_TRANSPORT_H_ |
ivica | 7f6a6fc | 2015-09-08 02:40:29 -0700 | [diff] [blame] | 12 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 13 | #include "call/call.h" |
| 14 | #include "test/direct_transport.h" |
| 15 | #include "test/fake_network_pipe.h" |
| 16 | #include "test/single_threaded_task_queue.h" |
ivica | 7f6a6fc | 2015-09-08 02:40:29 -0700 | [diff] [blame] | 17 | |
ivica | e78e2c7 | 2015-10-07 23:44:29 -0700 | [diff] [blame] | 18 | #include <map> |
| 19 | |
ivica | 7f6a6fc | 2015-09-08 02:40:29 -0700 | [diff] [blame] | 20 | namespace webrtc { |
| 21 | |
| 22 | namespace test { |
| 23 | |
| 24 | class LayerFilteringTransport : public test::DirectTransport { |
| 25 | public: |
eladalon | 413ee9a | 2017-08-22 04:02:52 -0700 | [diff] [blame] | 26 | LayerFilteringTransport(SingleThreadedTaskQueueForTesting* task_queue, |
| 27 | const FakeNetworkPipe::Config& config, |
stefan | f116bd0 | 2015-10-27 08:29:42 -0700 | [diff] [blame] | 28 | Call* send_call, |
ivica | 7f6a6fc | 2015-09-08 02:40:29 -0700 | [diff] [blame] | 29 | uint8_t vp8_video_payload_type, |
| 30 | uint8_t vp9_video_payload_type, |
sprang | ce4aef1 | 2015-11-02 07:23:20 -0800 | [diff] [blame] | 31 | int selected_tl, |
minyue | 20c84cc | 2017-04-10 16:57:57 -0700 | [diff] [blame] | 32 | int selected_sl, |
| 33 | const std::map<uint8_t, MediaType>& payload_type_map); |
sprang | ce4aef1 | 2015-11-02 07:23:20 -0800 | [diff] [blame] | 34 | bool DiscardedLastPacket() const; |
stefan | 1d8a506 | 2015-10-02 03:39:33 -0700 | [diff] [blame] | 35 | bool SendRtp(const uint8_t* data, |
| 36 | size_t length, |
| 37 | const PacketOptions& options) override; |
ivica | 7f6a6fc | 2015-09-08 02:40:29 -0700 | [diff] [blame] | 38 | |
| 39 | private: |
| 40 | // Used to distinguish between VP8 and VP9. |
| 41 | const uint8_t vp8_video_payload_type_; |
| 42 | const uint8_t vp9_video_payload_type_; |
sprang | ce4aef1 | 2015-11-02 07:23:20 -0800 | [diff] [blame] | 43 | // Discard or invalidate all temporal/spatial layers with id greater than the |
| 44 | // selected one. -1 to disable filtering. |
| 45 | const int selected_tl_; |
| 46 | const int selected_sl_; |
| 47 | bool discarded_last_packet_; |
ivica | 7f6a6fc | 2015-09-08 02:40:29 -0700 | [diff] [blame] | 48 | }; |
| 49 | |
| 50 | } // namespace test |
| 51 | } // namespace webrtc |
| 52 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 53 | #endif // TEST_LAYER_FILTERING_TRANSPORT_H_ |