/// <summary> /// Mark message as being written. /// </summary> /// <param name="packet">The RTMP packet</param> protected virtual void WritingMessage(RtmpPacket packet) { if (packet.Message is VideoData) { int streamId = packet.Header.StreamId; AtomicInteger value = new AtomicInteger(); AtomicInteger old = _pendingVideos.AddIfAbsent(streamId, value) as AtomicInteger; if (old == null) old = value; old.Increment(); } }
public StreamingAmfEndpoint(MessageBroker messageBroker, ChannelDefinition channelDefinition) : base(messageBroker, channelDefinition) { _streamingClientsCount = new AtomicInteger(); }
internal RtmpConnection(IRtmpHandler handler, RtmpMode mode, string path, IDictionary parameters) : base(path, parameters) { _handler = handler; _channels = new CopyOnWriteDictionary<int, RtmpChannel>(4); _streams = new CopyOnWriteDictionary<int, IClientStream>(); _pendingVideos = new CopyOnWriteDictionary<int, AtomicInteger>(); _streamCount = new AtomicInteger(); _streamBuffers = new CopyOnWriteDictionary<int, int>(); _reservedStreams = new BitArray(0); _pendingCalls = new CopyOnWriteDictionary<int, IServiceCall>(); // We start with an anonymous connection without a scope. // These parameters will be set during the call of "connect" later. _context = new RtmpContext(mode); //Transaction id depends on server/client mode //When server mode is set we cannot push messages with transaction id = 1 (connect) _invokeId = mode == RtmpMode.Server ? new AtomicInteger(1) : new AtomicInteger(0); }
public AMFEndpoint(MessageBroker messageBroker, ChannelDefinition channelDefinition) : base(messageBroker, channelDefinition) { _waitingPollRequests = new AtomicInteger(); }