public override void RegisterProtocol(BaseProtocol protocol)
{
//1. Is this a client RTSP protocol?
if (protocol.Type != ProtocolTypes.PT_RTSP) return;
if (protocol.CustomParameters["isClient"] == null || !protocol.CustomParameters["isClient"])return;
if (protocol.CustomParameters["forceTcp"] != null)
{
if (protocol.CustomParameters["forceTcp"] != VariantType.Boolean)
{
FATAL("Invalid forceTcp flag detected");
protocol.EnqueueForDelete();
return;
}
}
else
{
protocol.CustomParameters["forceTcp"] = false;
}
//可能用不到了
//var rtsp = protocol as RtspProtocol;
//if ((parameters.HasKeyChain(V_MAP, true, 2, "customParameters", "externalStreamConfig"))
//|| (parameters.HasKeyChain(V_MAP, true, 2, "customParameters", "localStreamConfig")))
//{
// //5. Start play
// if (!TriggerPlayOrAnnounce(pRTSPProtocol))
// {
// FATAL("Unable to initiate play on uri %s",
// (parameters["uri"]));
// pRTSPProtocol.EnqueueForDelete();
// return;
// }
//}
//else
//{
// WARN("Bogus connection. Terminate it");
// pProtocol.EnqueueForDelete();
//}
}