Package quicktime.std.image

Examples of quicktime.std.image.CompressedFrameInfo


        drawMatrix.rect(srcRect, gRect);
        gi.setMatrix(drawMatrix);
        gi.draw();

        // compress frame
        CompressedFrameInfo cfInfo = seq.compressFrame(gw, gRect,
          StdQTConstants.codecFlagUpdatePrevious, compressed);

        // check to see if frame is a key frame
        boolean syncSample = (cfInfo.getSimilarity() == 0);
        int flags = syncSample ? 0 : StdQTConstants.mediaSampleNotSync;

        // add compressed frame to video media
        videoMedia.addSample(imageHandle, 0, cfInfo.getDataSize(),
          timeScale / frameRate, imgDesc, 1, flags);
      } // for

      // done adding samples to the media
      videoMedia.endEdits();
View Full Code Here


        try {
            // Paint the frame.
            _imageDrawer.redraw(null);

            // Compress it.
            CompressedFrameInfo info = _videoSequence.compressFrame(_gw,
                    _videoSize, codecFlagUpdatePrevious, _compressedFrame);
            boolean isKeyFrame = info.getSimilarity() == 0;
            System.out.println("f#:" + _frameNumber + ",kf=" + isKeyFrame
                    + ",sim=" + info.getSimilarity());

            ImageDescription desc = _videoSequence.getDescription();

            // Add it to the video stream.
            _videoMedia.addSample(_imageHandle, 0, // dataOffset,
                    info.getDataSize(), 600 / _frameRateValue, // frameDuration, in 1/600ths of a second.
                    desc, 1, // one sample
                    (isKeyFrame ? 0 : mediaSampleNotSync)); // no flags
        } catch (Exception ex) {
            ex.printStackTrace();
        }
View Full Code Here

        try {
            // Paint the frame.
            _imageDrawer.redraw(null);

            // Compress it.
            CompressedFrameInfo info = _videoSequence.compressFrame(_gw,
                    _videoSize, codecFlagUpdatePrevious, _compressedFrame);
            boolean isKeyFrame = info.getSimilarity() == 0;
            System.out.println("f#:" + _frameNumber + ",kf=" + isKeyFrame
                    + ",sim=" + info.getSimilarity());

            ImageDescription desc = _videoSequence.getDescription();

            // Add it to the video stream.
            _videoMedia.addSample(_imageHandle, 0, // dataOffset,
                    info.getDataSize(), 600 / _frameRateValue, // frameDuration, in 1/600ths of a second.
                    desc, 1, // one sample
                    (isKeyFrame ? 0 : mediaSampleNotSync)); // no flags
        } catch (Throwable throwable) {
            throwable.printStackTrace();
        }
View Full Code Here

/*     */     throws QTException
/*     */   {
/* 327 */     synchronized (QTNative.globalsLock) {
/* 328 */       synchronized (this)
/*     */       {
/*     */         CompressedFrameInfo localCompressedFrameInfo;
/* 329 */         if (this.inPreflightMode) {
/* 330 */           localCompressedFrameInfo = this.seq.compressFrame(this.gw, this.gwRect, 4, this.compressedImage);
/*     */
/* 334 */           return true;
/*     */         }
/* 336 */         if ((this.recording) && (this.currentRecordFrame++ <= this.recordFrames)) {
/* 337 */           localCompressedFrameInfo = this.seq.compressFrame(this.gw, this.gwRect, 4, this.compressedImage);
/*     */
/* 341 */           int i = localCompressedFrameInfo.getSimilarity() == 0 ? 1 : 0;
/* 342 */           this.vidMedia.addSample(this.imageHandle, 0, localCompressedFrameInfo.getDataSize(), 600 / this.scale, this.recDesc, 1, i != 0 ? 0 : 1);
/*     */
/* 350 */           if (this.currentRecordFrame > this.recordFrames) {
/* 351 */             cleanupMovie();
/* 352 */             this.recording = false;
/* 353 */             this.cbThread.start();
View Full Code Here

/*     */   public int compressFrame(QDGraphics paramQDGraphics, QDRect paramQDRect, int paramInt)
/*     */     throws QTException
/*     */   {
/* 149 */     RawEncodedImage localRawEncodedImage = new RawEncodedImage(this.seq.getMaxCompressionSize(paramQDGraphics), true);
/*     */
/* 151 */     CompressedFrameInfo localCompressedFrameInfo = this.seq.compressFrame(paramQDGraphics, paramQDRect, paramInt, localRawEncodedImage);
/*     */
/* 153 */     localRawEncodedImage.setSize(localCompressedFrameInfo.getDataSize());
/*     */     try
/*     */     {
/* 160 */       int i = this.seq.getFrameNumber() - 1;
/*     */
/* 162 */       if (i < this.frames.size()) {
/* 163 */         this.frames.setElementAt(localRawEncodedImage, i);
/*     */       }
/* 165 */       else if (i > this.frames.size()) {
/* 166 */         this.frames.setSize(i);
/* 167 */         this.frames.setElementAt(localRawEncodedImage, i);
/*     */       }
/*     */       else {
/* 170 */         this.frames.addElement(localRawEncodedImage);
/*     */       }
/*     */     } catch (ArrayIndexOutOfBoundsException localArrayIndexOutOfBoundsException) {
/* 173 */       throw new QTException(getClass().getName() + ": Unable to grow internal Vector object.");
/*     */     }
/*     */
/* 176 */     return localCompressedFrameInfo.getSimilarity();
/*     */   }
View Full Code Here

TOP

Related Classes of quicktime.std.image.CompressedFrameInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.