Main render loop. 

		Checks clock if new video and audio frames need to be rendered. 
		If so, it passes the frames to functions that take care 
		of rendering these frames.
548335
def __render(self):
		

		# Render first frame
		self.__render_videoframe()

		# Start videoclock with start of this thread
		self.clock.start()

		logger.debug("Started rendering loop.")
		# Main rendering loop
		while self.status in [PLAYING,PAUSED]:
			current_frame_no = self.clock.current_frame

			# Check if end of clip has been reached
			if self.clock.time >= self.duration:
				logger.debug("End of stream reached at {}".format(self.clock.time))
				if self.loop:
					logger.debug("Looping: restarting stream")
					# Seek to the start
					self.rewind()
					self.loop_count += 1
				else:
					# End of stream has been reached
					self.status = EOS
					break

			if self.last_frame_no != current_frame_no:
				# A new frame is available. Get it from te stream
				self.__render_videoframe()

			self.last_frame_no = current_frame_no

			# Sleeping is a good idea to give the other threads some breathing
			# space to do their work.
			time.sleep(0.005)

		# Stop the clock.
		self.clock.stop()
		logger.debug("Rendering stopped.")
1234257
function _renderFrame(time) {
            var stage = _stages[_state].stage;
            // update all game objects
            me.game.update(time, stage);
            // render all game objects
            me.game.draw(stage);
            // schedule the next frame update
            if (_animFrameId !== -1) {
                _animFrameId = window.requestAnimationFrame(_renderFrame);
            }
        }
927328
function (skeleton, lastTime, time, firedEvents, alpha) {
		if (!firedEvents) return;

		var frames = this.frames;
		var frameCount = frames.length;

		if (lastTime > time) { // Fire events after last time for looped animations.
			this.apply(skeleton, lastTime, Number.MAX_VALUE, firedEvents, alpha);
			lastTime = -1;
		} else if (lastTime >= frames[frameCount - 1]) // Last time is after last frame.
			return;
		if (time < frames[0]) return; // Time is before first frame.

		var frameIndex;
		if (lastTime < frames[0])
			frameIndex = 0;
		else {
			frameIndex = spine.Animation.binarySearch1(frames, lastTime);
			var frame = frames[frameIndex];
			while (frameIndex > 0) { // Fire multiple events with the same frame.
				if (frames[frameIndex - 1] != frame) break;
				frameIndex--;
			}
		}
		var events = this.events;
		for (; frameIndex < frameCount && time >= frames[frameIndex]; frameIndex++)
			firedEvents.push(events[frameIndex]);
	}
417358
function (renderer, scene, sceneCamera, notUpdateScene) {
        if (!sceneCamera) {
            sceneCamera = scene.getMainCamera();
        }
        this.trigger('beforerender', this, renderer, scene, sceneCamera);
        this._renderShadowPass(renderer, scene, sceneCamera, notUpdateScene);
        this.trigger('afterrender', this, renderer, scene, sceneCamera);
    }
314306
def render_scene(self):
		""
		self.init_gl() # should be a no-op after the first frame is rendered
		SDL_GL_MakeCurrent ( self.window, self.context )
		self.renderer.render_scene()
		# Done rendering
		# SDL_GL_SwapWindow(self.window)
		glFlush()
834416
def run_capture
      puts '*** Preserving this moment in history.' unless capture_stealth
      self.snapshot_loc = config.raw_image(image_file_type)
      self.main_image   = config.main_image(sha, image_file_type)

      capturer = Platform.capturer_class(capture_animated?).new(
        capture_device: capture_device,
        capture_delay: capture_delay,
        snapshot_location: snapshot_loc,
        video_location: config.video_loc,
        frames_location: config.frames_loc,
        animated_duration: capture_animate
      )
      capturer.capture
    end
727977
def render_scene(self):
        ""
        self.init_gl() # should be a no-op after the first frame is rendered
        glfw.make_context_current(self.window)
        self.renderer.render_scene()
        # Done rendering
        # glfw.swap_buffers(self.window) # avoid double buffering to avoid stalling
        glFlush() # single buffering
        glfw.poll_events()
