Example #1
0
 /**
  * Process the raw data from a binary stream
  * 
  * @return  void
  */
 public function processData(Woops_Flv_Binary_Stream $stream)
 {
     $this->_dataSize = $stream->u24Int();
     $this->_timestamp = $stream->u24Int();
     $this->_timestampExtended = $stream->unsignedChar();
     $this->_streamId = $stream->u24Int();
 }
Example #2
0
 /**
  * Process the raw data from a binary stream
  * 
  * @return  void
  */
 public function processData(Woops_Flv_Binary_Stream $stream)
 {
     // Gets the FLV signature
     $signature = $stream->unsignedChar() << 16 | $stream->unsignedChar() << 8 | $stream->unsignedChar();
     // Checks the FLV signature
     if ($signature !== self::SIGNATURE) {
         // Error - Invalid FLV signature
         throw new Woops_Flv_Header_Exception('Invalid FLV signature (' . $signature . ')', Woops_Flv_Header_Exception::EXCEPTION_BAD_SIGNATURE);
     }
     // Gets the FLV version
     $this->_version = $stream->unsignedChar();
     // Gets the flags
     $flags = $stream->unsignedChar();
     // Sets the audio and video flags
     $this->_hasAudio = (bool) ($flags & 0x4);
     $this->_hasVideo = (bool) ($flags & 0x1);
     // Gets the data offset
     $this->_dataOffset = $stream->bigEndianUnsignedLong();
 }