All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.nextbreakpoint.ffmpeg4java.AVCPBProperties Maven / Gradle / Ivy

The newest version!
// Generated by jextract

package com.nextbreakpoint.ffmpeg4java;

import java.lang.invoke.*;
import java.lang.foreign.*;
import java.nio.ByteOrder;
import java.util.*;
import java.util.function.*;
import java.util.stream.*;

import static java.lang.foreign.ValueLayout.*;
import static java.lang.foreign.MemoryLayout.PathElement.*;

/**
 * {@snippet lang=c :
 * struct AVCPBProperties {
 *     int64_t max_bitrate;
 *     int64_t min_bitrate;
 *     int64_t avg_bitrate;
 *     int64_t buffer_size;
 *     uint64_t vbv_delay;
 * }
 * }
 */
public class AVCPBProperties {

    AVCPBProperties() {
        // Should not be called directly
    }

    private static final GroupLayout $LAYOUT = MemoryLayout.structLayout(
        Libffmpeg.C_LONG_LONG.withName("max_bitrate"),
        Libffmpeg.C_LONG_LONG.withName("min_bitrate"),
        Libffmpeg.C_LONG_LONG.withName("avg_bitrate"),
        Libffmpeg.C_LONG_LONG.withName("buffer_size"),
        Libffmpeg.C_LONG_LONG.withName("vbv_delay")
    ).withName("AVCPBProperties");

    /**
     * The layout of this struct
     */
    public static final GroupLayout layout() {
        return $LAYOUT;
    }

    private static final OfLong max_bitrate$LAYOUT = (OfLong)$LAYOUT.select(groupElement("max_bitrate"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * int64_t max_bitrate
     * }
     */
    public static final OfLong max_bitrate$layout() {
        return max_bitrate$LAYOUT;
    }

    private static final long max_bitrate$OFFSET = 0;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * int64_t max_bitrate
     * }
     */
    public static final long max_bitrate$offset() {
        return max_bitrate$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * int64_t max_bitrate
     * }
     */
    public static long max_bitrate(MemorySegment struct) {
        return struct.get(max_bitrate$LAYOUT, max_bitrate$OFFSET);
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * int64_t max_bitrate
     * }
     */
    public static void max_bitrate(MemorySegment struct, long fieldValue) {
        struct.set(max_bitrate$LAYOUT, max_bitrate$OFFSET, fieldValue);
    }

    private static final OfLong min_bitrate$LAYOUT = (OfLong)$LAYOUT.select(groupElement("min_bitrate"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * int64_t min_bitrate
     * }
     */
    public static final OfLong min_bitrate$layout() {
        return min_bitrate$LAYOUT;
    }

    private static final long min_bitrate$OFFSET = 8;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * int64_t min_bitrate
     * }
     */
    public static final long min_bitrate$offset() {
        return min_bitrate$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * int64_t min_bitrate
     * }
     */
    public static long min_bitrate(MemorySegment struct) {
        return struct.get(min_bitrate$LAYOUT, min_bitrate$OFFSET);
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * int64_t min_bitrate
     * }
     */
    public static void min_bitrate(MemorySegment struct, long fieldValue) {
        struct.set(min_bitrate$LAYOUT, min_bitrate$OFFSET, fieldValue);
    }

    private static final OfLong avg_bitrate$LAYOUT = (OfLong)$LAYOUT.select(groupElement("avg_bitrate"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * int64_t avg_bitrate
     * }
     */
    public static final OfLong avg_bitrate$layout() {
        return avg_bitrate$LAYOUT;
    }

    private static final long avg_bitrate$OFFSET = 16;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * int64_t avg_bitrate
     * }
     */
    public static final long avg_bitrate$offset() {
        return avg_bitrate$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * int64_t avg_bitrate
     * }
     */
    public static long avg_bitrate(MemorySegment struct) {
        return struct.get(avg_bitrate$LAYOUT, avg_bitrate$OFFSET);
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * int64_t avg_bitrate
     * }
     */
    public static void avg_bitrate(MemorySegment struct, long fieldValue) {
        struct.set(avg_bitrate$LAYOUT, avg_bitrate$OFFSET, fieldValue);
    }

    private static final OfLong buffer_size$LAYOUT = (OfLong)$LAYOUT.select(groupElement("buffer_size"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * int64_t buffer_size
     * }
     */
    public static final OfLong buffer_size$layout() {
        return buffer_size$LAYOUT;
    }

    private static final long buffer_size$OFFSET = 24;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * int64_t buffer_size
     * }
     */
    public static final long buffer_size$offset() {
        return buffer_size$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * int64_t buffer_size
     * }
     */
    public static long buffer_size(MemorySegment struct) {
        return struct.get(buffer_size$LAYOUT, buffer_size$OFFSET);
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * int64_t buffer_size
     * }
     */
    public static void buffer_size(MemorySegment struct, long fieldValue) {
        struct.set(buffer_size$LAYOUT, buffer_size$OFFSET, fieldValue);
    }

    private static final OfLong vbv_delay$LAYOUT = (OfLong)$LAYOUT.select(groupElement("vbv_delay"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * uint64_t vbv_delay
     * }
     */
    public static final OfLong vbv_delay$layout() {
        return vbv_delay$LAYOUT;
    }

    private static final long vbv_delay$OFFSET = 32;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * uint64_t vbv_delay
     * }
     */
    public static final long vbv_delay$offset() {
        return vbv_delay$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * uint64_t vbv_delay
     * }
     */
    public static long vbv_delay(MemorySegment struct) {
        return struct.get(vbv_delay$LAYOUT, vbv_delay$OFFSET);
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * uint64_t vbv_delay
     * }
     */
    public static void vbv_delay(MemorySegment struct, long fieldValue) {
        struct.set(vbv_delay$LAYOUT, vbv_delay$OFFSET, fieldValue);
    }

    /**
     * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}.
     * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()}
     */
    public static MemorySegment asSlice(MemorySegment array, long index) {
        return array.asSlice(layout().byteSize() * index);
    }

    /**
     * The size (in bytes) of this struct
     */
    public static long sizeof() { return layout().byteSize(); }

    /**
     * Allocate a segment of size {@code layout().byteSize()} using {@code allocator}
     */
    public static MemorySegment allocate(SegmentAllocator allocator) {
        return allocator.allocate(layout());
    }

    /**
     * Allocate an array of size {@code elementCount} using {@code allocator}.
     * The returned segment has size {@code elementCount * layout().byteSize()}.
     */
    public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) {
        return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout()));
    }

    /**
     * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any).
     * The returned segment has size {@code layout().byteSize()}
     */
    public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) {
        return reinterpret(addr, 1, arena, cleanup);
    }

    /**
     * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any).
     * The returned segment has size {@code elementCount * layout().byteSize()}
     */
    public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) {
        return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup);
    }
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy