Revert "Audio Params" (#377)
* Revert "Correct type in VideoFilters->framerate (#372)" This reverts commitcedcd37bd2. * Revert "fix sources parameter type (array) in concat function (#363)" This reverts commitaf00b9d6a3. * Revert "Audio Params (#344)" This reverts commitcb7d850338.
This commit is contained in:
		
					parent
					
						
							
								cedcd37bd2
							
						
					
				
			
			
				commit
				
					
						96225b2dff
					
				
			
		
					 8 changed files with 88 additions and 199 deletions
				
			
		|  | @ -46,31 +46,6 @@ abstract class DefaultAudio extends EventEmitter implements AudioInterface, Prog | |||
|         return $this->audioCodec; | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * {@inheritdoc} | ||||
|      */ | ||||
|     public function getAdditionalParameters() | ||||
|     { | ||||
|         return $this->additionalParameters; | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * Sets additional parameters. | ||||
|      * | ||||
|      * @param  array                    $additionalParameters | ||||
|      * @throws InvalidArgumentException | ||||
|      */ | ||||
|     public function setAdditionalParameters($additionalParameters) | ||||
|     { | ||||
|         if (!is_array($additionalParameters)) { | ||||
|             throw new InvalidArgumentException('Wrong additionalParamaters value'); | ||||
|         } | ||||
| 
 | ||||
|         $this->additionalParameters = $additionalParameters; | ||||
| 
 | ||||
|         return $this; | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * Sets the audio codec, Should be in the available ones, otherwise an | ||||
|      * exception is thrown. | ||||
|  |  | |||
|  | @ -25,13 +25,6 @@ interface AudioInterface extends FormatInterface | |||
|      * @return integer | ||||
|      */ | ||||
|     public function getAudioChannels(); | ||||
|      | ||||
|     /** | ||||
|      * Returns the list of available video codecs for this format. | ||||
|      * | ||||
|      * @return array | ||||
|      */ | ||||
|     public function getAdditionalParameters(); | ||||
| 
 | ||||
|     /** | ||||
|      * Returns the audio codec. | ||||
|  |  | |||
|  | @ -1,22 +0,0 @@ | |||
| <?php | ||||
| 
 | ||||
| /* | ||||
|  * This file is part of PHP-FFmpeg. | ||||
|  * | ||||
|  * (c) Alchemy <info@alchemy.fr> | ||||
|  * | ||||
|  * For the full copyright and license information, please view the LICENSE | ||||
|  * file that was distributed with this source code. | ||||
|  */ | ||||
| 
 | ||||
| namespace FFMpeg\Format; | ||||
| 
 | ||||
| interface Profile { | ||||
| 
 | ||||
|     const HIGH = 'high'; | ||||
| 
 | ||||
|     const MAIN = 'main'; | ||||
| 
 | ||||
|     const BASELINE = 'baseline'; | ||||
| 
 | ||||
| } | ||||
|  | @ -16,7 +16,6 @@ use FFMpeg\Exception\InvalidArgumentException; | |||
| use FFMpeg\Format\Audio\DefaultAudio; | ||||
| use FFMpeg\Format\VideoInterface; | ||||
| use FFMpeg\Media\MediaTypeInterface; | ||||
| use FFMpeg\Format\Profile; | ||||
| use FFMpeg\Format\ProgressListener\VideoProgressListener; | ||||
| 
 | ||||
| /** | ||||
|  | @ -33,56 +32,8 @@ abstract class DefaultVideo extends DefaultAudio implements VideoInterface | |||
|     /** @var Integer */ | ||||
|     protected $modulus = 16; | ||||
| 
 | ||||
|     /** @var string */ | ||||
|     private $profile = Profile::MAIN; | ||||
| 
 | ||||
|     /** @var float */ | ||||
|     private $level = 3.1; | ||||
| 
 | ||||
|     /** @var string[] */ | ||||
|     protected $additionalParameters; | ||||
| 
 | ||||
|     /** | ||||
|      * Sets the profile of this video | ||||
|      * @var string  $profile    must be one of `baseline`, `main` or `high` | ||||
|      * @throws \InvalidArgumentException | ||||
|      */ | ||||
|     public function setProfile(string $profile) { | ||||
|         switch($profile) { | ||||
|             case Profile::BASELINE: | ||||
|             case Profile::MAIN: | ||||
|             case Profile::HIGH: | ||||
|             // these are fine
 | ||||
|             break; | ||||
|             default: | ||||
|                 throw new \InvalidArgumentException('Invalid profile given! Must be one of `baseline`, `main` or `high`!'); | ||||
|         } | ||||
|         $this->profile = $profile; | ||||
|         return $this; | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * @inheritDoc | ||||
|      */ | ||||
|     public function getProfile() { | ||||
|         return $this->profile; | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * Sets the given level | ||||
|      * @param   float   $level  The level(for example: 3.0, 3.1, 4.0, 4.1) | ||||
|      */ | ||||
|     public function setLevel(float $level) { | ||||
|         $this->level = $level; | ||||
|         return $this; | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * @inheritDoc | ||||
|      */ | ||||
|     public function getLevel() { | ||||
|         return $this->level; | ||||
|     } | ||||
|     /** @var Array */ | ||||
|     protected $additionalParamaters; | ||||
| 
 | ||||
|     /** | ||||
|      * {@inheritdoc} | ||||
|  | @ -146,6 +97,31 @@ abstract class DefaultVideo extends DefaultAudio implements VideoInterface | |||
|         return $this->modulus; | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * {@inheritdoc} | ||||
|      */ | ||||
|     public function getAdditionalParameters() | ||||
|     { | ||||
|         return $this->additionalParamaters; | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * Sets additional parameters. | ||||
|      * | ||||
|      * @param  array                    $additionalParamaters | ||||
|      * @throws InvalidArgumentException | ||||
|      */ | ||||
|     public function setAdditionalParameters($additionalParamaters) | ||||
|     { | ||||
|         if (!is_array($additionalParamaters)) { | ||||
|             throw new InvalidArgumentException('Wrong additionalParamaters value'); | ||||
|         } | ||||
| 
 | ||||
|         $this->additionalParamaters = $additionalParamaters; | ||||
| 
 | ||||
|         return $this; | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * {@inheritdoc} | ||||
|      */ | ||||
|  |  | |||
|  | @ -56,14 +56,9 @@ interface VideoInterface extends AudioInterface | |||
|     public function getAvailableVideoCodecs(); | ||||
| 
 | ||||
|     /** | ||||
|      * Returns the current profile | ||||
|      * @return string | ||||
|      * Returns the list of available video codecs for this format. | ||||
|      * | ||||
|      * @return array | ||||
|      */ | ||||
|     public function getProfile(); | ||||
| 
 | ||||
|     /** | ||||
|      * Returns the level | ||||
|      * @return float | ||||
|      */ | ||||
|     public function getLevel(); | ||||
|     public function getAdditionalParameters(); | ||||
| } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue