Home | History | Annotate | Download | only in fakes
      1 /*
      2  *  Copyright (c) 2012 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 VOICE_ENGINE_MAIN_TEST_AUTO_TEST_FAKES_FAKE_EXTERNAL_TRANSPORT_H_
     11 #define VOICE_ENGINE_MAIN_TEST_AUTO_TEST_FAKES_FAKE_EXTERNAL_TRANSPORT_H_
     12 
     13 #include "webrtc/common_types.h"
     14 
     15 namespace webrtc {
     16 class CriticalSectionWrapper;
     17 class EventWrapper;
     18 class ThreadWrapper;
     19 class VoENetwork;
     20 }
     21 
     22 class FakeExternalTransport : public webrtc::Transport {
     23  public:
     24   explicit FakeExternalTransport(webrtc::VoENetwork* ptr);
     25   virtual ~FakeExternalTransport();
     26   int SendPacket(int channel, const void *data, int len);
     27   int SendRTCPPacket(int channel, const void *data, int len);
     28   void SetDelayStatus(bool enabled, unsigned int delayInMs = 100);
     29 
     30   webrtc::VoENetwork* my_network_;
     31  private:
     32   static bool Run(void* ptr);
     33   bool Process();
     34  private:
     35   webrtc::ThreadWrapper* thread_;
     36   webrtc::CriticalSectionWrapper* lock_;
     37   webrtc::EventWrapper* event_;
     38  private:
     39   unsigned char packet_buffer_[1612];
     40   int length_;
     41   int channel_;
     42   bool delay_is_enabled_;
     43   int delay_time_in_ms_;
     44 };
     45 
     46 #endif  // VOICE_ENGINE_MAIN_TEST_AUTO_TEST_FAKES_FAKE_EXTERNAL_TRANSPORT_H_
     47