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

com.nextbreakpoint.ffmpeg4java.AVStreamGroup 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 AVStreamGroup {
 *     AVClass *av_class;
 *     void *priv_data;
 *     unsigned int index;
 *     int64_t id;
 *     enum AVStreamGroupParamsType type;
 *     union {
 *         struct AVIAMFAudioElement *iamf_audio_element;
 *         struct AVIAMFMixPresentation *iamf_mix_presentation;
 *         struct AVStreamGroupTileGrid *tile_grid;
 *     } params;
 *     AVDictionary *metadata;
 *     unsigned int nb_streams;
 *     AVStream **streams;
 *     int disposition;
 * }
 * }
 */
public class AVStreamGroup {

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

    private static final GroupLayout $LAYOUT = MemoryLayout.structLayout(
        Libffmpeg.C_POINTER.withName("av_class"),
        Libffmpeg.C_POINTER.withName("priv_data"),
        Libffmpeg.C_INT.withName("index"),
        MemoryLayout.paddingLayout(4),
        Libffmpeg.C_LONG_LONG.withName("id"),
        Libffmpeg.C_INT.withName("type"),
        MemoryLayout.paddingLayout(4),
        AVStreamGroup.params.layout().withName("params"),
        Libffmpeg.C_POINTER.withName("metadata"),
        Libffmpeg.C_INT.withName("nb_streams"),
        MemoryLayout.paddingLayout(4),
        Libffmpeg.C_POINTER.withName("streams"),
        Libffmpeg.C_INT.withName("disposition"),
        MemoryLayout.paddingLayout(4)
    ).withName("AVStreamGroup");

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

    private static final AddressLayout av_class$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("av_class"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * AVClass *av_class
     * }
     */
    public static final AddressLayout av_class$layout() {
        return av_class$LAYOUT;
    }

    private static final long av_class$OFFSET = 0;

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

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

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

    private static final AddressLayout priv_data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("priv_data"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * void *priv_data
     * }
     */
    public static final AddressLayout priv_data$layout() {
        return priv_data$LAYOUT;
    }

    private static final long priv_data$OFFSET = 8;

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

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

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

    private static final OfInt index$LAYOUT = (OfInt)$LAYOUT.select(groupElement("index"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * unsigned int index
     * }
     */
    public static final OfInt index$layout() {
        return index$LAYOUT;
    }

    private static final long index$OFFSET = 16;

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

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

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

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

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

    private static final long id$OFFSET = 24;

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

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

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

    private static final OfInt type$LAYOUT = (OfInt)$LAYOUT.select(groupElement("type"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * enum AVStreamGroupParamsType type
     * }
     */
    public static final OfInt type$layout() {
        return type$LAYOUT;
    }

    private static final long type$OFFSET = 32;

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

    /**
     * Getter for field:
     * {@snippet lang=c :
     * enum AVStreamGroupParamsType type
     * }
     */
    public static int type(MemorySegment struct) {
        return struct.get(type$LAYOUT, type$OFFSET);
    }

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

    /**
     * {@snippet lang=c :
     * union {
     *     struct AVIAMFAudioElement *iamf_audio_element;
     *     struct AVIAMFMixPresentation *iamf_mix_presentation;
     *     struct AVStreamGroupTileGrid *tile_grid;
     * }
     * }
     */
    public static class params {

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

        private static final GroupLayout $LAYOUT = MemoryLayout.unionLayout(
            Libffmpeg.C_POINTER.withName("iamf_audio_element"),
            Libffmpeg.C_POINTER.withName("iamf_mix_presentation"),
            Libffmpeg.C_POINTER.withName("tile_grid")
        ).withName("$anon$1124:5");

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

        private static final AddressLayout iamf_audio_element$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("iamf_audio_element"));

        /**
         * Layout for field:
         * {@snippet lang=c :
         * struct AVIAMFAudioElement *iamf_audio_element
         * }
         */
        public static final AddressLayout iamf_audio_element$layout() {
            return iamf_audio_element$LAYOUT;
        }

        private static final long iamf_audio_element$OFFSET = 0;

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

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

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

        private static final AddressLayout iamf_mix_presentation$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("iamf_mix_presentation"));

        /**
         * Layout for field:
         * {@snippet lang=c :
         * struct AVIAMFMixPresentation *iamf_mix_presentation
         * }
         */
        public static final AddressLayout iamf_mix_presentation$layout() {
            return iamf_mix_presentation$LAYOUT;
        }

        private static final long iamf_mix_presentation$OFFSET = 0;

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

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

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

        private static final AddressLayout tile_grid$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("tile_grid"));

