pbos@webrtc.org | dc8c883 | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2013 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 | */ |
| 10 | #ifndef WEBRTC_VIDEO_ENGINE_TEST_COMMON_DIRECT_TRANSPORT_H_ |
| 11 | #define WEBRTC_VIDEO_ENGINE_TEST_COMMON_DIRECT_TRANSPORT_H_ |
| 12 | |
pbos@webrtc.org | 266d5f6 | 2013-05-29 11:34:32 +0000 | [diff] [blame^] | 13 | #include "webrtc/video_engine/new_include/transport.h" |
pbos@webrtc.org | dc8c883 | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 14 | |
| 15 | namespace webrtc { |
| 16 | namespace test { |
| 17 | |
| 18 | class DirectTransport : public newapi::Transport { |
| 19 | public: |
| 20 | explicit DirectTransport(newapi::PacketReceiver* receiver) |
| 21 | : receiver_(receiver) {} |
| 22 | |
| 23 | void SetReceiver(newapi::PacketReceiver* receiver) { receiver_ = receiver; } |
| 24 | |
| 25 | bool SendRTP(const void* data, size_t length) OVERRIDE { |
| 26 | return receiver_->DeliverPacket(data, length); |
| 27 | } |
| 28 | |
| 29 | bool SendRTCP(const void* data, size_t length) OVERRIDE { |
| 30 | return SendRTP(data, length); |
| 31 | } |
| 32 | |
| 33 | private: |
| 34 | newapi::PacketReceiver* receiver_; |
| 35 | }; |
| 36 | } // test |
| 37 | } // webrtc |
| 38 | |
| 39 | #endif // WEBRTC_VIDEO_ENGINE_TEST_COMMON_DIRECT_TRANSPORT_H_ |