/** * Process the atom data * * @return object The processed atom data */ public function getProcessedData() { // Resets the stream pointer $this->_stream->rewind(); // Gets the processed data from the parent (fullbox) $data = parent::getProcessedData(); // Gets the number of samples $data->sample_count = $this->_stream->bigEndianUnsignedLong(); // Storage for the samples $data->samples = array(); // Process each priority for ($i = 0; $i < ($data->sample_count + 1) / 2; $i++) { // Storage for the current entry $entry = new stdClass(); // Gets the raw data for the entry $entryData = $this->_stream->unsignedChar(); // Process the entry data $entry->pad1 = $entryData & 0x70; // Mask is 0111 0000 $entry->pad2 = $entryData & 0x7; // Mask is 0000 0111 // Stores the current entry $data->samples[] = $entry; } // Return the processed data return $data; }
public function getProcessedData() { // Resets the stream pointer $this->_stream->rewind(); $data = parent::getProcessedData(); if ($data->version === 1) { $data->creation_time = $this->_stream->bigEndianUnsignedLong() << 32 | $this->_stream->bigEndianUnsignedLong(); // Value is 64bits - Will this work on all platforms? $data->modification_time = $this->_stream->bigEndianUnsignedLong() << 32 | $this->_stream->bigEndianUnsignedLong(); // Value is 64bits - Will this work on all platforms? $data->timescale = $this->_stream->bigEndianUnsignedLong(); $data->duration = $this->_stream->bigEndianUnsignedLong() << 32 | $this->_stream->bigEndianUnsignedLong(); // Value is 64bits - Will this work on all platforms? $data->rate = $this->_stream->bigEndianFixedPoint(16, 16); $data->volume = $this->_stream->bigEndianFixedPoint(8, 8); $this->_stream->seek(10, Woops_Mpeg4_Binary_Stream::SEEK_CUR); $data->matrix = $this->_stream->matrix(); $this->_stream->seek(24, Woops_Mpeg4_Binary_Stream::SEEK_CUR); $data->next_track_ID = $this->_stream->bigEndianUnsignedLong(); } else { $data->creation_time = $this->_stream->bigEndianUnsignedLong(); $data->modification_time = $this->_stream->bigEndianUnsignedLong(); $data->timescale = $this->_stream->bigEndianUnsignedLong(); $data->duration = $this->_stream->bigEndianUnsignedLong(); $data->rate = $this->_stream->bigEndianFixedPoint(16, 16); $data->volume = $this->_stream->bigEndianFixedPoint(8, 8); $this->_stream->seek(10, Woops_Mpeg4_Binary_Stream::SEEK_CUR); $data->matrix = $this->_stream->matrix(); $this->_stream->seek(24, Woops_Mpeg4_Binary_Stream::SEEK_CUR); $data->next_track_ID = $this->_stream->bigEndianUnsignedLong(); } return $data; }
public function getProcessedData() { // Resets the stream pointer $this->_stream->rewind(); $data = parent::getProcessedData(); $data->entry_count = $this->_stream->bigEndianUnsignedLong(); $data->entries = array(); if ($data->version === 1) { while (!$this->_stream->endOfStream()) { $entry = new stdClass(); $entry->segment_duration = $this->_stream->bigEndianUnsignedLong() << 32 | $this->_stream->bigEndianUnsignedLong(); // Value is 64bits - Will this work on all platforms? $entry->media_time = $this->_stream->bigEndianUnsignedLong() << 32 | $this->_stream->bigEndianUnsignedLong(); // Value is 64bits - Will this work on all platforms? $entry->media_rate = $this->_stream->bigEndianFixedPoint(16, 16); $data->entries[] = $entry; } } else { while (!$this->_stream->endOfStream()) { $entry = new stdClass(); $entry->segment_duration = $this->_stream->bigEndianUnsignedLong(); $entry->media_time = $this->_stream->bigEndianUnsignedLong(); $entry->media_rate = $this->_stream->bigEndianFixedPoint(16, 16); $data->entries[] = $entry; } } return $data; }
/** * Process the atom data * * @return object The processed atom data */ public function getProcessedData() { // Resets the stream pointer $this->_stream->rewind(); // Gets the processed data from the parent (fullbox) $data = parent::getProcessedData(); // Storage for the entries $data->entries = array(); // Checks for the STSZ atom if (!isset($this->_parent->stsz)) { // Return the processed data return $data; } // Gets data from STSZ $stsz = $this->_parent->stsz->getProcessedData(); // Process each sample for ($i = 0; $i < $stsz->entry_count; $i++) { // Gets the raw data for the current entry $entryData = $this->_stream->unsignedChar(); // Storage for the current sample $entry = new stdClass(); // Process the data for the current entry $entry->sample_depends_on = ($entryData & 0x30) >> 4; // Mask is 0011 0000 $entry->sample_is_depended_on = ($entryData & 0xc) >> 2; // Mask is 0000 1100 $entry->sample_has_redundancy = $entryData & 0x3; // Mask is 0000 0011 // Stores the current entry $data->entries[] = $entry; } // Return the processed data return $data; }
/** * Process the atom data * * @return object The processed atom data */ public function getProcessedData() { // Resets the stream pointer $this->_stream->rewind(); // Gets the processed data from the parent (fullbox) $data = parent::getProcessedData(); // Track ID $data->track_ID = $this->_stream->bigEndianUnsignedLong(); // Checks for the base data offset if ($data->flags->base_data_offset_present) { // Base data offset $data->base_data_offset = $this->_stream->bigEndianUnsignedLong() << 32 | $this->_stream->bigEndianUnsignedLong(); // Value is 64bits - Will this work on all platforms? } // Checks for the sample description index if ($data->flags->sample_description_index_present) { // Sample description index $data->sample_description_index = $this->_stream->bigEndianUnsignedLong(); } // Checks for the default sample duration if ($data->flags->default_sample_duration_present) { // Default sample duration $data->default_sample_duration = $this->_stream->bigEndianUnsignedLong(); } if ($data->flags->default_sample_size_present) { $data->default_sample_size = $this->_stream->bigEndianUnsignedLong(); } if ($data->flags->default_sample_flags_present) { $data->default_sample_flags = $this->_stream->bigEndianUnsignedLong(); } // Return the processed data return $data; }
public function getProcessedData() { // Resets the stream pointer $this->_stream->rewind(); $data = parent::getProcessedData(); $data->balance = $this->_stream->bigEndianFixedPoint(8, 8); return $data; }
public function getProcessedData() { // Resets the stream pointer $this->_stream->rewind(); $data = parent::getProcessedData(); $this->_stream->seek(4, Woops_Mpeg4_Binary_Stream::SEEK_CUR); $data->handler_type = $this->_stream->read(4); $this->_stream->seek(12, Woops_Mpeg4_Binary_Stream::SEEK_CUR); $data->name = substr($this->_stream->getRemainingData(), 0, -1); return $data; }
/** * Process the atom data * * @return object The processed atom data */ public function getProcessedData() { // Resets the stream pointer $this->_stream->rewind(); // Gets the processed data from the parent (fullbox) $data = parent::getProcessedData(); // Process the atom data $data->item_ID = $this->_stream->bigEndianUnsignedShort(); // Returns the processed data return $data; }
/** * Process the atom data * * @return object The processed atom data */ public function getProcessedData() { // Resets the stream pointer $this->_stream->rewind(); // Gets the processed data from the parent (fullbox) $data = parent::getProcessedData(); // Sample count $data->sample_count = $this->_stream->bigEndianUnsignedLong(); // Storage for the samples $data->samples = array(); // Checks for the data offset if ($data->flags->data_offset_present) { // Data offset $data->data_offset = $this->_stream->bigEndianUnsignedLong(); } // Checks for the first sample flags if ($data->flags->first_sample_flags_present) { // First sample flags $data->first_sample_flags = $this->_stream->bigEndianUnsignedLong(); } // Process each sample for ($i = 0; $i < $data->sample_count; $i++) { // Storage for the current sample $sample = new stdClass(); // Checks for the sample duration if ($data->flags->sample_duration_present) { // Sample duration $sample->sample_duration = $this->_stream->bigEndianUnsignedLong(); } // Checks for the sample size if ($data->flags->sample_size_present) { // Sample size $sample->sample_size = $this->_stream->bigEndianUnsignedLong(); } // Checks for the sample flags if ($data->flags->sample_flags_present) { // Sample flags $sample->sample_flags = $this->_stream->bigEndianUnsignedLong(); } // Checks for the sample composition tome offset if ($data->flags->sample_composition_time_offsets_present) { // Sample composition tome offset $sample->sample_composition_time_offsets = $this->_stream->bigEndianUnsignedLong(); } // Stores the current sample $data->samples[] = $sample; } // Return the processed data return $data; }
public function getProcessedData() { // Resets the stream pointer $this->_stream->rewind(); $data = parent::getProcessedData(); $data->entry_count = $this->_stream->bigEndianUnsignedLong(); $data->entries = array(); while (!$this->_stream->endOfStream()) { $entry = new stdClass(); $entry->sample_number = $this->_stream->bigEndianUnsignedLong(); $data->entries[] = $entry; } return $data; }
/** * Process the atom data * * @return object The processed atom data */ public function getProcessedData() { // Resets the stream pointer $this->_stream->rewind(); // Gets the processed data from the parent (fullbox) $data = parent::getProcessedData(); $data->graphicsmode = $this->_stream->bigEndianUnsignedShort(); $data->opcolor = new stdClass(); $data->opcolor->red = $this->_stream->bigEndianUnsignedShort(); $data->opcolor->green = $this->_stream->bigEndianUnsignedShort(); $data->opcolor->blue = $this->_stream->bigEndianUnsignedShort(); // Return the processed data return $data; }
/** * Process the atom data * * @return object The processed atom data */ public function getProcessedData() { // Resets the stream pointer $this->_stream->rewind(); // Gets the processed data from the parent (fullbox) $data = parent::getProcessedData(); // Number of entries $data->entry_count = $this->_stream->bigEndianUnsignedLong(); // Storage for the entries $data->entries = array(); // Process each entry for ($i = 0; $i < $data->entry_count; $i++) { // Storage for the current entry $entry = new stdClass(); // Process the data for the current entry $entry->sample_delta = $this->_stream->bigEndianUnsignedLong(); $entry->subsample_count = $this->_stream->bigEndianUnsignedShort(); $entry->subsamples = array(); // Checks for subsamples if ($entry->subsample_count > 0) { // Process each subsample for ($j = 0; $j < $subsample_count; $j++) { // Storage for the current subsample $subSample = new stdClass(); // Checks the atom version if ($data->version === 1) { // Size of the subsample $subSample->subsample_size = $this->_stream->bigEndianUnsignedLong(); } else { // Size of the subsample $subSample->subsample_size = $this->_stream->bigEndianUnsignedShort(); } // Remaining subsample data $subSampleData = $this->_stream->bigEndianUnsignedShort(); // Process the remaining data $subSample->subsample_priority = $subSampleData > 8; // 8 first bits $subSample->discardable = $subSampleData & 0xff; // 8 last bits // Stores the current subsample $entry->subsamples[] = $subSample; } } // Stores the current entry $data->entries[] = $entry; } // Return the processed data return $data; }
/** * Process the atom data * * @return object The processed atom data */ public function getProcessedData() { // Resets the stream pointer $this->_stream->rewind(); // Gets the processed data from the parent (fullbox) $data = parent::getProcessedData(); // Tries the get the byte order mark $bom = $this->_stream->bigEndianUnsignedShort(); // Checks for the byte order mark if (($bom & 0xfeff) === $bom) { // UTF-16 XML $data->xml = substr($this->_stream->getRemainingData(), 0, -1); } else { // UTF-8 XML $this->_stream->seek(-2, Woops_Mpeg4_Binary_Stream::SEEK_CUR); $data->xml = substr($this->_stream->getRemainingData(), 0, -1); } // Return the processed data return $data; }
public function getProcessedData() { // Resets the stream pointer $this->_stream->rewind(); $data = parent::getProcessedData(); $data->entry_count = $this->_stream->bigEndianUnsignedLong(); $data->entries = array(); while (!$this->_stream->endOfStream()) { $entryLength = $this->_stream->bigEndianUnsignedLong(); $entryType = $this->_stream->read(4); if ($entryType === 'urn ') { $entry = $this->_dataEntryUrnBox($this->_stream->read($entryLength - 8)); } elseif ($entryType === 'url ') { $entry = $this->_dataEntryUrlBox($this->_stream->read($entryLength - 8)); } else { $entry = new stdClass(); } $data->entries[] = $entry; } return $data; }
/** * Process the atom data * * @return object The processed atom data */ public function getProcessedData() { // Resets the stream pointer $this->_stream->rewind(); // Gets the processed data from the parent (fullbox) $data = parent::getProcessedData(); // Storage for the entries $data->entries = array(); // Process each entry while (!$this->_stream->endOfStream()) { // Storage for the current entry $entry = new stdClass(); // Process the current entry $entry->rate = $this->_stream->bigEndianUnsignedLong(); $entry->initial_delay = $this->_stream->bigEndianUnsignedLong(); // Stores the current entry $data->entries[] = $entry; } // Returns the processed data return $data; }
public function getProcessedData() { // Resets the stream pointer $this->_stream->rewind(); $data = parent::getProcessedData(); if ($data->version === 1) { $data->creation_time = $this->_stream->bigEndianUnsignedLong() << 32 | $this->_stream->bigEndianUnsignedLong(); // Value is 64bits - Will this work on all platforms? $data->modification_time = $this->_stream->bigEndianUnsignedLong() << 32 | $this->_stream->bigEndianUnsignedLong(); // Value is 64bits - Will this work on all platforms? $data->timescale = $this->_stream->bigEndianUnsignedLong(); $data->duration = $this->_stream->bigEndianUnsignedLong(); $data->language = $this->_stream->bigEndianIso639Code(); } else { $data->creation_time = $this->_stream->bigEndianUnsignedLong(); $data->modification_time = $this->_stream->bigEndianUnsignedLong(); $data->timescale = $this->_stream->bigEndianUnsignedLong(); $data->duration = $this->_stream->bigEndianUnsignedLong(); $data->language = $this->_stream->bigEndianIso639Code(); } return $data; }
/** * Process the atom data * * @return object The processed atom data */ public function getProcessedData() { // Resets the stream pointer $this->_stream->rewind(); // Gets the processed data from the parent (fullbox) $data = parent::getProcessedData(); // Process the atom data $data->language = $this->_stream->bigEndianIso639Code(); // Tries the get the byte order mark $noticeBom = $this->_stream->bigEndianUnsignedShort(); // Checks for the byte order mark if (($noticeBom & 0xfeff) === $noticeBom) { // UTF-16 string $data->notice = substr($this->_stream->getRemainingData(), 0, -1); } else { // UTF-8 string $this->_stream->seek(-2, Woops_Mpeg4_Binary_Stream::SEEK_CUR); $data->notice = substr($this->_stream->getRemainingData(), 0, -1); } // Return the processed data return $data; }
/** * Process the atom data * * @return object The processed atom data */ public function getProcessedData() { // Resets the stream pointer $this->_stream->rewind(); // Gets the processed data from the parent (fullbox) $data = parent::getProcessedData(); // Offset related data $offset = $this->_stream->bigEndianUnsignedShort(); // Process the atom data $data->offset_size = $offset & 0xf000; // Mask is 1111 0000 0000 0000 $data->length_size = $offset & 0xf00; // Mask is 0000 1111 0000 0000 $data->base_offset_size = $offset & 0xf0; // Mask is 0000 0000 1111 0000 $data->item_count = $this->_stream->bigEndianUnsignedShort(); // Storage for items $data->items = array(); // Process each item for ($i = 0; $i < $data->item_count; $i++) { // Storage for the current item $item = new stdClass(); // Process the current item data $item->item_ID = $this->_stream->bigEndianUnsignedShort(); $item->data_reference_index = $this->_stream->bigEndianUnsignedShort(); // Do not process the base_offset for now $this->_stream->seek($data->base_offset_size); // Gets the extent count $item->extent_count = $this->_stream->bigEndianUnsignedShort(); // Do not process the extent data for now $this->_stream->seek($data->offset_size); $this->_stream->seek($data->length_size); // Stores the current item $data->items[] = $item; } // Returns the processed data return $data; }
/** * Process the atom data * * @return object The processed atom data */ public function getProcessedData() { // Resets the stream pointer $this->_stream->rewind(); // Gets the processed data from the parent (fullbox) $data = parent::getProcessedData(); // Storage for the entries $data->priorities = array(); // Checks for the STSZ atom if (!isset($this->_parent->stsz)) { // Return the processed data return $data; } // Gets data from STSZ $stsz = $this->_parent->stsz->getProcessedData(); // Process each priority for ($i = 0; $i < $stsz->sample_count; $i++) { // Stores the current priority $data->priorities[] = $this->_stream->bigEndianUnsignedShort(); } // Return the processed data return $data; }
/** * Process the atom data * * @return object The processed atom data */ public function getProcessedData() { // Resets the stream pointer $this->_stream->rewind(); // Gets the processed data from the parent (fullbox) $data = parent::getProcessedData(); // Process the atom data $data->grouping_type = $this->_stream->bigEndianUnsignedLong(); $data->entry_count = $this->_stream->bigEndianUnsignedLong(); // Storage for the entries $data->entries = array(); // Process each entry while (!$this->_stream->endOfStream()) { // Storage for the current entry $entry = new stdClass(); // Process the entry data $entry->sample_count = $this->_stream->bigEndianUnsignedLong(); $entry->group_description_index = $this->_stream->bigEndianUnsignedLong(); // Stores the current entry $data->entries[] = $entry; } // Returns the processed data return $data; }
/** * Process the atom data * * @return object The processed atom data */ public function getProcessedData() { // Resets the stream pointer $this->_stream->rewind(); // Gets the processed data from the parent (fullbox) $data = parent::getProcessedData(); // Checks the atom version if ($data->version === 1) { // Process data $data->creation_time = $this->_stream->bigEndianUnsignedLong() << 32 | $this->_stream->bigEndianUnsignedLong(); // Value is 64bits - Will this work on all platforms? $data->modification_time = $this->_stream->bigEndianUnsignedLong() << 32 | $this->_stream->bigEndianUnsignedLong(); // Value is 64bits - Will this work on all platforms? $data->track_ID = $this->_stream->bigEndianUnsignedLong(); $this->_stream->seek(4, Woops_Mpeg4_Binary_Stream::SEEK_CUR); $data->duration = $this->_stream->bigEndianUnsignedLong() << 32 | $this->_stream->bigEndianUnsignedLong(); // Value is 64bits - Will this work on all platforms? $this->_stream->seek(8, Woops_Mpeg4_Binary_Stream::SEEK_CUR); $data->layer = $this->_stream->bigEndianUnsignedShort(); $data->alternate_group = $this->_stream->bigEndianUnsignedShort(); $data->volume = $this->_stream->bigEndianFixedPoint(8, 8); $this->_stream->seek(2, Woops_Mpeg4_Binary_Stream::SEEK_CUR); $data->matrix = $this->_stream->matrix(); $data->width = $this->_stream->bigEndianFixedPoint(16, 16); $data->height = $this->_stream->bigEndianFixedPoint(16, 16); } else { // Process data $data->creation_time = $this->_stream->bigEndianUnsignedLong(); $data->modification_time = $this->_stream->bigEndianUnsignedLong(); $data->track_ID = $this->_stream->bigEndianUnsignedLong(); $this->_stream->seek(4, Woops_Mpeg4_Binary_Stream::SEEK_CUR); $data->duration = $this->_stream->bigEndianUnsignedLong(); $this->_stream->seek(8, Woops_Mpeg4_Binary_Stream::SEEK_CUR); $data->layer = $this->_stream->bigEndianUnsignedShort(); $data->alternate_group = $this->_stream->bigEndianUnsignedShort(); $data->volume = $this->_stream->bigEndianFixedPoint(8, 8); $this->_stream->seek(2, Woops_Mpeg4_Binary_Stream::SEEK_CUR); $data->matrix = $this->_stream->matrix(); $data->width = $this->_stream->bigEndianFixedPoint(16, 16); $data->height = $this->_stream->bigEndianFixedPoint(16, 16); } // Return the processed data return $data; }
public function getProcessedData() { return parent::getProcessedData(); }
/** * Process the atom data * * @return object The processed atom data * @see _audioSampleEntry * @see _visualSampleEntry * @see _hintSampleEntries */ public function getProcessedData() { // Resets the stream pointer $this->_stream->rewind(); // Gets the processed data from the parent (fullbox) $data = parent::getProcessedData(); // Number of entries $data->entry_count = $this->_stream->bigEndianUnsignedLong(); // Checks for the HDLR atom if (!isset($this->_parent->_parent->_parent->hdlr)) { // No HDLR atom return $data; } // Gets data from HDLR $hdlr = $this->_parent->_parent->_parent->hdlr->getProcessedData(); // Storage for the entries $data->entries = array(); // Process each entry for ($i = 0; $i < $data->entry_count; $i++) { // Checks the handler type if ($hdlr->handler_type === 'soun') { // Returns the atom processed data (audio entry) $data->entries[] = $this->_audioSampleEntry(); } elseif ($hdlr->handler_type === 'vide') { // Returns the atom processed data (visual entry) $data->entries[] = $this->_visualSampleEntry(); } elseif ($hdlr->handler_type === 'hint') { $data->entries = $this->_hintSampleEntries(); } } // Unrecognized handler type return $data; }