| 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/call/call.h" | 13 #include "webrtc/call/call.h" |
| 14 #include "webrtc/test/direct_transport.h" | 14 #include "webrtc/test/direct_transport.h" |
| 15 #include "webrtc/test/fake_network_pipe.h" | 15 #include "webrtc/test/fake_network_pipe.h" |
| 16 #include "webrtc/test/single_threaded_task_queue.h" |
| 16 | 17 |
| 17 #include <map> | 18 #include <map> |
| 18 | 19 |
| 19 namespace webrtc { | 20 namespace webrtc { |
| 20 | 21 |
| 21 namespace test { | 22 namespace test { |
| 22 | 23 |
| 23 class LayerFilteringTransport : public test::DirectTransport { | 24 class LayerFilteringTransport : public test::DirectTransport { |
| 24 public: | 25 public: |
| 25 LayerFilteringTransport(const FakeNetworkPipe::Config& config, | 26 LayerFilteringTransport(SingleThreadedTaskQueueForTesting* task_queue, |
| 27 const FakeNetworkPipe::Config& config, |
| 26 Call* send_call, | 28 Call* send_call, |
| 27 uint8_t vp8_video_payload_type, | 29 uint8_t vp8_video_payload_type, |
| 28 uint8_t vp9_video_payload_type, | 30 uint8_t vp9_video_payload_type, |
| 29 int selected_tl, | 31 int selected_tl, |
| 30 int selected_sl, | 32 int selected_sl, |
| 31 const std::map<uint8_t, MediaType>& payload_type_map); | 33 const std::map<uint8_t, MediaType>& payload_type_map); |
| 32 bool DiscardedLastPacket() const; | 34 bool DiscardedLastPacket() const; |
| 33 bool SendRtp(const uint8_t* data, | 35 bool SendRtp(const uint8_t* data, |
| 34 size_t length, | 36 size_t length, |
| 35 const PacketOptions& options) override; | 37 const PacketOptions& options) override; |
| 36 | 38 |
| 37 private: | 39 private: |
| 38 // Used to distinguish between VP8 and VP9. | 40 // Used to distinguish between VP8 and VP9. |
| 39 const uint8_t vp8_video_payload_type_; | 41 const uint8_t vp8_video_payload_type_; |
| 40 const uint8_t vp9_video_payload_type_; | 42 const uint8_t vp9_video_payload_type_; |
| 41 // Discard or invalidate all temporal/spatial layers with id greater than the | 43 // Discard or invalidate all temporal/spatial layers with id greater than the |
| 42 // selected one. -1 to disable filtering. | 44 // selected one. -1 to disable filtering. |
| 43 const int selected_tl_; | 45 const int selected_tl_; |
| 44 const int selected_sl_; | 46 const int selected_sl_; |
| 45 bool discarded_last_packet_; | 47 bool discarded_last_packet_; |
| 46 }; | 48 }; |
| 47 | 49 |
| 48 } // namespace test | 50 } // namespace test |
| 49 } // namespace webrtc | 51 } // namespace webrtc |
| 50 | 52 |
| 51 #endif // WEBRTC_TEST_LAYER_FILTERING_TRANSPORT_H_ | 53 #endif // WEBRTC_TEST_LAYER_FILTERING_TRANSPORT_H_ |
| OLD | NEW |