<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/video/livestream/v1/outputs.proto

namespace Google\Cloud\Video\LiveStream\V1;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * Segment settings for `fmp4` and `ts`.
 *
 * Generated from protobuf message <code>google.cloud.video.livestream.v1.SegmentSettings</code>
 */
class SegmentSettings extends \Google\Protobuf\Internal\Message
{
    /**
     * Duration of the segments in seconds. The default is `6s`. Note that
     * `segmentDuration` must be greater than or equal to
     * [gop_duration][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.gop_duration], and
     * `segmentDuration` must be divisible by
     * [gop_duration][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.gop_duration].
     * Valid range is [2s, 20s].
     * All [mux_streams][google.cloud.video.livestream.v1.Manifest.mux_streams] in the same manifest must have the
     * same segment duration.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration segment_duration = 1;</code>
     */
    private $segment_duration = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Protobuf\Duration $segment_duration
     *           Duration of the segments in seconds. The default is `6s`. Note that
     *           `segmentDuration` must be greater than or equal to
     *           [gop_duration][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.gop_duration], and
     *           `segmentDuration` must be divisible by
     *           [gop_duration][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.gop_duration].
     *           Valid range is [2s, 20s].
     *           All [mux_streams][google.cloud.video.livestream.v1.Manifest.mux_streams] in the same manifest must have the
     *           same segment duration.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Video\Livestream\V1\Outputs::initOnce();
        parent::__construct($data);
    }

    /**
     * Duration of the segments in seconds. The default is `6s`. Note that
     * `segmentDuration` must be greater than or equal to
     * [gop_duration][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.gop_duration], and
     * `segmentDuration` must be divisible by
     * [gop_duration][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.gop_duration].
     * Valid range is [2s, 20s].
     * All [mux_streams][google.cloud.video.livestream.v1.Manifest.mux_streams] in the same manifest must have the
     * same segment duration.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration segment_duration = 1;</code>
     * @return \Google\Protobuf\Duration|null
     */
    public function getSegmentDuration()
    {
        return $this->segment_duration;
    }

    public function hasSegmentDuration()
    {
        return isset($this->segment_duration);
    }

    public function clearSegmentDuration()
    {
        unset($this->segment_duration);
    }

    /**
     * Duration of the segments in seconds. The default is `6s`. Note that
     * `segmentDuration` must be greater than or equal to
     * [gop_duration][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.gop_duration], and
     * `segmentDuration` must be divisible by
     * [gop_duration][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.gop_duration].
     * Valid range is [2s, 20s].
     * All [mux_streams][google.cloud.video.livestream.v1.Manifest.mux_streams] in the same manifest must have the
     * same segment duration.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration segment_duration = 1;</code>
     * @param \Google\Protobuf\Duration $var
     * @return $this
     */
    public function setSegmentDuration($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class);
        $this->segment_duration = $var;

        return $this;
    }

}

