michael@0: /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* vim: set ts=2 et sw=2 tw=80: */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this file, michael@0: * You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: // Original author: ekr@rtfm.com michael@0: michael@0: // This is a wrapper around the nICEr ICE stack michael@0: #ifndef transportlayerice_h__ michael@0: #define transportlayerice_h__ michael@0: michael@0: #include michael@0: michael@0: #include "sigslot.h" michael@0: michael@0: #include "mozilla/RefPtr.h" michael@0: #include "mozilla/Scoped.h" michael@0: #include "nsCOMPtr.h" michael@0: #include "nsIEventTarget.h" michael@0: #include "nsITimer.h" michael@0: michael@0: #include "m_cpp_utils.h" michael@0: michael@0: #include "nricemediastream.h" michael@0: #include "transportflow.h" michael@0: #include "transportlayer.h" michael@0: michael@0: // An ICE transport layer -- corresponds to a single ICE michael@0: namespace mozilla { michael@0: michael@0: class TransportLayerIce : public TransportLayer { michael@0: public: michael@0: TransportLayerIce(const std::string& name, michael@0: RefPtr ctx, michael@0: RefPtr stream, michael@0: int component); michael@0: virtual ~TransportLayerIce(); michael@0: michael@0: // Transport layer overrides. michael@0: virtual TransportResult SendPacket(const unsigned char *data, size_t len); michael@0: michael@0: // Slots for ICE michael@0: void IceCandidate(NrIceMediaStream *stream, const std::string&); michael@0: void IceReady(NrIceMediaStream *stream); michael@0: void IceFailed(NrIceMediaStream *stream); michael@0: void IcePacketReceived(NrIceMediaStream *stream, int component, michael@0: const unsigned char *data, int len); michael@0: michael@0: TRANSPORT_LAYER_ID("ice") michael@0: michael@0: private: michael@0: DISALLOW_COPY_ASSIGN(TransportLayerIce); michael@0: michael@0: const std::string name_; michael@0: RefPtr ctx_; michael@0: RefPtr stream_; michael@0: int component_; michael@0: }; michael@0: michael@0: } // close namespace michael@0: #endif