/** * Build Video Subdef object depending the SimpleXMLElement * * @param SimpleXMLElement $sd * @return \Alchemy\Phrasea\Media\Subdef\Video */ protected function buildVideoSubdef(SimpleXMLElement $sd) { $video = new Video($this->translator); if ($sd->size) { $video->setOptionValue(Video::OPTION_SIZE, (int) $sd->size); } if ($sd->acodec) { $video->setOptionValue(Video::OPTION_ACODEC, (string) $sd->acodec); } if ($sd->vcodec) { $video->setOptionValue(Video::OPTION_VCODEC, (string) $sd->vcodec); } if ($sd->fps) { $video->setOptionValue(Video::OPTION_FRAMERATE, (int) $sd->fps); } if ($sd->bitrate) { $video->setOptionValue(Video::OPTION_BITRATE, (int) $sd->bitrate); } if ($sd->audiobitrate) { $video->setOptionValue(Video::OPTION_AUDIOBITRATE, (int) $sd->audiobitrate); } if ($sd->audiosamplerate) { $video->setOptionValue(Video::OPTION_AUDIOSAMPLERATE, (int) $sd->audiosamplerate); } if ($sd->GOPsize) { $video->setOptionValue(Video::OPTION_GOPSIZE, (int) $sd->GOPsize); } return $video; }
/** * @covers Alchemy\Phrasea\Media\Subdef\Video::getMediaAlchemystSpec */ public function testGetMediaAlchemystSpec() { $this->assertInstanceOf('\\MediaAlchemyst\\Specification\\Video', $this->object->getMediaAlchemystSpec()); }