ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
getid3_bink Class Reference

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

+ Inheritance diagram for getid3_bink:
+ Collaboration diagram for getid3_bink:

Public Member Functions

 getid3_bink (&$fd, &$ThisFileInfo)
 
 ParseBink (&$fd, &$ThisFileInfo)
 
 ParseSmacker (&$fd, &$ThisFileInfo)
 
 Analyze ()
 
 ParseBink ()
 
 ParseSmacker ()
 
- Public Member Functions inherited from getid3_handler
 __construct (getID3 $getid3, $call_module=null)
 
 Analyze ()
 
 AnalyzeString ($string)
 
 setStringMode ($string)
 
 saveAttachment ($name, $offset, $length, $image_mime=null)
 

Additional Inherited Members

- Protected Member Functions inherited from getid3_handler
 ftell ()
 
 fread ($bytes)
 
 fseek ($bytes, $whence=SEEK_SET)
 
 feof ()
 
 isDependencyFor ($module)
 
 error ($text)
 
 warning ($text)
 
 notice ($text)
 
- Protected Attributes inherited from getid3_handler
 $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 //

Definition at line 17 of file module.audio-video.bink.php.

Member Function Documentation

◆ Analyze()

getid3_bink::Analyze ( )

Reimplemented from getid3_handler.

Definition at line 21 of file module.audio-video.bink.php.

21 {
22 $info = &$this->getid3->info;
23
24$info['error'][] = 'Bink / Smacker files not properly processed by this version of getID3() ['.$this->getid3->version().']';
25
26 $this->fseek($info['avdataoffset']);
27 $fileTypeID = $this->fread(3);
28 switch ($fileTypeID) {
29 case 'BIK':
30 return $this->ParseBink();
31 break;
32
33 case 'SMK':
34 return $this->ParseSmacker();
35 break;
36
37 default:
38 $info['error'][] = 'Expecting "BIK" or "SMK" at offset '.$info['avdataoffset'].', found "'.getid3_lib::PrintHexBytes($fileTypeID).'"';
39 return false;
40 break;
41 }
42
43 return true;
44
45 }
fseek($bytes, $whence=SEEK_SET)
Definition: getid3.php:1697
fread($bytes)
Definition: getid3.php:1685
PrintHexBytes($string, $hex=true, $spaces=true, $htmlsafe=true)
Definition: getid3.lib.php:17
$info
Definition: example_052.php:80

References $info, getid3_handler\fread(), getid3_handler\fseek(), ParseBink(), ParseSmacker(), and getid3_lib\PrintHexBytes().

+ Here is the call graph for this function:

◆ getid3_bink()

getid3_bink::getid3_bink ( $fd,
$ThisFileInfo 
)

Definition at line 20 of file module.audio-video.bink.php.

20 {
21
22$ThisFileInfo['error'][] = 'Bink / Smacker files not properly processed by this version of getID3()';
23
24 fseek($fd, $ThisFileInfo['avdataoffset'], SEEK_SET);
25 $fileTypeID = fread($fd, 3);
26 switch ($fileTypeID) {
27 case 'BIK':
28 return $this->ParseBink($fd, $ThisFileInfo);
29 break;
30
31 case 'SMK':
32 return $this->ParseSmacker($fd, $ThisFileInfo);
33 break;
34
35 default:
36 $ThisFileInfo['error'][] = 'Expecting "BIK" or "SMK" at offset '.$ThisFileInfo['avdataoffset'].', found "'.$fileTypeID.'"';
37 return false;
38 break;
39 }
40
41 return true;
42
43 }

References getid3_handler\fread(), getid3_handler\fseek(), ParseBink(), and ParseSmacker().

+ Here is the call graph for this function:

◆ ParseBink() [1/2]

getid3_bink::ParseBink ( $fd,
$ThisFileInfo 
)

Definition at line 45 of file module.audio-video.bink.php.

45 {
46 $ThisFileInfo['fileformat'] = 'bink';
47 $ThisFileInfo['video']['dataformat'] = 'bink';
48
49 $fileData = 'BIK'.fread($fd, 13);
50
51 $ThisFileInfo['bink']['data_size'] = getid3_lib::LittleEndian2Int(substr($fileData, 4, 4));
52 $ThisFileInfo['bink']['frame_count'] = getid3_lib::LittleEndian2Int(substr($fileData, 8, 2));
53
54 if (($ThisFileInfo['avdataend'] - $ThisFileInfo['avdataoffset']) != ($ThisFileInfo['bink']['data_size'] + 8)) {
55 $ThisFileInfo['error'][] = 'Probably truncated file: expecting '.$ThisFileInfo['bink']['data_size'].' bytes, found '.($ThisFileInfo['avdataend'] - $ThisFileInfo['avdataoffset']);
56 }
57
58 return true;
59 }
LittleEndian2Int($byteword, $signed=false)
Definition: getid3.lib.php:266

References getid3_lib\LittleEndian2Int().

+ Here is the call graph for this function:

◆ ParseBink() [2/2]

getid3_bink::ParseBink ( )

Definition at line 47 of file module.audio-video.bink.php.

47 {
48 $info = &$this->getid3->info;
49 $info['fileformat'] = 'bink';
50 $info['video']['dataformat'] = 'bink';
51
52 $fileData = 'BIK'.$this->fread(13);
53
54 $info['bink']['data_size'] = getid3_lib::LittleEndian2Int(substr($fileData, 4, 4));
55 $info['bink']['frame_count'] = getid3_lib::LittleEndian2Int(substr($fileData, 8, 2));
56
57 if (($info['avdataend'] - $info['avdataoffset']) != ($info['bink']['data_size'] + 8)) {
58 $info['error'][] = 'Probably truncated file: expecting '.$info['bink']['data_size'].' bytes, found '.($info['avdataend'] - $info['avdataoffset']);
59 }
60
61 return true;
62 }

References $info, and getid3_lib\LittleEndian2Int().

Referenced by Analyze(), and getid3_bink().

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

◆ ParseSmacker() [1/2]

getid3_bink::ParseSmacker ( $fd,
$ThisFileInfo 
)

Definition at line 61 of file module.audio-video.bink.php.

61 {
62 $ThisFileInfo['fileformat'] = 'smacker';
63 $ThisFileInfo['video']['dataformat'] = 'smacker';
64
65 return false;
66 }

◆ ParseSmacker() [2/2]

getid3_bink::ParseSmacker ( )

Definition at line 64 of file module.audio-video.bink.php.

64 {
65 $info = &$this->getid3->info;
66 $info['fileformat'] = 'smacker';
67 $info['video']['dataformat'] = 'smacker';
68
69 return true;
70 }

References $info.

Referenced by Analyze(), and getid3_bink().

+ Here is the caller graph for this function:

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