<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link="#0563C1" vlink="#954F72"><div class=WordSection1><p class=MsoNormal>Hello!<o:p></o:p></p><p class=MsoNormal>Thank you very much for this project!<o:p></o:p></p><p class=MsoNormal>Please help me to understand how I can retrieve the <span style='background:yellow;mso-highlight:yellow'>Frame Width, Frame Height and Frame Type (I or P frame).</span><o:p></o:p></p><p class=MsoNormal>My code example is based on testRTSPClient.cpp<o:p></o:p></p><p class=MsoNormal>I am in the function <span style='font-size:9.5pt;font-family:Consolas;color:#2B91AF;background:white;mso-highlight:white'>DummySink</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>::afterGettingFrame</span><o:p></o:p></p><p class=MsoNormal><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>fSubsession.videoWidth() and fSubsession.videoHeight()</span><span style='font-size:9.5pt;font-family:Consolas;color:black'> always return 0.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:9.5pt;font-family:Consolas;color:black'>All other parameters works fine.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:9.5pt;font-family:Consolas;color:black'>I have h264 video.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:9.5pt;font-family:Consolas;color:black'>Please help!<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:9.5pt;font-family:Consolas;color:black'>Thank you!</span><o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white'>void</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'> </span><span style='font-size:9.5pt;font-family:Consolas;color:#2B91AF;background:white;mso-highlight:white'>DummySink</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>::afterGettingFrame(</span><span style='font-size:9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white'>unsigned</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'> </span><span style='font-size:9.5pt;font-family:Consolas;color:gray;background:white;mso-highlight:white'>frameSize</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>, </span><span style='font-size:9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white'>unsigned</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'> </span><span style='font-size:9.5pt;font-family:Consolas;color:gray;background:white;mso-highlight:white'>numTruncatedBytes</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>, </span><span style='font-size:9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white'>struct</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'> </span><span style='font-size:9.5pt;font-family:Consolas;color:#2B91AF;background:white;mso-highlight:white'>timeval</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'> </span><span style='font-size:9.5pt;font-family:Consolas;color:gray;background:white;mso-highlight:white'>presentationTime</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>, </span><span style='font-size:9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white'>unsigned</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'> </span><span style='font-size:9.5pt;font-family:Consolas;color:green;background:white;mso-highlight:white'>/*durationInMicroseconds*/</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>{<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>       </span><span style='font-size:9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white'>if</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'> (mAudioVideoIn != </span><span style='font-size:9.5pt;font-family:Consolas;color:#6F008A;background:white;mso-highlight:white'>NULL</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>       {<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>              </span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:yellow;mso-highlight:yellow'>mAudioVideoIn->OnFrameReceived(fStreamId, fSubsession.mediumName(), fSubsession.codecName(), fReceiveBuffer, </span><span style='font-size:9.5pt;font-family:Consolas;color:gray;background:yellow;mso-highlight:yellow'>frameSize</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:yellow;mso-highlight:yellow'>, fSubsession.videoWidth(), fSubsession.videoHeight(), 0);</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>       }<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>       </span><span style='font-size:9.5pt;font-family:Consolas;color:green;background:white;mso-highlight:white'>// We've just received a frame of data.  (Optionally) print out information about it:</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white'>#ifdef</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'> </span><span style='font-size:9.5pt;font-family:Consolas;color:#6F008A;background:white;mso-highlight:white'>DEBUG_PRINT_EACH_RECEIVED_FRAME</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>       </span><span style='font-size:9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white'>if</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'> (fStreamId != </span><span style='font-size:9.5pt;font-family:Consolas;color:#6F008A;background:white;mso-highlight:white'>NULL</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>) envir() << </span><span style='font-size:9.5pt;font-family:Consolas;color:#A31515;background:white;mso-highlight:white'>"Stream \""</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'> << fStreamId << </span><span style='font-size:9.5pt;font-family:Consolas;color:#A31515;background:white;mso-highlight:white'>"\"; "</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>       envir() << fSubsession.mediumName() << </span><span style='font-size:9.5pt;font-family:Consolas;color:#A31515;background:white;mso-highlight:white'>"/"</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'> << fSubsession.codecName() << </span><span style='font-size:9.5pt;font-family:Consolas;color:#A31515;background:white;mso-highlight:white'>":\tReceived "</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'> << </span><span style='font-size:9.5pt;font-family:Consolas;color:gray;background:white;mso-highlight:white'>frameSize</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'> << </span><span style='font-size:9.5pt;font-family:Consolas;color:#A31515;background:white;mso-highlight:white'>" bytes"</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>       </span><span style='font-size:9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white'>if</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'> (</span><span style='font-size:9.5pt;font-family:Consolas;color:gray;background:white;mso-highlight:white'>numTruncatedBytes</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'> > 0) envir() << </span><span style='font-size:9.5pt;font-family:Consolas;color:#A31515;background:white;mso-highlight:white'>" (with "</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'> << </span><span style='font-size:9.5pt;font-family:Consolas;color:gray;background:white;mso-highlight:white'>numTruncatedBytes</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'> << </span><span style='font-size:9.5pt;font-family:Consolas;color:#A31515;background:white;mso-highlight:white'>" bytes truncated)"</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>       </span><span style='font-size:9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white'>char</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'> uSecsStr[6 + 1]; </span><span style='font-size:9.5pt;font-family:Consolas;color:green;background:white;mso-highlight:white'>// used to output the 'microseconds' part of the presentation time</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>       sprintf(uSecsStr, </span><span style='font-size:9.5pt;font-family:Consolas;color:#A31515;background:white;mso-highlight:white'>"%06u"</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>, (</span><span style='font-size:9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white'>unsigned</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>)</span><span style='font-size:9.5pt;font-family:Consolas;color:gray;background:white;mso-highlight:white'>presentationTime</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>.tv_usec);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>       envir() << </span><span style='font-size:9.5pt;font-family:Consolas;color:#A31515;background:white;mso-highlight:white'>".\tPresentation time: "</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'> << (</span><span style='font-size:9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white'>int</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>)</span><span style='font-size:9.5pt;font-family:Consolas;color:gray;background:white;mso-highlight:white'>presentationTime</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>.tv_sec << </span><span style='font-size:9.5pt;font-family:Consolas;color:#A31515;background:white;mso-highlight:white'>"."</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'> << uSecsStr;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>       </span><span style='font-size:9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white'>if</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'> (fSubsession.rtpSource() != </span><span style='font-size:9.5pt;font-family:Consolas;color:#6F008A;background:white;mso-highlight:white'>NULL</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'> && !fSubsession.rtpSource()->hasBeenSynchronizedUsingRTCP())<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>       {<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>              envir() << </span><span style='font-size:9.5pt;font-family:Consolas;color:#A31515;background:white;mso-highlight:white'>"!"</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>; </span><span style='font-size:9.5pt;font-family:Consolas;color:green;background:white;mso-highlight:white'>// mark the debugging output to indicate that this presentation time is not RTCP-synchronized</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>       }<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white'>#ifdef</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'> DEBUG_PRINT_NPT<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>       envir() << </span><span style='font-size:9.5pt;font-family:Consolas;color:#A31515;background:white;mso-highlight:white'>"\tNPT: "</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'> << fSubsession.getNormalPlayTime(presentationTime);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white'>#endif</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>       envir() << </span><span style='font-size:9.5pt;font-family:Consolas;color:#A31515;background:white;mso-highlight:white'>"\n"</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white'>#endif</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>       </span><span style='font-size:9.5pt;font-family:Consolas;color:green;background:white;mso-highlight:white'>// Then continue, to request the next frame of data:</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>       continuePlaying();<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white'>}</span><o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>