Utility routine used to display an updated frame from a framebuffer.
486698
def display_image(self, reset=1):
        
        try:
            fb = self.server.controller.get_frame(self.frame)
        except KeyError:
            # the selected frame does not exist, create it
            fb = self.server.controller.init_frame(self.frame)

        if not fb.height:
            width = fb.width
            height = int(len(fb.buffer) / width)
            fb.height = height

            # display the image
            if (len(fb.buffer) > 0) and (height > 0):
                self.server.controller.display(self.frame, width, height,
                                               True)
        else:
            self.server.controller.display(self.frame, fb.width, fb.height,
                                           False)
299865
private void updateStreamReadWindow() throws Http2Exception {
        if (currentFrame instanceof FrameData) {
            long frameSize = currentFrame.getPayloadLength();
            streamReadWindowSize -= frameSize; // decrement stream read window
            muxLink.connectionReadWindowSize -= frameSize; // decrement connection read window

            // if the stream or connection windows become too small, update the windows
            // TODO: decide how often we should update the read window via WINDOW_UPDATE
            if (streamReadWindowSize < (muxLink.maxReadWindowSize / 2) ||
                muxLink.connectionReadWindowSize < (muxLink.maxReadWindowSize / 2)) {

                int windowChange = (int) (muxLink.maxReadWindowSize - this.streamReadWindowSize);
                Frame savedFrame = currentFrame; // save off the current frame
                if (!this.isStreamClosed()) {
                    currentFrame = new FrameWindowUpdate(myID, windowChange, false);
                    writeFrameSync();
                    currentFrame = savedFrame;
                }
                long windowSizeIncrement = muxLink.getRemoteConnectionSettings().getMaxFrameSize();
                FrameWindowUpdate wuf = new FrameWindowUpdate(0, (int) windowSizeIncrement, false);
                this.muxLink.getStream(0).processNextFrame(wuf, Direction.WRITING_OUT);
            }
        }
    }
332259
def __render_videoframe(self):
		

		new_videoframe = self.clip.get_frame(self.clock.time)
		# Pass it to the callback function if this is set
		if callable(self.__videorenderfunc):
			self.__videorenderfunc(new_videoframe)
		# Set current_frame to current frame (...)
		self.__current_videoframe = new_videoframe
485675
def update(self, frame_no):
        
        if (frame_no >= self._start_frame and
                (self._stop_frame == 0 or frame_no < self._stop_frame)):
            self._update(frame_no)
117690
def get_frame(self, outdata, frames, timedata, status):
		

		if not self.keep_listening:
			raise sd.CallbackStop
		
		try:
			chunk = self.queue.get_nowait()
			# Check if the chunk contains the expected number of frames
			# The callback function raises a ValueError otherwise.
			if chunk.shape[0] == frames:
				outdata[:] = chunk
			else:
				outdata.fill(0)
		except Empty:
			outdata.fill(0)
1191637
function(){

			// Update the next frame
			updateId = requestAnimationFrame(update);

			var now = Date.now();
			if (emitter)
				emitter.update((now - elapsed) * 0.001);

			framerate.innerHTML = (1000 / (now - elapsed)).toFixed(2);

			elapsed = now;

			if(emitter && particleCount)
				particleCount.innerHTML = emitter.particleCount;

			// render the stage
			renderer.render(stage);
		}
396019
def frameify(self, state, data):
        """"""

        try:
            yield state.recv_buf + data
        except FrameSwitch:
            pass
        finally:
            state.recv_buf = ''
645304
def get_frame(self, frame_idx, env_idx):
        
        if frame_idx >= self.current_size:
            raise VelException("Requested frame beyond the size of the buffer")

        accumulator = []

        last_frame = self.state_buffer[frame_idx, env_idx]

        accumulator.append(last_frame)

        for i in range(self.frame_history - 1):
            prev_idx = (frame_idx - 1) % self.buffer_capacity

            if prev_idx == self.current_idx:
                raise VelException("Cannot provide enough history for the frame")
            elif self.dones_buffer[prev_idx, env_idx]:
                # If previous frame was done - just append zeroes
                accumulator.append(np.zeros_like(last_frame))
            else:
                frame_idx = prev_idx
                accumulator.append(self.state_buffer[frame_idx, env_idx])

        # We're pushing the elements in reverse order
        return np.concatenate(accumulator[::-1], axis=-1)
726635
def _render_frame(self):
        
        frame = self.frame()
        output = '\r{0}'.format(frame)
        self.clear()
        try:
            self._stream.write(output)
        except UnicodeEncodeError:
            self._stream.write(encode_utf_8_text(output))
684717
async def handle_frame(self, frame):
        """"""
        if not isinstance(frame, FrameGetVersionConfirmation):
            return False
        self.version = frame.version
        self.success = True
        return True
505635
def _write_frame(self, frame_out):
        
        self._connection.write_frame(0, frame_out)
        LOGGER.debug('Frame Sent: %s', frame_out.name)
1280091
def receive(frame)
      transition(frame, false)

      case frame[:type]
      when :data
        update_local_window(frame)
        # Emit DATA frame
        emit(:data, frame[:payload]) unless frame[:ignore]
        calculate_window_update(@local_window_max_size)
      when :headers
        emit(:headers, frame[:payload]) unless frame[:ignore]
      when :push_promise
        emit(:promise_headers, frame[:payload]) unless frame[:ignore]
      when :priority
        process_priority(frame)
      when :window_update
        process_window_update(frame)
      when :altsvc
        # 4.  The ALTSVC HTTP/2 Frame
        # An ALTSVC frame on a
        # stream other than stream 0 containing non-empty "Origin" information
        # is invalid and MUST be ignored.
        if !frame[:origin] || frame[:origin].empty?
          emit(frame[:type], frame)
        end
      when :blocked
        emit(frame[:type], frame)
      end

      complete_transition(frame)
    end
1075951
def display_buffer(self, buffer, redraw=True):
        
        logger.debug("display buffer %r", buffer)
        self.buffer_movement_history.append(buffer)
        self.current_buffer = buffer
        self._set_main_widget(buffer.widget, redraw=redraw)
667922
def window_update(wsi)
      @recv_remaining_window += wsi
      sid = (Stream === self) ? self.id : 0
      send_immediately Frame::WindowUpdate.new(sid, wsi)
    end
404983
def update(self, redraw=True):
        """"""
        # get the main urwid.Frame widget
        mainframe = self.root_widget.original_widget

        # body
        if self.current_buffer:
            mainframe.set_body(self.current_buffer)

        # footer
        lines = []
        if self._notificationbar:  # .get_text()[0] != ' ':
            lines.append(self._notificationbar)
        if self._show_statusbar:
            lines.append(self.build_statusbar())

        if lines:
            mainframe.set_footer(urwid.Pile(lines))
        else:
            mainframe.set_footer(None)
        # force a screen redraw
        if self.mainloop.screen.started and redraw:
            self.mainloop.draw_screen()
535700
def do_display(self, arg):
        
        if not arg:
            self.message('Currently displaying:')
            for item in self.displaying.get(self.curframe, {}).items():
                self.message('%s: %s' % bdb.safe_repr(item))
        else:
            val = self._getval_except(arg)
            self.displaying.setdefault(self.curframe, {})[arg] = val
            self.message('display %s: %s' % (arg, bdb.safe_repr(val)))
111547
public void writeFrame(byte[] frame) throws IOException {
        lastUsedTime = System.currentTimeMillis();
        out.write(frame);
        out.flush();
    }