|
vdr-plugin-softhddevice-drm-gles 1.5.9-20e15de
|
Thread-safe queue class. More...
#include <queue.h>
Public Member Functions | |
| cQueue (size_t maxSize) | |
| ~cQueue (void) | |
| bool | Push (T *element) |
| Push an element to the front of the queue. | |
| T * | Pop (void) |
| Pop an element from the back of the queue. | |
| T * | Peek (void) |
| Get a reference to the back element. | |
| void | Clear (void) |
| Remove all elements from the queue. | |
| bool | IsEmpty (void) |
| Check if the queue is empty. | |
| bool | IsFull (void) |
| Check if the queue is full. | |
| size_t | Size (void) |
| Get the current size of the queue. | |
Private Attributes | |
| std::deque< T * > | m_deque |
| Underlying deque container. | |
| std::mutex | m_mutex |
| Mutex for thread-safe access. | |
| size_t | m_maxSize |
| Maximum queue capacity. | |
Thread-safe queue class.
This class provides a thread-safe queue implementation using std::deque and std::mutex for synchronization. It supports both FIFO queue operations and bounded capacity management.
| T | The type of elements stored in the queue |
|
inline |
Remove all elements from the queue.
Definition at line 95 of file queue.h.
References cQueue< T >::m_deque, and cQueue< T >::m_mutex.
Referenced by cVideoRender::ClearDecoderToDisplayQueue(), and cVideoRender::ClearPipDecoderToDisplayQueue().
|
inline |
Check if the queue is empty.
Definition at line 106 of file queue.h.
References cQueue< T >::m_deque, and cQueue< T >::m_mutex.
Referenced by cFilterThread::Action(), cVideoStream::ClearVdrCoreToDecoderQueue(), cVideoStream::DecodeInput(), cVideoRender::DisplayFrame(), and cFilterThread::Stop().
|
inline |
Check if the queue is full.
Definition at line 117 of file queue.h.
References cQueue< T >::m_deque, cQueue< T >::m_maxSize, and cQueue< T >::m_mutex.
Referenced by cFilterThread::Action(), cVideoStream::DecodeInput(), cFilterThread::IsInputBufferFull(), and cVideoRender::IsOutputBufferFull().
|
inline |
Get a reference to the back element.
Definition at line 82 of file queue.h.
References cQueue< T >::m_deque, and cQueue< T >::m_mutex.
Referenced by cVideoStream::DecodeInput(), and cVideoStream::OpenDecoder().
|
inline |
Pop an element from the back of the queue.
Definition at line 64 of file queue.h.
References cQueue< T >::m_deque, and cQueue< T >::m_mutex.
Referenced by cFilterThread::Action(), cVideoStream::ClearVdrCoreToDecoderQueue(), cVideoStream::DecodeInput(), cVideoRender::DisplayFrame(), cVideoStream::OpenDecoder(), and cFilterThread::Stop().
|
inline |
Push an element to the front of the queue.
| element | The element to push |
Definition at line 47 of file queue.h.
References cQueue< T >::m_deque, cQueue< T >::m_maxSize, and cQueue< T >::m_mutex.
Referenced by cVideoStream::Flush(), cVideoStream::PushAvPacket(), cFilterThread::PushFrame(), and cVideoRender::PushFrame().
|
inline |
Get the current size of the queue.
Definition at line 128 of file queue.h.
References cQueue< T >::m_deque, and cQueue< T >::m_mutex.
Referenced by cVideoStream::ClearVdrCoreToDecoderQueue(), cVideoStream::GetAvPacketsFilled(), cVideoRender::GetFramesFilled(), cVideoStream::IsInputBufferFull(), and cVideoRender::LogDroppedDuped().
|
private |
Underlying deque container.
Definition at line 135 of file queue.h.
Referenced by cQueue< T >::Clear(), cQueue< T >::IsEmpty(), cQueue< T >::IsFull(), cQueue< T >::Peek(), cQueue< T >::Pop(), cQueue< T >::Push(), and cQueue< T >::Size().
|
private |
Maximum queue capacity.
Definition at line 137 of file queue.h.
Referenced by cQueue< T >::IsFull(), and cQueue< T >::Push().
|
private |
Mutex for thread-safe access.
Definition at line 136 of file queue.h.
Referenced by cQueue< T >::Clear(), cQueue< T >::IsEmpty(), cQueue< T >::IsFull(), cQueue< T >::Peek(), cQueue< T >::Pop(), cQueue< T >::Push(), and cQueue< T >::Size().