blob: 5520153c517f9044f028d79ebc41b5b61f7b0003 [file] [log] [blame]
pbos@webrtc.orgdc8c8832013-05-16 12:08:03 +00001/*
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.org266d5f62013-05-29 11:34:32 +000013#include "webrtc/video_engine/new_include/transport.h"
pbos@webrtc.orgdc8c8832013-05-16 12:08:03 +000014
15namespace webrtc {
16namespace test {
17
18class 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_