blob: abbc86a9ec1ef251c0c3c22f03f8874badef4bdb [file] [log] [blame]
ivica7f6a6fc2015-09-08 02:40:29 -07001/*
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 Bonadei92ea95e2017-09-15 06:47:31 +020010#ifndef TEST_LAYER_FILTERING_TRANSPORT_H_
11#define TEST_LAYER_FILTERING_TRANSPORT_H_
ivica7f6a6fc2015-09-08 02:40:29 -070012
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020013#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"
ivica7f6a6fc2015-09-08 02:40:29 -070017
ivicae78e2c72015-10-07 23:44:29 -070018#include <map>
19
ivica7f6a6fc2015-09-08 02:40:29 -070020namespace webrtc {
21
22namespace test {
23
24class LayerFilteringTransport : public test::DirectTransport {
25 public:
eladalon413ee9a2017-08-22 04:02:52 -070026 LayerFilteringTransport(SingleThreadedTaskQueueForTesting* task_queue,
27 const FakeNetworkPipe::Config& config,
stefanf116bd02015-10-27 08:29:42 -070028 Call* send_call,
ivica7f6a6fc2015-09-08 02:40:29 -070029 uint8_t vp8_video_payload_type,
30 uint8_t vp9_video_payload_type,
sprangce4aef12015-11-02 07:23:20 -080031 int selected_tl,
minyue20c84cc2017-04-10 16:57:57 -070032 int selected_sl,
33 const std::map<uint8_t, MediaType>& payload_type_map);
sprangce4aef12015-11-02 07:23:20 -080034 bool DiscardedLastPacket() const;
stefan1d8a5062015-10-02 03:39:33 -070035 bool SendRtp(const uint8_t* data,
36 size_t length,
37 const PacketOptions& options) override;
ivica7f6a6fc2015-09-08 02:40:29 -070038
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_;
sprangce4aef12015-11-02 07:23:20 -080043 // 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_;
ivica7f6a6fc2015-09-08 02:40:29 -070048};
49
50} // namespace test
51} // namespace webrtc
52
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020053#endif // TEST_LAYER_FILTERING_TRANSPORT_H_