ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
GetId3\Module\AudioVideo\Bink Class Reference

GetId3() by James Heinrich info@.nosp@m.geti.nosp@m.d3.or.nosp@m.g //. More...

+ Inheritance diagram for GetId3\Module\AudioVideo\Bink:
+ Collaboration diagram for GetId3\Module\AudioVideo\Bink:

Public Member Functions

 analyze ()
 
 ParseBink ()
 
 ParseSmacker ()
 
- Public Member Functions inherited from GetId3\Handler\BaseHandler
 __construct (GetId3Core $getid3, $call_module=null)
 
 analyze ()
 Analyze from file pointer. More...
 
 AnalyzeString (&$string)
 Analyze from string instead. More...
 
 saveAttachment (&$ThisFileInfoIndex, $filename, $offset, $length)
 

Additional Inherited Members

- Protected Member Functions inherited from GetId3\Handler\BaseHandler
 ftell ()
 
 fread ($bytes)
 
 fseek ($bytes, $whence=SEEK_SET)
 
 feof ()
 
 isDependencyFor ($module)
 
 error ($text)
 
 warning ($text)
 
- Protected Attributes inherited from GetId3\Handler\BaseHandler
 $getid3
 
 $data_string_flag = false
 
 $data_string = ''
 
 $data_string_position = 0
 
 $data_string_length = 0
 

Detailed Description

GetId3() by James Heinrich info@.nosp@m.geti.nosp@m.d3.or.nosp@m.g //.

module for analyzing Bink or Smacker audio-video files

Author
James Heinrich info@.nosp@m.geti.nosp@m.d3.or.nosp@m.g http://www.getid3.org

Definition at line 29 of file Bink.php.

Member Function Documentation

◆ analyze()

GetId3\Module\AudioVideo\Bink::analyze ( )
Returns
boolean

Reimplemented from GetId3\Handler\BaseHandler.

Definition at line 36 of file Bink.php.

37 {
38 $info = &$this->getid3->info;
39
40 $info['error'][] = 'Bink / Smacker files not properly processed by this version of GetId3Core() [' . $this->getid3->version() . ']';
41
42 fseek($this->getid3->fp, $info['avdataoffset'], SEEK_SET);
43 $fileTypeID = fread($this->getid3->fp, 3);
44 switch ($fileTypeID) {
45 case 'BIK':
46 return $this->ParseBink();
47 break;
48
49 case 'SMK':
50 return $this->ParseSmacker();
51 break;
52
53 default:
54 $info['error'][] = 'Expecting "BIK" or "SMK" at offset ' . $info['avdataoffset'] . ', found "' . Helper::PrintHexBytes($fileTypeID) . '"';
55
56 return false;
57 break;
58 }
59
60 return true;
61 }
fseek($bytes, $whence=SEEK_SET)
static PrintHexBytes($string, $hex=true, $spaces=true, $htmlencoding='UTF-8')
Definition: Helper.php:36
$info
Definition: example_052.php:80

References $info, GetId3\Handler\BaseHandler\fread(), GetId3\Handler\BaseHandler\fseek(), GetId3\Module\AudioVideo\Bink\ParseBink(), GetId3\Module\AudioVideo\Bink\ParseSmacker(), and GetId3\Lib\Helper\PrintHexBytes().

+ Here is the call graph for this function:

◆ ParseBink()

GetId3\Module\AudioVideo\Bink::ParseBink ( )
Returns
boolean

Definition at line 67 of file Bink.php.

68 {
69 $info = &$this->getid3->info;
70 $info['fileformat'] = 'bink';
71 $info['video']['dataformat'] = 'bink';
72
73 $fileData = 'BIK' . fread($this->getid3->fp, 13);
74
75 $info['bink']['data_size'] = Helper::LittleEndian2Int(substr($fileData,
76 4,
77 4));
78 $info['bink']['frame_count'] = Helper::LittleEndian2Int(substr($fileData,
79 8,
80 2));
81
82 if (($info['avdataend'] - $info['avdataoffset']) != ($info['bink']['data_size'] + 8)) {
83 $info['error'][] = 'Probably truncated file: expecting ' . $info['bink']['data_size'] . ' bytes, found ' . ($info['avdataend'] - $info['avdataoffset']);
84 }
85
86 return true;
87 }
static LittleEndian2Int($byteword, $signed=false)
Definition: Helper.php:413

References $info, GetId3\Handler\BaseHandler\fread(), and GetId3\Lib\Helper\LittleEndian2Int().

Referenced by GetId3\Module\AudioVideo\Bink\analyze().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ParseSmacker()

GetId3\Module\AudioVideo\Bink::ParseSmacker ( )
Returns
boolean

Definition at line 93 of file Bink.php.

94 {
95 $info = &$this->getid3->info;
96 $info['fileformat'] = 'smacker';
97 $info['video']['dataformat'] = 'smacker';
98
99 return true;
100 }

References $info.

Referenced by GetId3\Module\AudioVideo\Bink\analyze().

+ Here is the caller graph for this function:

The documentation for this class was generated from the following file: