Interface VideoFormatPack
- All Superinterfaces:
FunctionPointer
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Functional interface declaration of the VideoFormatPack callback.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidrun(VideoFormatInfo info, Set<VideoPackFlags> flags, @Nullable MemorySegment src, int sstride, @Nullable MemorySegment data, MemorySegment stride, Set<VideoChromaSite> chromaSite, int y, int width) Packswidthpixels fromsrcto the given planes and strides in the formatinfo.The pixels from source have each component interleaved and will be packed into the planes indata.default MemorySegmenttoCallback(Arena arena) Creates a native function pointer to theupcall(MemorySegment, int, MemorySegment, int, MemorySegment, MemorySegment, int, int, int)method.default voidupcall(MemorySegment info, int flags, MemorySegment src, int sstride, MemorySegment data, MemorySegment stride, int chromaSite, int y, int width) Theupcallmethod is called from native code.
-
Method Details
-
run
void run(VideoFormatInfo info, Set<VideoPackFlags> flags, @Nullable MemorySegment src, int sstride, @Nullable MemorySegment data, MemorySegment stride, Set<VideoChromaSite> chromaSite, int y, int width) Packs
widthpixels fromsrcto the given planes and strides in the formatinfo.The pixels from source have each component interleaved and will be packed into the planes indata.This function operates on pack_lines lines, meaning that
srcshould contain at least pack_lines lines with a stride ofsstrideandyshould be a multiple of pack_lines.Subsampled formats will use the horizontally and vertically cosited component from the source. Subsampling should be performed before packing.
Because this function does not have a x coordinate, it is not possible to pack pixels starting from an unaligned position. For tiled images this means that packing should start from a tile coordinate. For subsampled formats this means that a complete pixel needs to be packed.
- Parameters:
info- aGstVideoFormatInfoflags- flags to control the packingsrc- a source arraysstride- the source array stridedata- pointers to the destination data planesstride- strides of the destination planeschromaSite- the chroma siting of the target when subsampled (not used)y- the y position in the image to pack towidth- the amount of pixels to pack.
-
upcall
default void upcall(MemorySegment info, int flags, MemorySegment src, int sstride, MemorySegment data, MemorySegment stride, int chromaSite, int y, int width) Theupcallmethod is called from native code. The parameters are marshaled andrun(VideoFormatInfo, Set, MemorySegment, int, MemorySegment, MemorySegment, Set, int, int)is executed. -
toCallback
Creates a native function pointer to theupcall(MemorySegment, int, MemorySegment, int, MemorySegment, MemorySegment, int, int, int)method.- Specified by:
toCallbackin interfaceFunctionPointer- Parameters:
arena- the arena in which the function pointer is allocated- Returns:
- the native function pointer
-