<?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;

/**
 * Формат видео
 *
 * Protobuf type <code>deviceapis.device.v1.VideoChannel.FormatType</code>
 */
class FormatType
{
    /**
     * Значение не указано
     *
     * Generated from protobuf enum <code>FORMAT_TYPE_UNKNOWN = 0;</code>
     */
    const FORMAT_TYPE_UNKNOWN = 0;
    /**
     * Формат mjpeg
     *
     * Generated from protobuf enum <code>MPEG = 1;</code>
     */
    const MPEG = 1;
    /**
     * Формат h.264
     *
     * Generated from protobuf enum <code>H264 = 2;</code>
     */
    const H264 = 2;
    /**
     * Формат h.264+
     *
     * Generated from protobuf enum <code>H264_PLUS = 3;</code>
     */
    const H264_PLUS = 3;
    /**
     * Формат h.265
     *
     * Generated from protobuf enum <code>H265 = 4;</code>
     */
    const H265 = 4;

    private static $valueToName = [
        self::FORMAT_TYPE_UNKNOWN => 'FORMAT_TYPE_UNKNOWN',
        self::MPEG => 'MPEG',
        self::H264 => 'H264',
        self::H264_PLUS => 'H264_PLUS',
        self::H265 => 'H265',
    ];

    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(FormatType::class, \Deviceapis\Device\V1\VideoChannel_FormatType::class);

