<?php

/**
 * Class OutputStreamInfo
 * 子码流类
 */
class OutputStreamInfo
{
    public $name = "";
    public $liveStatus = false;
    //视频设置
    public $width = 0;
    public $height = 0;
    public $vTransfer = false;
    public $frameRate = 0;
    public $vBitRate = 0;
    public $gop = 0;
    //音频设置
    public $aTransfer = false;
    public $sampleRate = 0;
    public $aBitRate = 0;


    public function toJson()
    {
        return json_encode($this);
    }

    public function fromJson($json_obj)
    {
        $this->name = $json_obj['name'];
        $this->liveStatus = $json_obj['liveStatus'];

        $this->width = $json_obj['width'];
        $this->height = $json_obj['height'];
        $this->vTransfer = $json_obj['vTransfer'];
        $this->frameRate = $json_obj['frameRate'];
        $this->vBitRate = $json_obj['vBitRate'];
        $this->gop = $json_obj['gop'];

        $this->aTransfer = $json_obj['aTransfer'];
        $this->sampleRate = $json_obj['sampleRate'];
        $this->aBitRate = $json_obj['aBitRate'];
    }
}