366124
def render_scene(self):
		""
		self.canvas.SetCurrent ( self.context )
		self.renderer.render_scene()
		# Done rendering
		# self.canvas.SwapBuffers()
		if self.canvas.IsDoubleBuffered():
			self.canvas.SwapBuffers()
			print ("double buffered") # Do not want
		else:
			pass
			# TODO: SwapBuffers() seems required to show on desktop monitor,
			# but causes stalling when monitor is slower than VR headset
			self.canvas.SwapBuffers()
1364548
public function run() {

        if (!$this->enable) {
            return;
        }

        $videos = $this->getItems();

        if (empty($videos)) {
            return;
        }

        if (is_array($this->range)) {
            $rangeStart = ($this->range[0] > 0) ? $this->range[0] - 1 : 0 ;
            $rangeEnd = (!isset($this->range[1])) ? 1 : $this->range[1] ;
            $videos = array_slice($videos, $rangeStart, $rangeEnd);
        }

        return $this->renderFile($this->template, [
            'data' => [
                'videos' => $videos,
            ],
        ]);
    }
534048
function() {
		switch( this.cycles ) {
		case 3728:
		case 7457:
		case 11186:
		case 14915:
			this.doQuarterFrame();
			break;
		}

		switch( this.cycles ) {
		case 7457:
		case 14915:
			this.doHalfFrame();
			break;
		}

		if ( this.cycles >= 14915 ) {
			this.cycles = 0;

			if( this.frameCounterInterrupt ) {
				this.system.cpu.requestIRQ();
			}
		}
	}
157674
public void renderFrame(int frameNumber, Bitmap bitmap) {
    Canvas canvas = new Canvas(bitmap);
    canvas.drawColor(Color.TRANSPARENT, PorterDuff.Mode.SRC);

    // If blending is required, prepare the canvas with the nearest cached frame.
    int nextIndex;
    if (!isKeyFrame(frameNumber)) {
      // Blending is required. nextIndex points to the next index to render onto the canvas.
      nextIndex = prepareCanvasWithClosestCachedFrame(frameNumber - 1, canvas);
    } else {
      // Blending isn't required. Start at the frame we're trying to render.
      nextIndex = frameNumber;
    }

    // Iterate from nextIndex to the frame number just preceding the one we're trying to render
    // and composite them in order according to the Disposal Method.
    for (int index = nextIndex; index < frameNumber; index++) {
      AnimatedDrawableFrameInfo frameInfo = mAnimatedDrawableBackend.getFrameInfo(index);
      DisposalMethod disposalMethod = frameInfo.disposalMethod;
      if (disposalMethod == DisposalMethod.DISPOSE_TO_PREVIOUS) {
        continue;
      }
      if (frameInfo.blendOperation == BlendOperation.NO_BLEND) {
        disposeToBackground(canvas, frameInfo);
      }
      mAnimatedDrawableBackend.renderFrame(index, canvas);
      mCallback.onIntermediateResult(index, bitmap);
      if (disposalMethod == DisposalMethod.DISPOSE_TO_BACKGROUND) {
        disposeToBackground(canvas, frameInfo);
      }
    }

    AnimatedDrawableFrameInfo frameInfo = mAnimatedDrawableBackend.getFrameInfo(frameNumber);
    if (frameInfo.blendOperation == BlendOperation.NO_BLEND) {
      disposeToBackground(canvas, frameInfo);
    }
    // Finally, we render the current frame. We don't dispose it.
    mAnimatedDrawableBackend.renderFrame(frameNumber, canvas);
  }
1166690
function continuePlayback() {

        // If frames remain after advancing, schedule next frame
        if (currentFrame + 1 < frames.length) {

            // Pull the upcoming frame
            var next = frames[currentFrame + 1];

            // Calculate the real timestamp corresponding to when the next
            // frame begins
            var nextRealTimestamp = next.timestamp - startVideoTimestamp + startRealTimestamp;

            // Calculate the relative delay between the current time and
            // the next frame start
            var delay = Math.max(nextRealTimestamp - new Date().getTime(), 0);

            // Advance to next frame after enough time has elapsed
            seekToFrame(currentFrame + 1, function frameDelayElapsed() {
                continuePlayback();
            }, delay);

        }

        // Otherwise stop playback
        else
            recording.pause();

    }
