RomaMokych / cxx-courses-2019-03-macos-streamer

coruses project
0 stars 0 forks source link

Not working on real iOS device (iPhone 8) #2

Closed TeaBoyy closed 5 years ago

TeaBoyy commented 5 years ago

Yesterday, on the 5 April, we tested SimpleDesktopStream on iPhone 8. Input from iOS successfuly reaches the server and the mouse on Mac is moving, but there is no image of Mac's desktop on iOS screen. Possible issue's source(-s) : 1) Network. Maybe iOS just can't receive so much data at once, or something else is wrong. In addition, we've worked with Wi-Fi instead of localhost. 2) Image processing and rendering. Received data may be not correctly converted, or ImageView doesn't accept converted image at all.

Screen grabbing procces isn't the issue's source just because it doesn't depend on anything related to the client.

TeaBoyy commented 5 years ago

The problem was in the receiving algorithm - it was too simple and it relied on fast network, and worked well only when data always arrieved in expected chunks and never bigger that that chunk size. In Wi-Fi network there are latency, and iPhone got too much data because while iPhone is slowly reading, Mac OS continues sending data relatively fast, and iPhone's buffer is fulling very quickly. So algorithm just dropped frames, those cant fit in the expected-size buffer, instead of manipulating on them