public override void SignalOutStreamAttached(IOutStream pOutStream) { if (_videoCodecInit.Length > 0 && !pOutStream.FeedData(_videoCodecInit, (uint)_videoCodecInit.Length, 0, (uint)_videoCodecInit.Length, _lastVideoTime, false)) { this.Log().Info("Unable to feed OS: {0}", pOutStream.UniqueId); pOutStream.EnqueueForDelete(); } if (_audioCodecInit.Length > 0 && !pOutStream.FeedData(_audioCodecInit, (uint)_audioCodecInit.Length, 0, (uint)_audioCodecInit.Length, _lastAudioTime, true)) { this.Log().Info("Unable to feed OS: {0}", pOutStream.UniqueId); pOutStream.EnqueueForDelete(); } //if (_lastStreamMessage != null &&pOutStream.Type.TagKindOf(StreamTypes.ST_OUT_NET_RTMP)) //{ // (pOutStream as IOutNetStream).SendStreamMessage(_lastStreamMessage.Value.Body, _lastStreamMessage.Value.MessageLength); //} base.SignalOutStreamAttached(pOutStream); }
//public override bool IsCompatibleWithType(ulong type) //{ // return type.TagKindOf(StreamTypes.ST_OUT_NET_RTMP_4_RTMP) // || type.TagKindOf(StreamTypes.ST_OUT_NET_RTMFP) // || type.TagKindOf(StreamTypes.ST_OUT_FILE_RTMP) // || type.TagKindOf(StreamTypes.ST_OUT_NET_RTP) // || type.TagKindOf(StreamTypes.ST_OUT_FILE_HLS); //} public override void SignalOutStreamAttached(IOutStream pOutStream) { if (VideoCodecBuffer.Length > 0 && !pOutStream.FeedData(VideoCodecBuffer, (uint)VideoCodecBuffer.Length, 0, (uint)VideoCodecBuffer.Length, _lastVideoTime, false)) { this.Log().Info("Unable to feed OS: {0}", pOutStream.UniqueId); pOutStream.EnqueueForDelete(); } if (AudioCodecBuffer.Length > 0 && !pOutStream.FeedData(AudioCodecBuffer, (uint)AudioCodecBuffer.Length, 0, (uint)AudioCodecBuffer.Length, _lastAudioTime, false)) { this.Log().Info("Unable to feed OS: {0}", pOutStream.UniqueId); pOutStream.EnqueueForDelete(); } //if (_lastStreamMessage != null // && pOutStream.Type.TagKindOf(StreamTypes.ST_OUT_NET_RTMP) // && !(pOutStream as BaseOutNetRTMPStream).SendStreamMessage(_lastStreamMessage)) //{ // Logger.FATAL("Unable to send notify on stream. The connection will go down"); // pOutStream.EnqueueForDelete(); //} base.SignalOutStreamAttached(pOutStream); }