private IInNetStream GetInboundStream(string streamName)
{
//1. get all the inbound network streams which begins with streamName
var streams = Application.StreamsManager.FindByTypeByName(StreamTypes.ST_IN_NET, streamName, true,
Application.AllowDuplicateInboundNetworkStreams);
if (streams.Count == 0)
return null;
//2. Get the fisrt value and see if it is compatible
var pResult = streams.First().Value;
if (!pResult.IsCompatibleWithType(StreamTypes.ST_OUT_NET_RTP))
{
FATAL("The stream {0} is not compatible with stream type {1}",
(streamName), StreamTypes.ST_OUT_NET_RTP.TagToString());
return null;
}
//2. Done
return (IInNetStream) pResult;
}