Package tvi.webrtc

Class NV12Buffer

    • Constructor Summary

      Constructors 
      Constructor Description
      NV12Buffer​(int width, int height, int stride, int sliceHeight, java.nio.ByteBuffer buffer, java.lang.Runnable releaseCallback)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      VideoFrame.Buffer cropAndScale​(int cropX, int cropY, int cropWidth, int cropHeight, int scaleWidth, int scaleHeight)
      Crops a region defined by |cropx|, |cropY|, |cropWidth| and |cropHeight|.
      int getHeight()  
      int getWidth()
      Resolution of the buffer in pixels.
      void release()
      Decreases ref count by one.
      void retain()
      Increases ref count by one.
      VideoFrame.I420Buffer toI420()
      Returns a memory-backed frame in I420 format.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • NV12Buffer

        public NV12Buffer​(int width,
                          int height,
                          int stride,
                          int sliceHeight,
                          java.nio.ByteBuffer buffer,
                          @Nullable
                          java.lang.Runnable releaseCallback)
    • Method Detail

      • toI420

        public VideoFrame.I420Buffer toI420()
        Description copied from interface: VideoFrame.Buffer
        Returns a memory-backed frame in I420 format. If the pixel data is in another format, a conversion will take place. All implementations must provide a fallback to I420 for compatibility with e.g. the internal WebRTC software encoders.
        Specified by:
        toI420 in interface VideoFrame.Buffer
      • release

        public void release()
        Description copied from interface: RefCounted
        Decreases ref count by one. When the ref count reaches zero, resources related to the object will be freed.
        Specified by:
        release in interface RefCounted
        Specified by:
        release in interface VideoFrame.Buffer
      • cropAndScale

        public VideoFrame.Buffer cropAndScale​(int cropX,
                                              int cropY,
                                              int cropWidth,
                                              int cropHeight,
                                              int scaleWidth,
                                              int scaleHeight)
        Description copied from interface: VideoFrame.Buffer
        Crops a region defined by |cropx|, |cropY|, |cropWidth| and |cropHeight|. Scales it to size |scaleWidth| x |scaleHeight|.
        Specified by:
        cropAndScale in interface VideoFrame.Buffer