SDL Updating Texture issues |
madprogrammer24
|
Any updates on this?
|
|||||||||||
|
MrTAToad
|
Can you make the project (code + executable) available for download ?
|
|||||||||||
|
madprogrammer24
|
Client:
https://www.dropbox.com/s/ttk46srhfjxrzld/MadLink_client.zip?dl=0 Server: https://www.dropbox.com/s/n4m29b4rkc44u7e/Debug.zip?dl=0 I have made my client available, you will need both if you plan on running the client successfully. The exe is all that is available for the server. I will post the code for it if it needed, but everything should be coming down correctly. These projects are built on Windows and use PGM for communication. If you have any issues running the code, please let me know. Again, I appreciate any assistance given. |
|||||||||||
|
SDL Updating Texture issues |
Gabriele Greco
Guest
|
1 - Replace SDL_WaitEvent() with a while (SDL_PollEvent(...))2 - You cannot wait 40msec (SDL_Delay(40) in the end of the display code), also if u wanna go 25fps, you should give network and decoder time to work, so you should adapt the period you wait to the time you took to receive and display frame.
On Sun, Jun 14, 2015 at 10:56 PM, madprogrammer24 wrote:
-- Ing. Gabriele Greco, DARTS Engineering Tel: +39-0100980150 Â Fax: +39-0100980184 s-mail: Piazza Della Vittoria 9/3 - 16121 GENOVA (ITALY) |
|||||||||||||
|
madprogrammer24
|
I am not entirely sure how to adapt it? Do you mean by adding some SDL timers around my network and decoder code then change my delay accordingly? |
|||||||||||||
|
SDL Updating Texture issues |
Gabriele Greco
Guest
|
If u wanna go 25fps you can for instance:
1 get the timestamp when you decode the first frame, and sum to it 40msec. 2 receive data from network and decode the frame 3 before displaying the next frame wait for the difference between the current timestamp and your stored one. 4 after displaying the frame sum 40msec to your stored timestamp 5 go to 2 This will give you 25fps on capable enough hardware, if you have slow network or hardware that is just enough to decode the stream you'll have better performance splitting the network handling, the decoding process and the frame display in different threads, but this will need some extra care to call the SDL functions only from the right thread. On Mon, Jun 15, 2015 at 3:32 PM, madprogrammer24 wrote:
-- Ing. Gabriele Greco, DARTS Engineering Tel: +39-0100980150 Â Fax: +39-0100980184 s-mail: Piazza Della Vittoria 9/3 - 16121 GENOVA (ITALY) |
|||||||||||||
|
madprogrammer24
|
Okay, I tried using the techniques described in the previous post and from one of the tutorials at Lazy Foo. Namely, this one: http://lazyfoo.net/tutorials/SDL/22_timing/index.php
I am still not seeing the screen refresh at all. Could this be caused by me using the same system for the server and client? I am just doing that for testing purposes. I will probably download the source for the Lazy Foo tutorial and mess with it, so I can understand what is going on better.
|
|||||||||||||
|
MrTAToad
|
Would be worth checking to see if SDL_UpdateYUVTexture fails
|
|||||||||||
|
madprogrammer24
|
I thought about that and put that into my code, after my latest post. It wasn't failing, kind of wish it was... it would at least give me something different to look at. |
|||||||||||||
|
madprogrammer24
|
I figured out my problem, and I thought I should update this issue for anybody else who has something similar. My issue was I didn't loop around my av_parser_parse2() call as the documentation instructed. Once I did that, I was able to receive all data that was parsed and my screen started updating correctly. I appreciate everybody's help on helping me solve this issue.
Now on to making my stream more stable and improve latency.. woohoo! Parsing loop below:
|
|||||||||||||
|