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

com.github.alexeylapin.m3u8.model.Variant Maven / Gradle / Ivy

package com.github.alexeylapin.m3u8.model;

import org.immutables.value.Value;

import java.util.List;
import java.util.Optional;

/**
 * Variant Stream (EXT-X-STREAM-INF)
 *
 * @see 
 * RFC 8216 - 4.3.4.2.  EXT-X-STREAM-INF
 */
@Value.Immutable
public interface Variant {
    /**
     * The value is a decimal-integer of bits per second.  It represents the peak segment
     * bit rate of the Variant Stream.
     *
     * @return variant attribute BANDWIDTH
     */
    long bandwidth();

    /**
     * The value is a decimal-integer of bits per second.  It represents the average segment
     * bit rate of the Variant Stream.
     *
     * @return variant attribute AVERAGE-BANDWIDTH
     */
    Optional averageBandwidth();

    /**
     * @return variant attribute SCORE
     */
    Optional score();

    /**
     * @return variant attribute CODECS
     */
    List codecs();

    /**
     * @return variant attribute RESOLUTION
     */
    Optional resolution();

    /**
     * @return variant attribute FRAME-RATE
     */
    Optional frameRate();

    /**
     * @return variant attribute HDCP-LEVEL
     */
    Optional hdcpLevel();

    /**
     * @return variant attribute ALLOWED-CPC
     */
    List allowedCpc();

    /**
     * @return variant attribute STABLE-VARIANT-ID
     */
    Optional stableVariantId();

    /**
     * @return variant attribute AUDIO
     */
    Optional audio();

    /**
     * @return variant attribute VIDEO
     */
    Optional video();

    /**
     * @return variant attribute SUBTITLES
     */
    Optional subtitles();

    /**
     * @return variant attribute CLOSED-CAPTIONS
     */
    Optional closedCaptions();

    /**
     * @return Set to true to get CLOSED-CAPTIONS=NONE
     */
    Optional closedCaptionsNone();

    /**
     * @return URI to the media playlist
     */
    String uri();

    /**
     * @return variant attribute PROGRAM-ID
     */
    Optional programId();

    /**
     * @return variant attribute VIDEO-RANGE
     */
    Optional videoRange();

    /**
     * @return variant attribute PATHWAY-ID
     */
    Optional pathwayId();

    static Builder builder() {
        return new Builder();
    }

    class Builder extends VariantBuilder {
        public Builder resolution(int width, int height) {
            return resolution(Resolution.of(width, height));
        }
        
        public Builder videoRange(String value) {
            return videoRange(VideoRange.valueOf(value));
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy