Open cafecai opened 5 years ago
while(1)
{
string RtspUri(pstVdecSend->cFileName);
Client.SetURI(RtspUri);
Client.DoDESCRIBE();
Client.ParseSDP();
Client.DoSETUP("video", true);
//Client.SetVideoByeFromServerClbk(ByeFromServerClbk);
printf("start PLAY\n");
//printf("SDP: %s\n", Client.GetSDP().c_str());
Client.DoPLAY("video");
int i=0,j=0;
while(1)
{
if(!Client.GetMediaData("video", pbuf, &size, BufSize))
{
sleep(1);
if(j++==5)
{
j=0;
break;
}
continue;
}
if(size>0)
{
play_frame()
}
if(pstVdecSend->bSettingsChanged||pstVdecSend->eCtrlSinal==VDEC_CTRL_STOP)
{
pstVdecSend->bSettingsChanged=HI_FALSE;
break;
}
/
if(ByeFromServerFlag) {
break;
}
/
}
Client.DoTEARDOWN();
if(pstVdecSend->eCtrlSinal==VDEC_CTRL_STOP)
break;
}
Use a new RtspClient
I see, thank you! So how do I detect that the server has been disconnected? Is there an interface to check the connection?
ByeFromServerClbk will be called when the server disconnected
When the rtsp server is restarted and disconnected, the socket is interrupted. The following prompt appears. When I try to reconnect in the program, the program exits. How can I solve the problem and avoid the program exiting, but I can reconnect to the rtsp server.
Adding destination Deleting destination No RTP data : Error sending over socket 25, removing destination No RTP data No RTP data No RTP data No RTP data No RTP data