Bumping gaia.json for 2 gaia revision(s) a=gaia-bump
[gecko.git] / media / mtransport / transportlayerice.h
blobbff30128082674596424b19a6c375b96ee2ec314
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 explicit TransportLayerIce(const std::string& name);
36 virtual ~TransportLayerIce();
38 void SetParameters(RefPtr<NrIceCtx> ctx,
39 RefPtr<NrIceMediaStream> stream,
40 int component);
42 // Transport layer overrides.
43 virtual TransportResult SendPacket(const unsigned char *data, size_t len);
45 // Slots for ICE
46 void IceCandidate(NrIceMediaStream *stream, const std::string&);
47 void IceReady(NrIceMediaStream *stream);
48 void IceFailed(NrIceMediaStream *stream);
49 void IcePacketReceived(NrIceMediaStream *stream, int component,
50 const unsigned char *data, int len);
52 TRANSPORT_LAYER_ID("ice")
54 private:
55 DISALLOW_COPY_ASSIGN(TransportLayerIce);
56 void PostSetup();
58 const std::string name_;
59 RefPtr<NrIceCtx> ctx_;
60 RefPtr<NrIceMediaStream> stream_;
61 int component_;
64 } // close namespace
65 #endif