johnboiles / coremediaio-dal-minimal-example

Intended to be the most minimalistic example of a macOS CoreMediaIO DAL plugin.
MIT License
212 stars 31 forks source link

Fill frame in background thread #8

Closed seanchas116 closed 4 years ago

seanchas116 commented 4 years ago

I made Stream.fillFrame run in a background thread, using dispatch_source. It fixes CMIOMinimalSample may be laggy and not show frames in Google Chrome.

(This is a backport from SimpleDALPlugin.)

johnboiles commented 4 years ago

Neat I like it!

Probably the way to make timing the most consistent would be to set a presentation time stamp that's perfectly 1/30th of a second after the last time stamp. But depending on how this code ends up getting used, the video source may already provide the right time stamp so probably not worrying about in this codebase.