getid3_asf::HeaderExtensionObjectDataParse() –

You appear to be a bot. Output may be restricted

Description

Usage

$array = getid3_asf::HeaderExtensionObjectDataParse( $asf_header_extension_object_data, $unhandled_sections );

Parameters

$asf_header_extension_object_data
( string ) required
$unhandled_sections
( int ) required

Returns

array

Source

File name: wordpress/wp-includes/ID3/module.audio-video.asf.php
Lines:

1 to 100 of 245
  public function HeaderExtensionObjectDataParse(&$asf_header_extension_object_data, &$unhandled_sections) {
    // http://msdn.microsoft.com/en-us/library/bb643323.aspx

    $offset = 0;
    $objectOffset = 0;
    $HeaderExtensionObjectParsed = array();
    while ($objectOffset < strlen($asf_header_extension_object_data)) {
      $offset = $objectOffset;
      $thisObject = array();

      $thisObject['guid']                              =                              substr($asf_header_extension_object_data, $offset, 16);
      $offset += 16;
      $thisObject['guid_text'] = $this->getid3_asf::BytestringToGUID($thisObject['guid']);
      $thisObject['guid_name'] = $this->getid3_asf::GUIDname($thisObject['guid_text']);

      $thisObject['size']                              = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  8));
      $offset += 8;
      if ($thisObject['size'] <= 0) {
        break;
      }

      switch ($thisObject['guid']) {
        case GETID3_ASF_Extended_Stream_Properties_Object:
          $thisObject['start_time']                        = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  8));
          $offset += 8;
          $thisObject['start_time_unix']                   = $this->getid3_asf::FILETIMEtoUNIXtime($thisObject['start_time']);

          $thisObject['end_time']                          = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  8));
          $offset += 8;
          $thisObject['end_time_unix']                     = $this->getid3_asf::FILETIMEtoUNIXtime($thisObject['end_time']);

          $thisObject['data_bitrate']                      = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  4));
          $offset += 4;

          $thisObject['buffer_size']                       = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  4));
          $offset += 4;

          $thisObject['initial_buffer_fullness']           = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  4));
          $offset += 4;

          $thisObject['alternate_data_bitrate']            = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  4));
          $offset += 4;

          $thisObject['alternate_buffer_size']             = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  4));
          $offset += 4;

          $thisObject['alternate_initial_buffer_fullness'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  4));
          $offset += 4;

          $thisObject['maximum_object_size']               = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  4));
          $offset += 4;

          $thisObject['flags_raw']                         = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  4));
          $offset += 4;
          $thisObject['flags']['reliable']                = (bool) $thisObject['flags_raw'] & 0x00000001;
          $thisObject['flags']['seekable']                = (bool) $thisObject['flags_raw'] & 0x00000002;
          $thisObject['flags']['no_cleanpoints']          = (bool) $thisObject['flags_raw'] & 0x00000004;
          $thisObject['flags']['resend_live_cleanpoints'] = (bool) $thisObject['flags_raw'] & 0x00000008;

          $thisObject['stream_number']                     = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  2));
          $offset += 2;

          $thisObject['stream_language_id_index']          = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  2));
          $offset += 2;

          $thisObject['average_time_per_frame']            = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  4));
          $offset += 4;

          $thisObject['stream_name_count']                 = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  2));
          $offset += 2;

          $thisObject['payload_extension_system_count']    = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  2));
          $offset += 2;

          for ($i = 0; $i < $thisObject['stream_name_count']; $i++) {
            $streamName = array();

            $streamName['language_id_index']             = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  2));
            $offset += 2;

            $streamName['stream_name_length']            = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  2));
            $offset += 2;

            $streamName['stream_name']                   = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  $streamName['stream_name_length']));
            $offset += $streamName['stream_name_length'];

            $thisObject['stream_names'][$i] = $streamName;
          }

          for ($i = 0; $i < $thisObject['payload_extension_system_count']; $i++) {
            $payloadExtensionSystem = array();

            $payloadExtensionSystem['extension_system_id']   =                              substr($asf_header_extension_object_data, $offset, 16);
            $offset += 16;
            $payloadExtensionSystem['extension_system_id_text'] = $this->getid3_asf::BytestringToGUID($payloadExtensionSystem['extension_system_id']);

            $payloadExtensionSystem['extension_system_size'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  2));
            $offset += 2;
            if ($payloadExtensionSystem['extension_system_size'] <= 0) {
              break 2;
 

 View on GitHub View on Trac