CSharpRTMP.Core.Protocols.Rtmp.BaseRTMPAppProtocolHandler.TryLinkToFileStream C# (CSharp) Method

TryLinkToFileStream() private method

private TryLinkToFileStream ( BaseRTMPProtocol pFrom, uint streamId, Variant metadata, string streamName, double startTime, double length, bool &linked ) : bool
pFrom BaseRTMPProtocol
streamId uint
metadata Variant
streamName string
startTime double
length double
linked bool
return bool
        private bool TryLinkToFileStream(BaseRTMPProtocol pFrom, uint streamId, Variant metadata, string streamName, double startTime, double length, out bool linked)
        {
            linked = false;
            //1. Try to create the in file streams
            InFileRTMPStream pRTMPInFileStream = pFrom.CreateIFS(metadata);
            if (pRTMPInFileStream == null)
            {
                Logger.WARN("No file streams found: {0}", streamName);
                return true;
            }
            //2. Try to create the out net stream
            BaseOutNetRTMPStream pBaseOutNetRTMPStream = pFrom.CreateONS(
                    streamId, streamName, pRTMPInFileStream.Type);
            if (pBaseOutNetRTMPStream == null)
            {
                Logger.FATAL("Unable to create network outbound stream");
                return false;
            }
            //3. Link them
            if (!pRTMPInFileStream.Link(pBaseOutNetRTMPStream))
            {
                Logger.FATAL("Link failed");
                return false;
            }
            //4. Register it to the signaled streams
   
            //pFrom.SignalONS(pBaseOutNetRTMPStream);
            //5. Fire up the play routine
            if (!pRTMPInFileStream.Play(startTime, length))
            {
                Logger.FATAL("Unable to start the playback");
                return false;
            }

            //6. Done
            linked = true;
            return true;
        }