For debugging playback issues, it would be handy to have profiler markers when we skip to next keyframe. That would help identify the points where decode is struggling.
10:31:55 <cpearce> mstange: we should add profiler markers for when video playback drops frames... Can you suggest an example marker that we could look at figure out how to do this?
10:33:53 <mstange> cpearce: sure! do you want a duration marker ("frames were dropped between this timestamp and that timestamp") or an event marker ("frames were dropped at this point")?
10:34:39 <cpearce> mstange: probably just an event marker, as it's not really a long running task.
10:35:20 <mstange> cpearce: ok. do you want to put custom data into it, or is it just a string that's always the same?
10:36:15 <mstange> if the latter, you can just do #include "GeckoProfiler.h", PROFILER_ADD_MARKER("Video frames dropped", GRAPHICS);
10:36:48 <cpearce> mstange: it would potentially be useful to report the number of frames dropped, but it's not critical; when this happens, we skip the decode forward to the next keyframe, so it would be a variable number of frames... usually the number of frames skipped isn't interesting though, so a static string to start with should be fine.
10:37:14 <cpearce> mstange: ok, that sounds easy.
10:37:18 <mstange> cool
10:37:30 <cpearce> mstange: is it safe to call off main thread?
10:37:43 <mstange> yes, it's safe to call anywhere
10:37:50 <cpearce> Awesome. Easy as.
10:39:32 <mstange> if you want to put more information in it, one option is to use a text marker in combination with nsPrintfCString, here's an example: https://searchfox.org/mozilla-central/rev/b36e97fc776635655e84f2048ff59f38fa8a4626/dom/base/nsDOMNavigationTiming.cpp#485-497