QUIC at Snapchat
eng.snap.com
eng.snap.com
This could have made sense back when Android imaging situation was more of a mess, but the current API obviates the need for this.
That said they should have just implemented both solutions and let the user pick.
Plus what with people not being able to zoom in, what's the problem?
I'm pretty sure I can answer that question (because using a camera as a camera gets you a better picture, because some other phones that will view your photo will have higher resolution, etc), but I do appreciate a clever hack. I'd love to know the actual reasoning behind this. Maybe there was some weird permissions issue between displaying what the camera sees and "taking photos" that affected some users at some point?
My bet is on that it's simply faster to take a screenshot of the viewfinder of the camera than using the camera to take a photo. Open up the camera already has some delay, taking photos introduces more delay before you get the actual bytes to do the processing. Taking a screenshot tends to be instant though, so in order to take photos the fastest, you can take a screenshot of the viewport.
Although this wouldn't work for videos, which I'm sure they are using the actual camera to do, instead of taking ~25/30 screenshots per second.
A simple user believes he is sharing a screen resolution image and there's no hidden details in it.
This is why when you start recording a video on Snapchat, there's a delay before the recording starts, and usually also a short delay before audio recording starts (especially noticeable if you have audio playing from your phone at the same time)
I'm not sure about this, but I think I remember Snapchat even having implemented actual photo taking and being frustrated about it. Of course a reasonable compromise would be letting users choose, but it seems like that's just not trendy enough.
Any app which just uses the android camera API doesn't have access to this stuff - and usually ends up with very poor quality images as a result. On my phone, apps that use the android API can't adjust focus at all, which makes even things like a barcode scanning app useless. Things that say "please take a photo of your ID card in this box" are unusable!
Having said that, the Camera subsystem is most certainly subpar on Android. It is crash prone, only recovering after a full system reset, which makes developing anything novel a giant pain in the ass. It also is full of random bullshit even if you're using Google's anointed, in-house devices. I remember an update suddenly randomly yielding frame rate capability values multiplied by 1000, chaos monkey style. Code ends up being littered with "If this bullshit device on this bullshit version, then...". It's a gigantic waste of time.
And then as Google started trying to differentiate their own devices with exclusive imaging features, things really started going off the rails.
You might disagree with how they weigh speed vs quality, but I assure you they take it very seriously.
So that means, that high-end phones aren't that fast after all? (Because what is high-end actually? Price, performance, both?)
Maybe latency, opening the camera? Or getting image itself?
I know its not the case, but when HTTP2 was being developed it felt like they were only thinking about users with strong wifi and zero packet loss. My company had a number of reps at the W3C, whenever I raised concerns with them I was told that I was being an old sysadmin, and that tcp doesn't work the way I think it does. They were convinced that multiplexing down a single TCP pipe was better than having a pool of connections.
They were also convinced that the average size of webpages wasn't going to grow, despite lots of evidence to the contrary.
I'm still not entirely convinced that quic is the way forward either. However I haven't spent enough time looking at it to form a proper opinion.
Every implementation (maybe not Google's?) is just a poorly designed TCP stack, where most of the code is just copy/pasted out of Linux or FreeBSD, and everything learned in those OSes about building resilient TCP stacks is just forgotten only to be rediscovered again.
Not to mention that it's just a huge, huge pain to debug because you can't telnet or openssl s_client to a port and type out some HTTP. And Wireshark is basically useless even when you have your SSL keys saved.
Here's a table of a bunch of QUIC implementations and their compatibility with other QUIC implementations:
I mean... why? A lot of smart people are involved here so... there has to be a good reason? I'm not sure a couple of % is worth it.
If it helps at all, the C++ surface wraps a C core [1], which supports QUIC via an opt-in Cronet dependency [2][3].
If you wanted to roll your own messaging framework, you'd probably want to build on top of at least Cronet, if not gRPC core.
[1]: The pure C core: https://github.com/grpc/grpc/tree/master/src/core
[2]: A visualization of the stacks: https://grpc.io/blog/grpc-stacks/
[3]: https://github.com/grpc/grpc/tree/master/src/core/ext/transp...
[1] https://github.com/grpc/grpc/pull/24737#discussion_r52257262...
Thank you for leaving this comment.