Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(487)

Side by Side Diff: webrtc/test/layer_filtering_transport.h

Issue 2997393002: Move rtp dump writer from quality test to test transport (Closed)
Patch Set: Dump RTP packets after fake network, not before Created 3 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <map>
14 #include <memory>
15
13 #include "webrtc/call/call.h" 16 #include "webrtc/call/call.h"
14 #include "webrtc/test/direct_transport.h" 17 #include "webrtc/test/direct_transport.h"
15 #include "webrtc/test/fake_network_pipe.h" 18 #include "webrtc/test/fake_network_pipe.h"
16 #include "webrtc/test/single_threaded_task_queue.h" 19 #include "webrtc/test/single_threaded_task_queue.h"
17 20
18 #include <map>
19
20 namespace webrtc { 21 namespace webrtc {
21 22
22 namespace test { 23 namespace test {
23 24
24 class LayerFilteringTransport : public test::DirectTransport { 25 class RtpFileWriter;
26
27 class LayerFilteringTransport : public test::DirectTransport,
28 private PacketReceiver {
25 public: 29 public:
26 LayerFilteringTransport(SingleThreadedTaskQueueForTesting* task_queue, 30 LayerFilteringTransport(SingleThreadedTaskQueueForTesting* task_queue,
27 const FakeNetworkPipe::Config& config, 31 const FakeNetworkPipe::Config& config,
28 Call* send_call, 32 Call* send_call,
29 uint8_t vp8_video_payload_type, 33 uint8_t vp8_video_payload_type,
30 uint8_t vp9_video_payload_type, 34 uint8_t vp9_video_payload_type,
31 int selected_tl, 35 int selected_tl,
32 int selected_sl, 36 int selected_sl,
33 const std::map<uint8_t, MediaType>& payload_type_map); 37 const std::map<uint8_t, MediaType>& payload_type_map,
38 std::unique_ptr<test::RtpFileWriter> rtp_file_writer);
34 bool DiscardedLastPacket() const; 39 bool DiscardedLastPacket() const;
35 bool SendRtp(const uint8_t* data, 40 bool SendRtp(const uint8_t* data,
36 size_t length, 41 size_t length,
37 const PacketOptions& options) override; 42 const PacketOptions& options) override;
43 void SetReceiver(PacketReceiver* receiver) override;
38 44
39 private: 45 private:
46 DeliveryStatus DeliverPacket(MediaType media_type,
47 const uint8_t* packet,
48 size_t length,
49 const PacketTime& packet_time) override;
50
40 // Used to distinguish between VP8 and VP9. 51 // Used to distinguish between VP8 and VP9.
41 const uint8_t vp8_video_payload_type_; 52 const uint8_t vp8_video_payload_type_;
42 const uint8_t vp9_video_payload_type_; 53 const uint8_t vp9_video_payload_type_;
43 // Discard or invalidate all temporal/spatial layers with id greater than the 54 // Discard or invalidate all temporal/spatial layers with id greater than the
44 // selected one. -1 to disable filtering. 55 // selected one. -1 to disable filtering.
45 const int selected_tl_; 56 const int selected_tl_;
46 const int selected_sl_; 57 const int selected_sl_;
47 bool discarded_last_packet_; 58 bool discarded_last_packet_;
59
60 PacketReceiver* receiver_;
61 const int64_t start_ms_;
62 std::unique_ptr<test::RtpFileWriter> rtp_file_writer_;
48 }; 63 };
49 64
50 } // namespace test 65 } // namespace test
51 } // namespace webrtc 66 } // namespace webrtc
52 67
53 #endif // WEBRTC_TEST_LAYER_FILTERING_TRANSPORT_H_ 68 #endif // WEBRTC_TEST_LAYER_FILTERING_TRANSPORT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698