Example #1
0
 protected function shiftMetaSize()
 {
     $old_size = $this->metadataTagBodyLenghth;
     $new_size = $this->metadata->getSize();
     $shift = $new_size - $old_size;
     $this->metadataTagSize->size += $shift;
     $this->metadataTag->setDataSize($new_size);
     return $shift;
 }
 /**
  * @deprecated 
  */
 public function testMetadataWriteback()
 {
     /*
      * File to read 
      */
     $stream = new Yamdi_InputStream(dirname(__FILE__) . '/../trailer_2.flv');
     /*
      * Constant header
      */
     $header = new Yamdi_FlvFileHeader();
     $header->read($stream);
     $this->assertEqual(true, $header->isValid());
     /*
      * Constant size of zero tag
      */
     $zeroTagSize = new Yamdi_FlvTagSize();
     $zeroTagSize->read($stream);
     $this->assertEqual(0, $zeroTagSize->size);
     // allways 0
     /*
      * First tag (should be meta)
      */
     $tag = new Yamdi_FlvTag();
     $tag->read($stream);
     $this->assertTrue($tag->isMeta());
     $metadata = new Yamdi_FlvMetadataBody();
     $tagBody = $tag->readTagBody($stream);
     $metadata->read($tagBody);
     $this->assertEqual(strlen($tagBody), strlen($metadata->write()));
     /*
      * Cleanup
      */
     $stream->close();
 }