Interface BufferFormatCallback
- All Known Implementing Classes:
BufferFormatCallbackAdapter
CallbackVideoSurface
when the format of the video changes.-
Method Summary
Modifier and TypeMethodDescriptionvoid
allocatedBuffers
(ByteBuffer[] buffers) Invoked when new video buffers have been allocated.getBufferFormat
(int sourceWidth, int sourceHeight) Returns aBufferFormat
instance specifying how theCallbackVideoSurface
should structure its internal buffers.void
newFormatSize
(int bufferWidth, int bufferHeight, int displayWidth, int displayHeight) Invoked when a new buffer format is set.
-
Method Details
-
getBufferFormat
Returns aBufferFormat
instance specifying how theCallbackVideoSurface
should structure its internal buffers.Note that it is possible that some versions of VLC provide the wrong value for the sourceHeight parameter, and more than that it might invoke this callback multiple times with different values for the sourceHeight. Your own callback implementation may need to mitigate this (e.g. by ignoring the sourceHeight changes on subsequent invocations of your callback).
This may be invoked multiple times by the native library.
- Parameters:
sourceWidth
- video widthsourceHeight
- video height- Returns:
- buffer format, must never be
null
-
newFormatSize
void newFormatSize(int bufferWidth, int bufferHeight, int displayWidth, int displayHeight) Invoked when a new buffer format is set.The sizes have not necessarily changed, but they are "new".
The buffer size and the display size are not necessarily the same. For example with 1080P video, it is common for the video buffer height value to be 1090 with a display height value of 1080.
This will be invoked immediately prior to
allocatedBuffers(ByteBuffer[])
.This may be invoked multiple times by the native library.
- Parameters:
bufferWidth
- video buffer widthbufferHeight
- video buffer widthdisplayWidth
- video display widthdisplayHeight
- video display height
-
allocatedBuffers
Invoked when new video buffers have been allocated.This may be invoked multiple times by the native library.
- Parameters:
buffers
- buffers that were allocated
-