Line data Source code
1 : /* This Source Code Form is subject to the terms of the Mozilla Public
2 : * License, v. 2.0. If a copy of the MPL was not distributed with this file,
3 : * You can obtain one at http://mozilla.org/MPL/2.0/. */
4 :
5 :
6 : #ifndef NULL_TRANSPORT_H_
7 : #define NULL_TRANSPORT_H_
8 :
9 : #include "mozilla/Attributes.h"
10 :
11 : #include "webrtc/api/call/transport.h"
12 :
13 : namespace mozilla {
14 :
15 : /**
16 : * NullTransport is registered as ExternalTransport to throw away data
17 : */
18 : class NullTransport : public webrtc::Transport
19 : {
20 : public:
21 0 : virtual bool SendRtp(const uint8_t* packet,
22 : size_t length,
23 : const webrtc::PacketOptions& options) override
24 : {
25 : (void) packet;
26 : (void) length;
27 : (void) options;
28 0 : return true;
29 : }
30 :
31 0 : virtual bool SendRtcp(const uint8_t* packet, size_t length) override
32 : {
33 : (void) packet;
34 : (void) length;
35 0 : return true;
36 : }
37 : #if 0
38 : virtual int SendPacket(int channel, const void *data, size_t len)
39 : {
40 : (void) channel; (void) data;
41 : return len;
42 : }
43 :
44 : virtual int SendRTCPPacket(int channel, const void *data, size_t len)
45 : {
46 : (void) channel; (void) data;
47 : return len;
48 : }
49 : #endif
50 0 : NullTransport() {}
51 :
52 0 : virtual ~NullTransport() {}
53 :
54 : private:
55 : NullTransport(const NullTransport& other) = delete;
56 : void operator=(const NullTransport& other) = delete;
57 : };
58 :
59 : } // end namespace
60 :
61 : #endif
|