        /**
         * Layout for field:
         * {@snippet lang=c :
         * struct AVStreamGroupTileGrid *tile_grid
         * }
         */
        public static final AddressLayout tile_grid$layout() {
            return tile_grid$LAYOUT;
        }

        private static final long tile_grid$OFFSET = 0;

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

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

        /**
         * Setter for field:
         * {@snippet lang=c :
         * struct AVStreamGroupTileGrid *tile_grid
         * }
         */
        public static void tile_grid(MemorySegment union, MemorySegment fieldValue) {
            union.set(tile_grid$LAYOUT, tile_grid$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 union
         */
        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);
        }
    }

    private static final GroupLayout params$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("params"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * union {
     *     struct AVIAMFAudioElement *iamf_audio_element;
     *     struct AVIAMFMixPresentation *iamf_mix_presentation;
     *     struct AVStreamGroupTileGrid *tile_grid;
     * } params
     * }
     */
    public static final GroupLayout params$layout() {
        return params$LAYOUT;
    }

    private static final long params$OFFSET = 40;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * union {
     *     struct AVIAMFAudioElement *iamf_audio_element;
     *     struct AVIAMFMixPresentation *iamf_mix_presentation;
     *     struct AVStreamGroupTileGrid *tile_grid;
     * } params
     * }
     */
    public static final long params$offset() {
        return params$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * union {
     *     struct AVIAMFAudioElement *iamf_audio_element;
     *     struct AVIAMFMixPresentation *iamf_mix_presentation;
     *     struct AVStreamGroupTileGrid *tile_grid;
     * } params
     * }
     */
    public static MemorySegment params(MemorySegment struct) {
        return struct.asSlice(params$OFFSET, params$LAYOUT.byteSize());
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * union {
     *     struct AVIAMFAudioElement *iamf_audio_element;
     *     struct AVIAMFMixPresentation *iamf_mix_presentation;
     *     struct AVStreamGroupTileGrid *tile_grid;
     * } params
     * }
     */
    public static void params(MemorySegment struct, MemorySegment fieldValue) {
        MemorySegment.copy(fieldValue, 0L, struct, params$OFFSET, params$LAYOUT.byteSize());
    }

    private static final AddressLayout metadata$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("metadata"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * AVDictionary *metadata
     * }
     */
    public static final AddressLayout metadata$layout() {
        return metadata$LAYOUT;
    }

    private static final long metadata$OFFSET = 48;

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

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

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

    private static final OfInt nb_streams$LAYOUT = (OfInt)$LAYOUT.select(groupElement("nb_streams"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * unsigned int nb_streams
     * }
     */
    public static final OfInt nb_streams$layout() {
        return nb_streams$LAYOUT;
    }

    private static final long nb_streams$OFFSET = 56;

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

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

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

    private static final AddressLayout streams$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("streams"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * AVStream **streams
     * }
     */
    public static final AddressLayout streams$layout() {
        return streams$LAYOUT;
    }

    private static final long streams$OFFSET = 64;

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

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

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

    private static final OfInt disposition$LAYOUT = (OfInt)$LAYOUT.select(groupElement("disposition"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * int disposition
     * }
     */
    public static final OfInt disposition$layout() {
        return disposition$LAYOUT;
    }

    private static final long disposition$OFFSET = 72;

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

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

    /**
     * Setter for field:
     * {@snippet lang=c :
     * int disposition
     * }
     */
    public static void disposition(MemorySegment struct, int fieldValue) {
        struct.set(disposition$LAYOUT, disposition$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