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

namespace Google\Cloud\Video\LiveStream\V1\TimecodeConfig;

use UnexpectedValueException;

/**
 * The source of timecode.
 *
 * Protobuf type <code>google.cloud.video.livestream.v1.TimecodeConfig.TimecodeSource</code>
 */
class TimecodeSource
{
    /**
     * The timecode source is not specified.
     *
     * Generated from protobuf enum <code>TIMECODE_SOURCE_UNSPECIFIED = 0;</code>
     */
    const TIMECODE_SOURCE_UNSPECIFIED = 0;
    /**
     * Use input media timestamp.
     *
     * Generated from protobuf enum <code>MEDIA_TIMESTAMP = 1;</code>
     */
    const MEDIA_TIMESTAMP = 1;
    /**
     * Use input embedded timecode e.g. picture timing SEI message.
     *
     * Generated from protobuf enum <code>EMBEDDED_TIMECODE = 2;</code>
     */
    const EMBEDDED_TIMECODE = 2;

    private static $valueToName = [
        self::TIMECODE_SOURCE_UNSPECIFIED => 'TIMECODE_SOURCE_UNSPECIFIED',
        self::MEDIA_TIMESTAMP => 'MEDIA_TIMESTAMP',
        self::EMBEDDED_TIMECODE => 'EMBEDDED_TIMECODE',
    ];

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


