media/mtransport/transportlayerice.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     2 /* vim: set ts=2 et sw=2 tw=80: */
     3 /* This Source Code Form is subject to the terms of the Mozilla Public
     4  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
     5  * You can obtain one at http://mozilla.org/MPL/2.0/. */
     7 // Original author: ekr@rtfm.com
     9 // This is a wrapper around the nICEr ICE stack
    10 #ifndef transportlayerice_h__
    11 #define transportlayerice_h__
    13 #include <vector>
    15 #include "sigslot.h"
    17 #include "mozilla/RefPtr.h"
    18 #include "mozilla/Scoped.h"
    19 #include "nsCOMPtr.h"
    20 #include "nsIEventTarget.h"
    21 #include "nsITimer.h"
    23 #include "m_cpp_utils.h"
    25 #include "nricemediastream.h"
    26 #include "transportflow.h"
    27 #include "transportlayer.h"
    29 // An ICE transport layer -- corresponds to a single ICE
    30 namespace mozilla {
    32 class TransportLayerIce : public TransportLayer {
    33  public:
    34   TransportLayerIce(const std::string& name,
    35                     RefPtr<NrIceCtx> ctx,
    36                     RefPtr<NrIceMediaStream> stream,
    37                     int component);
    38   virtual ~TransportLayerIce();
    40   // Transport layer overrides.
    41   virtual TransportResult SendPacket(const unsigned char *data, size_t len);
    43   // Slots for ICE
    44   void IceCandidate(NrIceMediaStream *stream, const std::string&);
    45   void IceReady(NrIceMediaStream *stream);
    46   void IceFailed(NrIceMediaStream *stream);
    47   void IcePacketReceived(NrIceMediaStream *stream, int component,
    48                          const unsigned char *data, int len);
    50   TRANSPORT_LAYER_ID("ice")
    52  private:
    53   DISALLOW_COPY_ASSIGN(TransportLayerIce);
    55   const std::string name_;
    56   RefPtr<NrIceCtx> ctx_;
    57   RefPtr<NrIceMediaStream> stream_;
    58   int component_;
    59 };
    61 }  // close namespace
    62 #endif

mercurial