Modification of the filters

This commit is contained in:
Romain Biard 2016-11-16 14:11:11 -03:00
commit e1625f1f94
9 changed files with 794 additions and 14 deletions

View file

@ -0,0 +1,28 @@
<?php
namespace Tests\FFMpeg\Unit\Filters\Waveform;
use Tests\FFMpeg\Unit\TestCase;
use FFMpeg\Filters\Waveform\WaveformDownmixFilter;
use FFMpeg\Media\Waveform;
use FFMpeg\Coordinate\TimeCode;
use FFMpeg\FFProbe\DataMapping\StreamCollection;
use FFMpeg\FFProbe\DataMapping\Stream;
class WaveformDownmixFilterTest extends TestCase
{
public function testApply()
{
$stream = new Stream(array('codec_type' => 'audio', 'width' => 960, 'height' => 720));
$streams = new StreamCollection(array($stream));
$audio = $this->getAudioMock(__FILE__);
$audio->expects($this->once())
->method('getStreams')
->will($this->returnValue($streams));
$waveform = new Waveform($audio, $this->getFFMpegDriverMock(), $this->getFFProbeMock(), 640, 120);
$filter = new WaveformDownmixFilter(TRUE);
$this->assertEquals(array('"aformat=channel_layouts=mono"'), $filter->apply($waveform));
}
}

View file

@ -0,0 +1,21 @@
<?php
namespace Tests\FFMpeg\Unit\Filters\Waveform;
use Tests\FFMpeg\Unit\TestCase;
use FFMpeg\Filters\Waveform\WaveformFilters;
class WaveformFiltersTest extends TestCase
{
public function testResize()
{
$Waveform = $this->createMock(Waveform::class);
$filters = new WaveformFilters($Waveform);
$Waveform->expects($this->once())
->method('addFilter')
->with($this->isInstanceOf('FFMpeg\Filters\Waveform\WaveformDownmixFilter'));
$filters->setDownmix();
}
}