Package limn.video

Interface VideoFrame.Downloader

Enclosing class:
VideoFrame
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public static interface VideoFrame.Downloader
How a producer reads one of its own device pictures back into memory a consumer can address, when VideoFrame.toPlanar() asks it to. A producer that only ever publishes planar samples never installs one.

An implementation moves the picture (av_hwframe_transfer_data, a staging copy, a mapped lock) and then points the frame's planes at the result through the VideoFrame.Writer it kept for this slot, ending with VideoFrame.Writer.downloaded(). It is called with the frame held, which is the one time a producer may re-point a published frame, and the flag that permits it is cleared as soon as this returns.

Called on whichever thread holds the frame (not necessarily the decode thread), so an implementation that reaches a decoder must take whatever lock that decoder is guarded by.

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Reads frame's device picture into memory and rebinds its planes.
  • Method Details

    • download

      void download(VideoFrame frame)
      Reads frame's device picture into memory and rebinds its planes.
      Parameters:
      frame - the held frame to fill; its VideoFrame.slot() identifies the picture to the side that owns it, exactly as VideoFrame.Recycler's does