Class AVFrame


  • public class AVFrame
    extends Object
    Represents a pointer to a native FFmpeg AVFrame object.
    Author:
    Lyubomir Marinov
    • Constructor Summary

      Constructors 
      Constructor Description
      AVFrame()
      Initializes a new FinalizableAVFrame instance which is to allocate a new native FFmpeg AVFrame and represent it.
      AVFrame​(long ptr)
      Initializes a new AVFrame instance which is to represent a specific pointer to a native FFmpeg AVFrame object.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int avpicture_fill​(ByteBuffer data, AVFrameFormat format)  
      protected void finalize()
      Deallocates the native memory/FFmpeg AVFrame object represented by this instance if this instance has allocated it upon initialization and it has not been deallocated yet i.e.
      void free()
      Deallocates the native memory/FFmpeg AVFrame object represented by this instance if this instance has allocated it upon initialization and it has not been deallocated yet.
      ByteBuffer getData()
      Gets the ByteBuffer whose native memory is set on the native counterpart of this instance/AVFrame.
      long getPtr()
      Gets the pointer to the native FFmpeg AVFrame object represented by this instance.
      static int read​(javax.media.Buffer buffer, javax.media.Format format, ByteBuffer data)  
    • Constructor Detail

      • AVFrame

        public AVFrame()
        Initializes a new FinalizableAVFrame instance which is to allocate a new native FFmpeg AVFrame and represent it.
      • AVFrame

        public AVFrame​(long ptr)
        Initializes a new AVFrame instance which is to represent a specific pointer to a native FFmpeg AVFrame object. Because the native memory/AVFrame has been allocated outside the new instance, the new instance does not automatically free it upon finalization.
        Parameters:
        ptr - the pointer to the native FFmpeg AVFrame object to be represented by the new instance
    • Method Detail

      • read

        public static int read​(javax.media.Buffer buffer,
                               javax.media.Format format,
                               ByteBuffer data)
      • finalize

        protected void finalize()
                         throws Throwable
        Deallocates the native memory/FFmpeg AVFrame object represented by this instance if this instance has allocated it upon initialization and it has not been deallocated yet i.e. ensures that free() is invoked on this instance.
        Overrides:
        finalize in class Object
        Throws:
        Throwable
        See Also:
        Object.finalize()
      • free

        public void free()
        Deallocates the native memory/FFmpeg AVFrame object represented by this instance if this instance has allocated it upon initialization and it has not been deallocated yet.
      • getData

        public ByteBuffer getData()
        Gets the ByteBuffer whose native memory is set on the native counterpart of this instance/AVFrame.
        Returns:
        the ByteBuffer whose native memory is set on the native counterpart of this instance/AVFrame.
      • getPtr

        public long getPtr()
        Gets the pointer to the native FFmpeg AVFrame object represented by this instance.
        Returns:
        the pointer to the native FFmpeg AVFrame object represented by this instance