scratch – Blame information for rev 122

Subversion Repositories:
Rev:
Rev Author Line No. Line
120 office 1 <?php
2  
3 /*
4 * This file is part of PHP-FFmpeg.
5 *
6 * (c) Alchemy <info@alchemy.fr>
7 *
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
10 */
11  
12 namespace FFMpeg\Driver;
13  
14 use Alchemy\BinaryDriver\AbstractBinary;
15 use Alchemy\BinaryDriver\Configuration;
16 use Alchemy\BinaryDriver\ConfigurationInterface;
17 use Alchemy\BinaryDriver\Exception\ExecutableNotFoundException as BinaryDriverExecutableNotFound;
18 use FFMpeg\Exception\ExecutableNotFoundException;
19 use Psr\Log\LoggerInterface;
20  
21 class FFProbeDriver extends AbstractBinary
22 {
23 /**
24 * {@inheritdoc}
25 */
26 public function getName()
27 {
28 return 'ffprobe';
29 }
30  
31 /**
32 * Creates an FFProbeDriver.
33 *
34 * @param array|ConfigurationInterface $configuration
35 * @param LoggerInterface $logger
36 *
37 * @return FFProbeDriver
38 */
39 public static function create($configuration, LoggerInterface $logger = null)
40 {
41 if (!$configuration instanceof ConfigurationInterface) {
42 $configuration = new Configuration($configuration);
43 }
44  
45 $binaries = $configuration->get('ffprobe.binaries', array('avprobe', 'ffprobe'));
46  
47 try {
48 return static::load($binaries, $logger, $configuration);
49 } catch (BinaryDriverExecutableNotFound $e) {
50 throw new ExecutableNotFoundException('Unable to load FFProbe', $e->getCode(), $e);
51 }
52 }
53 }