ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
All Data Structures Namespaces Files Functions Variables Modules Pages
getid3_bink Class Reference

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

+ Collaboration diagram for getid3_bink:

Public Member Functions

 getid3_bink (&$fd, &$ThisFileInfo)
 
 ParseBink (&$fd, &$ThisFileInfo)
 
 ParseSmacker (&$fd, &$ThisFileInfo)
 

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

◆ getid3_bink()

getid3_bink::getid3_bink ( $fd,
$ThisFileInfo 
)

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

References ParseBink(), and ParseSmacker().

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  }
ParseSmacker(&$fd, &$ThisFileInfo)
ParseBink(&$fd, &$ThisFileInfo)
+ Here is the call graph for this function:

◆ ParseBink()

getid3_bink::ParseBink ( $fd,
$ThisFileInfo 
)

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

References getid3_lib\LittleEndian2Int().

Referenced by getid3_bink().

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
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ParseSmacker()

getid3_bink::ParseSmacker ( $fd,
$ThisFileInfo 
)

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

Referenced by getid3_bink().

61  {
62  $ThisFileInfo['fileformat'] = 'smacker';
63  $ThisFileInfo['video']['dataformat'] = 'smacker';
64 
65  return false;
66  }
+ Here is the caller graph for this function:

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