1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/media/mtransport/transportlayerice.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,62 @@ 1.4 +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* vim: set ts=2 et sw=2 tw=80: */ 1.6 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this file, 1.8 + * You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.9 + 1.10 +// Original author: ekr@rtfm.com 1.11 + 1.12 +// This is a wrapper around the nICEr ICE stack 1.13 +#ifndef transportlayerice_h__ 1.14 +#define transportlayerice_h__ 1.15 + 1.16 +#include <vector> 1.17 + 1.18 +#include "sigslot.h" 1.19 + 1.20 +#include "mozilla/RefPtr.h" 1.21 +#include "mozilla/Scoped.h" 1.22 +#include "nsCOMPtr.h" 1.23 +#include "nsIEventTarget.h" 1.24 +#include "nsITimer.h" 1.25 + 1.26 +#include "m_cpp_utils.h" 1.27 + 1.28 +#include "nricemediastream.h" 1.29 +#include "transportflow.h" 1.30 +#include "transportlayer.h" 1.31 + 1.32 +// An ICE transport layer -- corresponds to a single ICE 1.33 +namespace mozilla { 1.34 + 1.35 +class TransportLayerIce : public TransportLayer { 1.36 + public: 1.37 + TransportLayerIce(const std::string& name, 1.38 + RefPtr<NrIceCtx> ctx, 1.39 + RefPtr<NrIceMediaStream> stream, 1.40 + int component); 1.41 + virtual ~TransportLayerIce(); 1.42 + 1.43 + // Transport layer overrides. 1.44 + virtual TransportResult SendPacket(const unsigned char *data, size_t len); 1.45 + 1.46 + // Slots for ICE 1.47 + void IceCandidate(NrIceMediaStream *stream, const std::string&); 1.48 + void IceReady(NrIceMediaStream *stream); 1.49 + void IceFailed(NrIceMediaStream *stream); 1.50 + void IcePacketReceived(NrIceMediaStream *stream, int component, 1.51 + const unsigned char *data, int len); 1.52 + 1.53 + TRANSPORT_LAYER_ID("ice") 1.54 + 1.55 + private: 1.56 + DISALLOW_COPY_ASSIGN(TransportLayerIce); 1.57 + 1.58 + const std::string name_; 1.59 + RefPtr<NrIceCtx> ctx_; 1.60 + RefPtr<NrIceMediaStream> stream_; 1.61 + int component_; 1.62 +}; 1.63 + 1.64 +} // close namespace 1.65 +#endif