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

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

+ Collaboration diagram for GetId3\Module\AudioVideo\AMFReader:

Public Member Functions

 __construct (&$stream)
 
 readData ()
 
 readDouble ()
 
 readBoolean ()
 
 readString ()
 
 readObject ()
 
 readMixedArray ()
 
 readArray ()
 
 readDate ()
 
 readLongString ()
 
 readXML ()
 
 readTypedObject ()
 

Data Fields

 $stream
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

GetId3\Module\AudioVideo\AMFReader::__construct ( $stream)
Parameters
type$stream

Definition at line 35 of file AMFReader.php.

References GetId3\Module\AudioVideo\AMFReader\$stream.

36  {
37  $this->stream = & $stream;
38  }

Member Function Documentation

◆ readArray()

GetId3\Module\AudioVideo\AMFReader::readArray ( )
Returns
type

Definition at line 195 of file AMFReader.php.

References $data, array, and GetId3\Module\AudioVideo\AMFReader\readData().

Referenced by GetId3\Module\AudioVideo\AMFReader\readData().

196  {
197  $length = $this->stream->readLong();
198  $data = array();
199 
200  for ($i = 0; $i < $length; $i++) {
201  $data[] = $this->readData();
202  }
203 
204  return $data;
205  }
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readBoolean()

GetId3\Module\AudioVideo\AMFReader::readBoolean ( )
Returns
type

Definition at line 128 of file AMFReader.php.

Referenced by GetId3\Module\AudioVideo\AMFReader\readData().

129  {
130  return $this->stream->readByte() == 1;
131  }
+ Here is the caller graph for this function:

◆ readData()

GetId3\Module\AudioVideo\AMFReader::readData ( )
Returns
null|string

Definition at line 44 of file AMFReader.php.

References GetId3\Module\AudioVideo\AMFReader\readArray(), GetId3\Module\AudioVideo\AMFReader\readBoolean(), GetId3\Module\AudioVideo\AMFReader\readDate(), GetId3\Module\AudioVideo\AMFReader\readDouble(), GetId3\Module\AudioVideo\AMFReader\readLongString(), GetId3\Module\AudioVideo\AMFReader\readMixedArray(), GetId3\Module\AudioVideo\AMFReader\readObject(), GetId3\Module\AudioVideo\AMFReader\readString(), GetId3\Module\AudioVideo\AMFReader\readTypedObject(), and GetId3\Module\AudioVideo\AMFReader\readXML().

Referenced by GetId3\Module\AudioVideo\AMFReader\readArray(), GetId3\Module\AudioVideo\AMFReader\readMixedArray(), and GetId3\Module\AudioVideo\AMFReader\readObject().

