cocool97 / adb_client

Rust ADB (Android Debug Bridge) client library
MIT License
144 stars 23 forks source link

`adb_client`: Make the image output of `framebuffer` available somehow without saving to disk #47

Open NutchapolSal opened 1 week ago

NutchapolSal commented 1 week ago

(in the same spirit of changing shell()) I think ADBServerDevice.framebuffer() should return RgbaImage directly, so if some code needs to use the image right after, they wouldn't have to re-read the image from disk, or they can choose to save the image later. My personal project have been using framebuffer_inner() by compiling with a locally modified copy of your code (adding a single pub keyword), and everything seems to be fine.

This would probably require moving a little bit of stuff into adb_cli Renaming or changing ADBServerDevice.framebuffer()'s outputs would be a breaking change, so maybe deprecate that one and make a new public method?

cocool97 commented 1 week ago

This should definitely be the case, I'll have a deeper look at it this week. Crate is evolving nowadays, I'm not against breaking changes. We can also add a framebuffer_bytes() method to prevent breaking. I'll consider it