+ do not export discarded frame
+ assure that the exported frame is ours (otherwise the lifetime is
uncertain eg. if we decide to write the frame in thread)
For opaque codecs (H.264), the allocated size was actually smaller than
(maximal) data len set. That is usually not an issue, but when
destroying, the invalid maximum is exported (because PUTF_DISCARD with
unmodified frame). Steps to reproduce:
uv -t testcard:size=1280x128 -c libavcodec:codec=H.264 -d dump
Do not run the display worker in the main thread if not needed.
This would allow to run a custom mainloop (eg. from Syphon) while being able
to run a display that doesn't need to be run in the main thread.