diplomat.wx_gui.video_player.ControlDeque

class diplomat.wx_gui.video_player.ControlDeque(maxsize: int)[source]

Bases: object

A control deque. This deque is used to store video frames while they are coming in

__init__(maxsize: int)[source]

Create a new ControlDeque.

Parameters:

maxsize – The maximum allowed size of the deque.

Methods

__init__(maxsize)

Create a new ControlDeque.

clear()

Clear the deque.

flush()

Flush any current push events, not actually adding there results to the deque.

pop_left_force()

Forcefully pop a value from the left side of the deque, throwing an exception if the deque is empty.

pop_left_relaxed()

Pop an object from the left side of the deque.

pop_right_force()

Forcefully pop a value from the right side of the deque, throwing an exception if the deque is empty.

pop_right_relaxed()

Pop an object from the right side of the deque.

push_left_force(value)

Push object onto left side of the deque.

push_left_relaxed(value)

Push object onto left side of the deque.

push_right_force(value)

Push object onto right side of the deque.

push_right_relaxed(value)

Push object onto right side of the deque.

Attributes

maxsize

Get the max size of this deque.

clear()[source]

Clear the deque. This will also clear any push operations currently waiting.

flush()[source]

Flush any current push events, not actually adding there results to the deque.

property maxsize

Get the max size of this deque.

Returns:

The max size of this deque.

pop_left_force() Any[source]

Forcefully pop a value from the left side of the deque, throwing an exception if the deque is empty.

Returns:

The value left most on the deque.

pop_left_relaxed() Any[source]

Pop an object from the left side of the deque. If there are no items, we block until there is space.

Returns:

The item on the left side of the stack.

pop_right_force() Any[source]

Forcefully pop a value from the right side of the deque, throwing an exception if the deque is empty.

Returns:

The value right most on the deque.

pop_right_relaxed() Any[source]

Pop an object from the right side of the deque. If there are no items, we block until there is space.

Returns:

The item on the right side of the stack.

push_left_force(value)[source]

Push object onto left side of the deque. If there is no space available, we forcefully push the object onto the deque, causing the value on the other side of the deque to be deleted.

Parameters:

value – The value to forcefully push onto the deque.

push_left_relaxed(value)[source]

Push object onto left side of the deque. If there is no space available, we block until there is space.

Parameters:

value – The value to push onto the stack.

push_right_force(value)[source]

Push object onto right side of the deque. If there is no space available, we forcefully push the object onto the deque, causing the value on the other side of the deque to be deleted.

Parameters:

value – The value to forcefully push onto the deque.

push_right_relaxed(value)[source]

Push object onto right side of the deque. If there is no space available, we block until there is space.

Parameters:

value – The value to push onto the stack.