<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: deviceapis/device/v1/deviceapis_device_video_v1.proto

namespace Deviceapis\Device\V1\VideoChannel;

use UnexpectedValueException;

/**
 * Режим Flow control mode
 *
 * Protobuf type <code>deviceapis.device.v1.VideoChannel.FlowControlModeType</code>
 */
class FlowControlModeType
{
    /**
     * Значение не указано
     *
     * Generated from protobuf enum <code>FLOW_CONTROL_MODE_TYPE_UNKNOWN = 0;</code>
     */
    const FLOW_CONTROL_MODE_TYPE_UNKNOWN = 0;
    /**
     * Режим VBR
     *
     * Generated from protobuf enum <code>VBR = 1;</code>
     */
    const VBR = 1;
    /**
     * Режим CBR
     *
     * Generated from protobuf enum <code>CBR = 2;</code>
     */
    const CBR = 2;
    /**
     * Режим CVBR
     *
     * Generated from protobuf enum <code>CVBR = 3;</code>
     */
    const CVBR = 3;
    /**
     * Режим AVBR
     *
     * Generated from protobuf enum <code>AVBR = 4;</code>
     */
    const AVBR = 4;
    /**
     * Режим FIXP
     *
     * Generated from protobuf enum <code>FIXP = 5;</code>
     */
    const FIXP = 5;
    /**
     * Режим QVBR
     *
     * Generated from protobuf enum <code>QVBR = 6;</code>
     */
    const QVBR = 6;

    private static $valueToName = [
        self::FLOW_CONTROL_MODE_TYPE_UNKNOWN => 'FLOW_CONTROL_MODE_TYPE_UNKNOWN',
        self::VBR => 'VBR',
        self::CBR => 'CBR',
        self::CVBR => 'CVBR',
        self::AVBR => 'AVBR',
        self::FIXP => 'FIXP',
        self::QVBR => 'QVBR',
    ];

    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);
    }
}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(FlowControlModeType::class, \Deviceapis\Device\V1\VideoChannel_FlowControlModeType::class);

