<div dir="ltr"><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div>The key point I was trying to make is that the media player needs to be able to predict when frames will be displayed.<br>
</div><br>All its prediction calculations will be based on a fixed scanout rate.<br></div>If the scanout rate changes, all bets are off, and we have to start again from scratch trying to predict the scanouts again.<br></div>
So, with regards to the scanout rate changing, we will need an event to tell us that so we can redo the prediction calculations.<br><br></div>So, if the scanouts are T=100 and then T=200, we would have to have somehow predicted that, and as a result set the<br>
buffer1, T=100 <br></div>buffer2, T=200<br></div>or in actual fact, to allow for inaccuracy the media player would set:<br></div>buffer1, T = 80<br></div>buffer2, T = 180<br></div>This will then ensure that buffer1 would be displayed at T=100, and buffer2 would be displayed at T=200.<br>
<br></div>But we would only know to set T=80 for buffer1 if we had been able to predict when the actual frame will be.<br></div>So, I guess I am still asking for an API that would return these predicted values from the graphics driver.<br>
<br></div><div>Also, If buffer2 has T=200. What is the 200 being compared to in order to decide to display the buffer or not?<br></div><div>This will not be the timestamp on the presentation callback will it?<br></div><div>
<br></div>There is also the matter of clock sync. Is T=100 referenced to the system monotonic clock or some other clock.<br></div>Video and Audio sync is not achieved by comparing Video and Audio time stamps.<br></div>You have a global system monotonic clock, and sync Video to the system clock, and sync Audio to the system clock.<br>
</div>A good side effect of this is that Audio and Video are then in sync.<br></div>The advantage of this syncing to the system monotonic clock is that you can then run Video and Audio in separate thread, different CPUs, whenever, but they will always be in sync.<br>
<br></div>Kind Regards<br><br></div>James<br><br></div>