161851
function render (callback) {

    if (effectAttrs.speed !== undefined) {
      setTimeout(function () {
        id = requestAnimationFrame(callback);
      }, effectAttrs.speed);
    } else {
      id = requestAnimationFrame(callback);
    }
  }
916604
function init(){

    frameUnixTime = utils.getUnixTimeInMilliseconds();
    frameDuration = 0;
    frameDurationClone = 0;
    timeSinceStart = 0;
    playTimeSinceStart = 0;
    appActive = true;
    appPlaying = true;
    videoDuration = 0;
    videoPlaying = false;

}
818667
def frames(self):
        
        f=0
        if self.isVideo() or self.isAudio():
            if self.__dict__['nb_frames']:
                try:
                    f=int(self.__dict__['nb_frames'])
                except Exception as e:
                    print "None integer frame count"
        return f
408706
function (now) {

      if (this.lastFrameTime){
        // chrome bug, see: https://code.google.com/p/chromium/issues/detail?id=268213
        // http://jsfiddle.net/pehrlich/35pTx/
        // console.assert(this.lastFrameTime < now);
        if (now < this.lastFrameTime){
          // this fix will cause an extra animation frame before the lerp frame advances. no big.
          this.lastFrameTime = now;
        }else{
          this.timeSinceLastFrame += (now - this.lastFrameTime);
        }
      }

      this.lastFrameTime = now;

//      console.assert(!isNaN(this.timeSinceLastFrame));


      var timeToNextFrame;

      // handle frame dropping, etc
      while ( this.timeSinceLastFrame > ( timeToNextFrame = this.recording.timeToNextFrame() ) ){
        this.timeSinceLastFrame -= timeToNextFrame;
        if (!this.recording.advanceFrame()){
          this.pause();
          this.controller.emit('playback.playbackFinished', this);
          return
        }
      }

      this.sendFrame(
        this.recording.createLerpFrameData(this.timeSinceLastFrame / timeToNextFrame)
      );

    }
166901
function () {

            // Internal: intentionally not documented
            this.frameCount = 0;

            // Internal: intentionally not documented
            this.frameTimeCumulative = 0;

            // Internal: intentionally not documented
            this.frameTimeBase = 0;

            // Internal: intentionally not documented
            this.frameTimeExtremes = [Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY];

            /**
             * The number of milliseconds required to render the most recent frame.
             * @type {Number}
             */
            this.frameTime = 0;

            /**
             * The number of milliseconds spent tessellating the terrain during the most recent frame.
             * @type {Number}
             */
            this.tessellationTime = 0;

            /**
             * The number of milliseconds spent rendering the active layers during the most recent frame.
             * @type {Number}
             */
            this.layerRenderingTime = 0;

            /**
             * The number of milliseconds spent rendering ordered renderables during the most recent frame.
             * @type {Number}
             */
            this.orderedRenderingTime = 0;

            /**
             * The number of terrain tiles in the most recent frame.
             * @type {Number}
             */
            this.terrainTileCount = 0;

            /**
             * The number of image tiles in the most recent frame.
             * @type {Number}
             */
            this.imageTileCount = 0;

            /**
             * The number of terrain tile renderings. Since terrain tiles are generally rendered more than once per
             * frame, this count will be greater than the number of terrain tiles created for the frame.
             * @type {Number}
             */
            this.renderedTileCount = 0;

            /**
             * The number of calls to [Tile.update()]{@link Tile#update} during the most recent frame.
             * @type {Number}
             */
            this.tileUpdateCount = 0;

            /**
             * The number of texture bind calls during the most recent frame.
             * @type {Number}
             */
            this.textureLoadCount = 0;

            /**
             * The number of WebGL VBO loads during the most recent frame.
             * @type {Number}
             */
            this.vboLoadCount = 0;

            /**
             * The average frame time over the most recent two seconds.
             * @type {Number}
             */
            this.frameTimeAverage = 0;

            /**
             * The average frame rate over the most recent two seconds.
             * @type {Number}
             */
            this.frameRateAverage = 0;

            /**
             * The minimum frame time over the most recent two seconds.
             * @type {Number}
             */
            this.frameTimeMin = 0;

            /**
             * The maximum frame time over the most recent two seconds.
             * @type {Number}
             */
            this.frameTimeMax = 0;
        }