Learn R Programming

Rvision (version 0.6.0)

queue: Create an Object of Class Queue

Description

Function for creating Queue objects for Video and Stream objects.

Usage

queue(x, size = 10, delay = 1000, overflow = "pause")

Arguments

x

Either a Video or a Stream object.

size

The number of frames that the Queue object can store (default: 10). This number is fixed if overflow is set to "pause" or "replace". This number may increase if overflow is set to "grow" and the queue becomes full.

delay

Time in microseconds between two queue updates (default: 1000). Increasing the delay will slow down the speed at which the queue fills up. Decreasing it will fill up the queue faster but will use up more processing resources.

overflow

A character string indicating what the Queue object should do when it is full. Three methods are available:

  • "pause": the queue will stop retrieving and storing new frames until a frame is read by the user.

  • "replace": the oldest frame in the queue is discarded to make space for a new frame.

  • "grow": the size of the queue is doubled every time it fills up. This should be used with extreme caution as it can lead to excessive memory usage.

Value

A Queue object.

Examples

Run this code
# NOT RUN {
balloon <- video(system.file("sample_vid/Balloon.mp4", package = "Rvision"))
buf <- queue(balloon)

# }

Run the code above in your browser using DataLab