/** * Process the raw data from a binary stream * * @return void */ public function processData(Woops_Swf_Binary_Stream $stream) { // Gets the SWF file signature $signature = $stream->read(3); // Checks the SWF file signature if ($signature === 'FWS') { // No compression $this->_isCompressed = false; } elseif ($signature === 'CWS') { // SWF file data is compressed $this->_isCompressed = true; } else { // Error - Invalid SWF signature throw new Woops_Swf_Header_Exception('Invalid SWF file signature (' . $signature . ')', Woops_Swf_Header_Exception::EXCEPTION_BAD_SIGNATURE); } // Gets the SWF version $this->_version = $stream->unsignedChar(); // Do not process the file size $stream->seek(4, Woops_Swf_Binary_Stream::SEEK_CUR); // Checks if we have to uncompress the SWF data if ($this->_isCompressed) { // Uncompress the SWF data $stream->uncompressData(); } // Processes the frame size rectangle $this->_frameSize->processData($stream); // Gets the frame rate $this->_frameRate = $stream->littleEndianFixedPoint(8, 8); // Gets the number of frames $this->_frameCount = $stream->littleEndianUnsignedShort(); }
/** * Process the raw data from a binary stream * * @return void */ public function processData(Woops_Swf_Binary_Stream $stream) { // Skips the reserved bits $stream->seek(2, Woops_Swf_Binary_Stream::SEEK_CUR); // Calls the parent method parent::processData($stream); }