media/webrtc/signaling/src/common/NullTransport.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/media/webrtc/signaling/src/common/NullTransport.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,44 @@
     1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this file,
     1.6 + * You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.7 +
     1.8 +
     1.9 +#ifndef NULL_TRANSPORT_H_
    1.10 +#define NULL_TRANSPORT_H_
    1.11 +
    1.12 +#include "mozilla/Attributes.h"
    1.13 +
    1.14 +#include "webrtc/common_types.h"
    1.15 +
    1.16 +namespace mozilla {
    1.17 +
    1.18 +/**
    1.19 + * NullTransport is registered as ExternalTransport to throw away data
    1.20 + */
    1.21 +class NullTransport : public webrtc::Transport
    1.22 +{
    1.23 +public:
    1.24 +  virtual int SendPacket(int channel, const void *data, int len)
    1.25 +  {
    1.26 +    (void) channel; (void) data;
    1.27 +    return len;
    1.28 +  }
    1.29 +
    1.30 +  virtual int SendRTCPPacket(int channel, const void *data, int len)
    1.31 +  {
    1.32 +    (void) channel; (void) data;
    1.33 +    return len;
    1.34 +  }
    1.35 +
    1.36 +  NullTransport() {}
    1.37 +
    1.38 +  virtual ~NullTransport() {}
    1.39 +
    1.40 +private:
    1.41 +  NullTransport(const NullTransport& other) MOZ_DELETE;
    1.42 +  void operator=(const NullTransport& other) MOZ_DELETE;
    1.43 +};
    1.44 +
    1.45 +} // end namespace
    1.46 +
    1.47 +#endif

mercurial