<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# NO CHECKED-IN PROTOBUF GENCODE
# source: livekit_egress.proto

namespace Livekit;

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

/**
 * Capture tracks directly from a room via SDK.
 * Unifies deprecated Participant, TrackComposite, and Track egress.
 *
 * Generated from protobuf message <code>livekit.MediaSource</code>
 */
class MediaSource extends \Google\Protobuf\Internal\Message
{
    /**
     * Generated from protobuf field <code>.livekit.AudioConfig audio = 3;</code>
     */
    protected $audio = null;
    /**
     * Generated from protobuf field <code>.livekit.DataConfig data = 4;</code>
     */
    protected $data = null;
    protected $video;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $video_track_id
     *     @type \Livekit\ParticipantVideo $participant_video
     *     @type \Livekit\AudioConfig $audio
     *     @type \Livekit\DataConfig $data
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\LivekitEgress::initOnce();
        parent::__construct($data);
    }

    /**
     * Generated from protobuf field <code>string video_track_id = 1 [(.logger.name) = "videoTrackID"];</code>
     * @return string
     */
    public function getVideoTrackId()
    {
        return $this->readOneof(1);
    }

    public function hasVideoTrackId()
    {
        return $this->hasOneof(1);
    }

    /**
     * Generated from protobuf field <code>string video_track_id = 1 [(.logger.name) = "videoTrackID"];</code>
     * @param string $var
     * @return $this
     */
    public function setVideoTrackId($var)
    {
        GPBUtil::checkString($var, True);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * Generated from protobuf field <code>.livekit.ParticipantVideo participant_video = 2;</code>
     * @return \Livekit\ParticipantVideo|null
     */
    public function getParticipantVideo()
    {
        return $this->readOneof(2);
    }

    public function hasParticipantVideo()
    {
        return $this->hasOneof(2);
    }

    /**
     * Generated from protobuf field <code>.livekit.ParticipantVideo participant_video = 2;</code>
     * @param \Livekit\ParticipantVideo $var
     * @return $this
     */
    public function setParticipantVideo($var)
    {
        GPBUtil::checkMessage($var, \Livekit\ParticipantVideo::class);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * Generated from protobuf field <code>.livekit.AudioConfig audio = 3;</code>
     * @return \Livekit\AudioConfig|null
     */
    public function getAudio()
    {
        return $this->audio;
    }

    public function hasAudio()
    {
        return isset($this->audio);
    }

    public function clearAudio()
    {
        unset($this->audio);
    }

    /**
     * Generated from protobuf field <code>.livekit.AudioConfig audio = 3;</code>
     * @param \Livekit\AudioConfig $var
     * @return $this
     */
    public function setAudio($var)
    {
        GPBUtil::checkMessage($var, \Livekit\AudioConfig::class);
        $this->audio = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>.livekit.DataConfig data = 4;</code>
     * @return \Livekit\DataConfig|null
     */
    public function getData()
    {
        return $this->data;
    }

    public function hasData()
    {
        return isset($this->data);
    }

    public function clearData()
    {
        unset($this->data);
    }

    /**
     * Generated from protobuf field <code>.livekit.DataConfig data = 4;</code>
     * @param \Livekit\DataConfig $var
     * @return $this
     */
    public function setData($var)
    {
        GPBUtil::checkMessage($var, \Livekit\DataConfig::class);
        $this->data = $var;

        return $this;
    }

    /**
     * @return string
     */
    public function getVideo()
    {
        return $this->whichOneof("video");
    }

}

