<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
>I use Live555 to stream H.264 from the embedded borad and find a bug:<br>
><br>
>for my borad, user could change video's resolution, at beginning<br>
>user recive H.264 from the borad , it plays well, but if user<br>
>disconnect then reconnect with different resolution, client player<br>
>does not decode frames correctly because SPS and PPS are not the<br>
>same as previous caused by fSPLines is not NULL (see below code) and<br>
>media field of SDP doesn't be set again.<br>
<br>
Unfortunately, for most servers, the current behavior - setting up<br>
"fSDPLines" only once, when the first client connects - will be the<br>
desired behavior, because (for most servers) the stream's SDP<br>
parameters will not change from client to client. Also, in some<br>
cases, it might be costly to figure out the SDP parameters (e.g., it<br>
might involve doing some reading/parsing of the input source), so we<br>
would not want to generate these more than once. Therefore the<br>
current default behavior should remain.<br>
<br>
What you can do, however, is reimplement the "sdpLines()" virtual<br>
function in your "OnDemandServerMediaSubsession" subclass, as follows:<br>
<br>
char const* yourSubclass::sdpLines() {<br>
delete[] fSDPLines; fSDPLines = NULL;<br>
<br>
return OnDemandServerMediaSubsession::sdpLines();<br>
}<br>
</blockquote><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Alternatively, you could just add<br>
delete[] fSDPLines; fSDPLines = NULL;<br>
to your implementation of the "createNewRTPSink()" virtual function.<br>
<br></blockquote><div><br>For my need, I add a virtual const char* sdpLines(FramedSource*
inputSource) = 0 to SeverMediaSession.cpp and reimplament
myServerMediaSubsession<br><br>const char*<br>myServerMediaSubsession::sdpLines(FramedSource* inputSource)<br>{<br> if (fSDPLines != NULL)<br> {<br> delete[] fSDPLines;<br> fSDPLines = NULL;<br> }<br>
<br> if (fSDPLines == NULL)<br> {<br> ...... <br> ......<br> RTPSink* dummyRTPSink<br> = createNewRTPSink(&dummyGroupsock, rtpPayloadType, inputSource);<br> <br> setSDPLinesFromRTPSink(dummyRTPSink, inputSource);<br>
Medium::close(dummyRTPSink);<br> }<br> return fSDPLines;<br>}<br><br><br><br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
For either of these solutions to work, the definition of "fSDPLines"<br>
in "liveMedia/include/OnDemandServerMediaSubsession.hh" will need to<br>
be changed from "private" to protected". (I'll make this change in<br>
the next release of the software.)<br>
</blockquote><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I'm curious, though. You talk about the user "reconnect(ing) with a<br>
different resolution". How are you doing this in the RTSP protocol?<br>
Because you must be creating your "H264VideoRTPSink" with a different<br>
"sprop_parameter_sets_str" parameter each time (in order for its SDP<br>
description to change), you must be making the<br>
"sprop_parameter_sets_str" parameter be somehow dependent upon the<br>
client-desired resolution. How are you doing this?<br></blockquote><div><br> I add a H264VideoStreamFramer member (fStreamSource) into RTSPCilentSession, my H264VideoStreamFramer creates a thread to read stream from the board and write to FIFO. when server accept clinet's first request(DESCRIBE or OPTIONS), RTSPCilentSession checks if FIFO has data and make the "sprop_parameter_sets_str"<br>
<br> envir().taskScheduler().turnOnBackgroundReadHandling(fStreamSource->getClientReadPipe(),<br> (TaskScheduler::BackgroundHandlerProc*)&incomingSPSAndPPSHandler, this);<br>
</div><div><br>If it gets "sprop_parameter_sets_str", it will process commands continuously otherwise RTSPCilentSession will terminate because of time out.<br><br><br>orbit.<br><br><br><br><br><br></div></div>