<html tabindex="-1" style="-ms-scrollbar-base-color: rgb(0, 0, 0); -ms-scrollbar-face-color: rgb(240, 240, 240); -ms-scrollbar-3dlight-color: rgb(227, 227, 227); -ms-scrollbar-shadow-color: rgb(160, 160, 160); -ms-scrollbar-highlight-color: rgb(255, 255, 255); -ms-scrollbar-darkshadow-color: rgb(105, 105, 105); -ms-scrollbar-arrow-color: rgb(0, 0, 0);">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta http-equiv="X-UA-Compatible" content="IE=10">
<style id="owaParaStyle">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
P {margin-top:0;margin-bottom:0;}</style>
<meta name="GENERATOR" content="MSHTML 11.00.9600.17107">
</head>
<body tabindex="0" style="" dir="ltr" aria-label="Message body" fPStyle="1">
<div name="divtagdefaultwrapper" id="divtagdefaultwrapper" style="font-family: Calibri,Arial,Helvetica,sans-serif; font-size: 12pt; color: #000000; margin: 0">
<p class="owaPara">Problem:</p>
<p class="owaPara">I am working on a direct show filter, which can stream multiple types of video/audio streams. It works well, if I use only one instance. My basic test scenario is to stream a video and view it in VLC. But if I use 4 instances of the filter
 in same graph I have problems. If I try to open streams in my computer, I can open all four streams, but after a while strange things happen: streams stop to play and I loose my net connection for a while (after I kill my streaming test scenario, my network
 will be restored in 1 minute). If I try to open the streams on another computer, I can open only 1 or 2 in VLC, 3rd instance can't connect.
</p>
<p class="owaPara"> </p>
<p class="owaPara">The problem happens with more type of streams (H264, MJPEG), so it's not a stream type specific. I use different ports for each stream.
</p>
<p class="owaPara">My feeling was that the problem is in Groupsock object creation, because I used here I used the same port for Groupsock objects in each filter instance, but after I changed to different, it's still not ok. (I use 255 Ttl.) </p>
<p class="owaPara"> </p>
<p class="owaPara">//Groupsock:</p>
<p class="owaPara">struct in_addr destinationAddress = {0};<br>
destinationAddress.s_addr = chooseRandomIPv4SSMAddress(*m_pEnv);<br>
Groupsock* m_pRtcpGS = new Groupsock(*m_pEnv, destinationAddress, port, g_chTtl);<br>
m_pRtcpGS->multicastSendOnly();</p>
<p class="owaPara"> </p>
<p class="owaPara">//RTCPInstance:</p>
<p class="owaPara">gethostname((char*)szHostName, nMaxSize);</p>
<p class="owaPara">m_pRtcp = RTCPInstance::createNew(*m_pEnv, m_pRtcpGS, g_cnBandwidth, szHostName, m_pVideoSink, NULL, True);</p>
<p class="owaPara"> </p>
<p class="owaPara">//RTSPServer:</p>
<p class="owaPara">m_pRtspServer = RTSPServer::createNew(*m_pEnv, (Port)(m_nPort), m_pAuthDB);</p>
<p class="owaPara"> </p>
<p class="owaPara">//ServerMediaSession:</p>
<p class="owaPara">m_pSms = ServerMediaSession::createNew(*m_pEnv, crstrStreamPath.c_str(), "", crstrStreamDescription.c_str(), True /*SSM*/);</p>
<p class="owaPara"> </p>
<p class="owaPara">//RTPSink (for example MJPEG):</p>
<p class="owaPara">if (m_pRtpGS == NULL)<br>
{<br>
    m_pRtpGS = CreateGroupsock(port); // this port is different than the port is used for m_pRtcpGS<br>
}<br>
OutPacketBuffer::maxSize = g_cnBuffersize;<br>
m_pVideoSink = JPEGVideoRTPSink::createNew(*m_pEnv, m_pRtpGS);<br>
m_pVideoSource = NCRtspMJPEGFramedSource::createNew(*m_pEnv);<br>
m_pVideoSink->startPlaying(*m_pVideoSource, NULL, NULL);</p>
<p class="owaPara"> </p>
<p class="owaPara"> </p>
<p class="owaPara">Do you have ide which part can cause the problem, and how can I try to fix it?</p>
<p class="owaPara"> </p>
</div>
</body>
</html>