janesma / apitrace

for developing frame trace features
24 stars 16 forks source link

Parse and display frame count #7

Open ghost opened 8 years ago

ghost commented 8 years ago

I'm trying to show the number of available frames after the trace file has been selected, so that users don't need to use other tools or just trial and error.

Is there a faster way to count the number of available frames? It takes a few seconds for larger traces. Also, should the frame count calculation be in a utility function or a different class?

janesma commented 8 years ago

You are right that the lack of frame previews is annoying for the user. It would be great to have a way to see a screen thumbnail rather than guess at a frame number.

Unfortunately, scanning the frame file at the open file dialog is not a good idea. Your patch is currently doing this in the UI thread, which makes the UI unresponsive (gnome asks if I want to kill it).

At a minimum, we'd want to cache this information. I have some caching written, so the host doesn't have to re-send the file to the target for each remote debug session. A similar approach could be used to cache metadata about the files (eg framecount, framebuffer thumbnails).

Apitrace has dump-images, perhaps the open dialog could have a frame-selector which, when visible, allows the user to generate thumbnails, and subsequently select using a slider that iterates the thumbnails.