<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: livekit_models.proto

namespace Livekit;

use UnexpectedValueException;

/**
 * Protobuf type <code>livekit.VideoCodec</code>
 */
class VideoCodec
{
    /**
     * Generated from protobuf enum <code>DEFAULT_VC = 0;</code>
     */
    const DEFAULT_VC = 0;
    /**
     * Generated from protobuf enum <code>H264_BASELINE = 1;</code>
     */
    const H264_BASELINE = 1;
    /**
     * Generated from protobuf enum <code>H264_MAIN = 2;</code>
     */
    const H264_MAIN = 2;
    /**
     * Generated from protobuf enum <code>H264_HIGH = 3;</code>
     */
    const H264_HIGH = 3;
    /**
     * Generated from protobuf enum <code>VP8 = 4;</code>
     */
    const VP8 = 4;

    private static $valueToName = [
        self::DEFAULT_VC => 'DEFAULT_VC',
        self::H264_BASELINE => 'H264_BASELINE',
        self::H264_MAIN => 'H264_MAIN',
        self::H264_HIGH => 'H264_HIGH',
        self::VP8 => 'VP8',
    ];

    public static function name($value)
    {
        if (!isset(self::$valueToName[$value])) {
            throw new UnexpectedValueException(sprintf(
                    'Enum %s has no name defined for value %s', __CLASS__, $value));
        }
        return self::$valueToName[$value];
    }


    public static function value($name)
    {
        $const = __CLASS__ . '::' . strtoupper($name);
        if (!defined($const)) {
            throw new UnexpectedValueException(sprintf(
                    'Enum %s has no value defined for name %s', __CLASS__, $name));
        }
        return constant($const);
    }
}