45  {
46  $value = null;
47 
48  $type = $this->stream->readByte();
49  switch ($type) {
50 
51  // Double
52  case 0:
53  $value = $this->readDouble();
54  break;
55 
56  // Boolean
57  case 1:
58  $value = $this->readBoolean();
59  break;
60 
61  // String
62  case 2:
63  $value = $this->readString();
64  break;
65 
66  // Object
67  case 3:
68  $value = $this->readObject();
69  break;
70 
71  // null
72  case 6:
73  return null;
74  break;
75 
76  // Mixed array
77  case 8:
78  $value = $this->readMixedArray();
79  break;
80 
81  // Array
82  case 10:
83  $value = $this->readArray();
84  break;
85 
86  // Date
87  case 11:
88  $value = $this->readDate();
89  break;
90 
91  // Long string
92  case 13:
93  $value = $this->readLongString();
94  break;
95 
96  // XML (handled as string)
97  case 15:
98  $value = $this->readXML();
99  break;
100 
101  // Typed object (handled as object)
102  case 16:
103  $value = $this->readTypedObject();
104  break;
105 
106  // Long string
107  default:
108  $value = '(unknown or unsupported data type)';
109  break;
110  }
111 
112  return $value;
113  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readDate()

GetId3\Module\AudioVideo\AMFReader::readDate ( )
Returns
type

Definition at line 211 of file AMFReader.php.

References $timestamp.

Referenced by GetId3\Module\AudioVideo\AMFReader\readData().

212  {
213  $timestamp = $this->stream->readDouble();
214  $timezone = $this->stream->readInt();
215 
216  return $timestamp;
217  }
foreach($mandatory_scripts as $file) $timestamp
Definition: buildRTE.php:81
+ Here is the caller graph for this function:

◆ readDouble()

GetId3\Module\AudioVideo\AMFReader::readDouble ( )
Returns
type

Definition at line 119 of file AMFReader.php.

Referenced by GetId3\Module\AudioVideo\AMFReader\readData().

120  {
121  return $this->stream->readDouble();
122  }
+ Here is the caller graph for this function:

◆ readLongString()

GetId3\Module\AudioVideo\AMFReader::readLongString ( )
Returns
type

Definition at line 223 of file AMFReader.php.

Referenced by GetId3\Module\AudioVideo\AMFReader\readData().

224  {
225  return $this->stream->readLongUTF();
226  }
+ Here is the caller graph for this function:

◆ readMixedArray()

GetId3\Module\AudioVideo\AMFReader::readMixedArray ( )
Returns
type

Definition at line 169 of file AMFReader.php.

References $data, array, and GetId3\Module\AudioVideo\AMFReader\readData().

Referenced by GetId3\Module\AudioVideo\AMFReader\readData().

170  {
171  // Get highest numerical index - ignored
172  $highestIndex = $this->stream->readLong();
173 
174  $data = array();
175 
176  while ($key = $this->stream->readUTF()) {
177  if (is_numeric($key)) {
178  $key = (float) $key;
179  }
180  $data[$key] = $this->readData();
181  }
182  // Mixed array record ends with empty string (0x00 0x00) and 0x09
183  if (($key == '') && ($this->stream->peekByte() == 0x09)) {
184  // Consume byte
185  $this->stream->readByte();
186  }
187 
188  return $data;
189  }
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readObject()

GetId3\Module\AudioVideo\AMFReader::readObject ( )
Returns
type

Definition at line 146 of file AMFReader.php.

References $data, array, and GetId3\Module\AudioVideo\AMFReader\readData().

Referenced by GetId3\Module\AudioVideo\AMFReader\readData(), and GetId3\Module\AudioVideo\AMFReader\readTypedObject().

147  {
148  // Get highest numerical index - ignored
149 // $highestIndex = $this->stream->readLong();
150 
151  $data = array();
152 
153  while ($key = $this->stream->readUTF()) {
154  $data[$key] = $this->readData();
155  }
156  // Mixed array record ends with empty string (0x00 0x00) and 0x09
157  if (($key == '') && ($this->stream->peekByte() == 0x09)) {
158  // Consume byte
159  $this->stream->readByte();
160  }
161 
162  return $data;
163  }
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readString()

GetId3\Module\AudioVideo\AMFReader::readString ( )
Returns
type

Definition at line 137 of file AMFReader.php.

Referenced by GetId3\Module\AudioVideo\AMFReader\readData().

138  {
139  return $this->stream->readUTF();
140  }
+ Here is the caller graph for this function:

◆ readTypedObject()

GetId3\Module\AudioVideo\AMFReader::readTypedObject ( )
Returns
type

Definition at line 241 of file AMFReader.php.

References GetId3\Module\AudioVideo\AMFReader\readObject().

Referenced by GetId3\Module\AudioVideo\AMFReader\readData().

242  {
243  $className = $this->stream->readUTF();
244 
245  return $this->readObject();
246  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readXML()

GetId3\Module\AudioVideo\AMFReader::readXML ( )
Returns
type

Definition at line 232 of file AMFReader.php.

Referenced by GetId3\Module\AudioVideo\AMFReader\readData().

233  {
234  return $this->stream->readLongUTF();
235  }
+ Here is the caller graph for this function:

Field Documentation

◆ $stream

GetId3\Module\AudioVideo\AMFReader::$stream

Definition at line 29 of file AMFReader.php.

Referenced by GetId3\Module\AudioVideo\AMFReader\__construct().


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