<?php


class PullStreamInfo
{
    public $url = "";

    //video relation set
    public $vTransfer = false;
    public $width = 0;
    public $height = 0;
    public $frameRate = 0;
    public $vBitRate = 0;
    public $gop = 0;


    //audio relation set
    public $aTransfer = false;
    public $sampleRate = 0;
    public $aBitRate = 0;

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

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

        $this->vTransfer = $json_obj['vTransfer'];
        $this->width = $json_obj['width'];
        $this->height = $json_obj['height'];
        $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'];
    }
}