/// <summary>
        /// Send the chunk size.
        /// </summary>
        private void SendChunkSize()
        {
#if !SILVERLIGHT
            if(log.IsDebugEnabled )
                log.Debug(string.Format("Sending chunk size: {0}", _chunkSize));
#endif
            ChunkSize chunkSizeMsg = new ChunkSize(_chunkSize);
            _connection.GetChannel((byte)2).Write(chunkSizeMsg);
            _chunkSizeSent = true;
        }    
示例#2
0
/*
FlexInvoke flexInvoke = new FlexInvoke();
flexInvoke.Cmd = "onstatus";
flexInvoke.DataType = DataType.TypeUnknown;
StatusASO statusASO = StatusASO.GetStatusObject(StatusASO.NC_CONNECT_CLOSED, connection.ObjectEncoding);
flexInvoke.Parameters = new object[]{ statusASO };
RtmpChannel channel = connection.GetChannel(3);
channel.Write(flexInvoke);
*/


        protected override void OnChunkSize(RtmpConnection connection, RtmpChannel channel, RtmpHeader source, ChunkSize chunkSize) 
        {
            if (connection is IStreamCapableConnection)
            {
                IStreamCapableConnection streamCapableConnection = connection as IStreamCapableConnection;
                {
                    foreach (IClientStream stream in streamCapableConnection.GetStreams())
                    {
                        if (stream is IClientBroadcastStream)
                        {
                            IClientBroadcastStream bs = stream as IClientBroadcastStream;
                            IBroadcastScope scope = bs.Scope.GetBasicScope(Constants.BroadcastScopeType, bs.PublishedName) as IBroadcastScope;
                            if (scope == null)
                                continue;

                            OOBControlMessage setChunkSize = new OOBControlMessage();
                            setChunkSize.Target = "ClientBroadcastStream";
                            setChunkSize.ServiceName = "chunkSize";
                            setChunkSize.ServiceParameterMap.Add("chunkSize", chunkSize.Size);
                            scope.SendOOBControlMessage((IConsumer)null, setChunkSize);
                            if (log.IsDebugEnabled)
                            {
                                log.Debug("Sending chunksize " + chunkSize + " to " + bs.Provider);
                            }
                        }
                    }
                }
            }
        }
        static ByteBuffer EncodeChunkSize(RtmpContext context, ChunkSize chunkSize) 
		{
			ByteBuffer output = ByteBuffer.Allocate(4);
			output.PutInt(chunkSize.Size);
			return output;
		}
示例#4
0
 /// <summary>
 /// This method supports the Fluorine infrastructure and is not intended to be used directly from your code.
 /// </summary>
 /// <param name="connection"></param>
 /// <param name="channel"></param>
 /// <param name="source"></param>
 /// <param name="chunkSize"></param>
 protected abstract void OnChunkSize(RtmpConnection connection, RtmpChannel channel, RtmpHeader source, ChunkSize chunkSize);