GetLiveChannelStatus.php 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <?php
  2. namespace OSS\Model;
  3. /**
  4. * Class GetLiveChannelStatus
  5. * @package OSS\Model
  6. */
  7. class GetLiveChannelStatus implements XmlConfig
  8. {
  9. public function getStatus()
  10. {
  11. return $this->status;
  12. }
  13. public function getConnectedTime()
  14. {
  15. return $this->connectedTime;
  16. }
  17. public function getRemoteAddr()
  18. {
  19. return $this->remoteAddr;
  20. }
  21. public function getVideoWidth()
  22. {
  23. return $this->videoWidth;
  24. }
  25. public function getVideoHeight()
  26. {
  27. return $this->videoHeight;
  28. }
  29. public function getVideoFrameRate()
  30. {
  31. return $this->videoFrameRate;
  32. }
  33. public function getVideoBandwidth()
  34. {
  35. return $this->videoBandwidth;
  36. }
  37. public function getVideoCodec()
  38. {
  39. return $this->videoCodec;
  40. }
  41. public function getAudioBandwidth()
  42. {
  43. return $this->audioBandwidth;
  44. }
  45. public function getAudioSampleRate()
  46. {
  47. return $this->audioSampleRate;
  48. }
  49. public function getAudioCodec()
  50. {
  51. return $this->audioCodec;
  52. }
  53. public function parseFromXml($strXml)
  54. {
  55. $xml = simplexml_load_string($strXml);
  56. $this->status = strval($xml->Status);
  57. $this->connectedTime = strval($xml->ConnectedTime);
  58. $this->remoteAddr = strval($xml->RemoteAddr);
  59. if (isset($xml->Video)) {
  60. foreach ($xml->Video as $video) {
  61. $this->videoWidth = intval($video->Width);
  62. $this->videoHeight = intval($video->Height);
  63. $this->videoFrameRate = intval($video->FrameRate);
  64. $this->videoBandwidth = intval($video->Bandwidth);
  65. $this->videoCodec = strval($video->Codec);
  66. }
  67. }
  68. if (isset($xml->Video)) {
  69. foreach ($xml->Audio as $audio) {
  70. $this->audioBandwidth = intval($audio->Bandwidth);
  71. $this->audioSampleRate = intval($audio->SampleRate);
  72. $this->audioCodec = strval($audio->Codec);
  73. }
  74. }
  75. }
  76. public function serializeToXml()
  77. {
  78. throw new OssException("Not implemented.");
  79. }
  80. private $status;
  81. private $connectedTime;
  82. private $remoteAddr;
  83. private $videoWidth;
  84. private $videoHeight;
  85. private $videoFrameRate;
  86. private $videoBandwidth;
  87. private $videoCodec;
  88. private $audioBandwidth;
  89. private $audioSampleRate;
  90. private $audioCodec;
  91. }