Thread taking buffers out of a PvPipeline in order to display them. More...
Public Member Functions | |
PvDisplayThread () | |
Constructor. | |
virtual | ~PvDisplayThread () |
Destructor. | |
PvResult | Start (PvPipeline *aPipeline, PvGenParameterArray *aParameters) |
Starts the display thread. More... | |
PvResult | Stop (bool aWait) |
Stops the display thread. More... | |
PvResult | WaitComplete () |
Stops the display thread. More... | |
bool | IsRunning () const |
Returns whether the display thread is running or not. More... | |
uint32_t | GetPriority () const |
Gets the display thread priority. More... | |
PvResult | SetPriority (uint32_t aPriority) |
Set the priority of the display thread. More... | |
PvBuffer * | RetrieveLatestBuffer () |
Returns a pointer to the latest retrieved buffer. More... | |
void | ReleaseLatestBuffer () |
Releases the buffer obtained through RetrieveLatestBuffer. | |
bool | GetKeepPartialImagesEnabled () const |
Returns true if the display thread will attempt to display partial images. More... | |
void | SetKeepPartialImagesEnabled (bool aEnabled) |
Sets whether or not the display thread will attempt to display partial images. More... | |
bool | GetBufferLogErrorEnabled () const |
Gets whether buffer errors are logged (invoking the log callback) More... | |
void | SetBufferLogErrorEnabled (bool aValue) |
Sets whether buffer errors are logged or not. More... | |
bool | GetBufferLogAllEnabled () const |
Gets whether all buffers are logged (invoking the log callback) More... | |
void | SetBufferLogAllEnabled (bool aValue) |
Sets whether all buffers are logged or not. More... | |
bool | GetChunkLogEnabled () const |
Gets whether buffer chunks are logged (invoking the log callback) More... | |
void | SetChunkLogEnabled (bool aValue) |
Sets whether buffer chunks are logged or not. More... | |
PvDeinterlacingType | GetDeinterlacing () const |
Gets the current deinterlacing mode. More... | |
void | SetDeinterlacing (PvDeinterlacingType aValue) |
Sets the deinterlacing mode. More... | |
uint32_t | GetFPS () const |
Returns the average, effective frame per second rate. More... | |
uint32_t | GetTargetFPS () const |
Returns the targeted frame per second rate. More... | |
void | SetTargetFPS (uint32_t aValue) |
Sets the targeted frame per second rate. More... | |
bool | GetVSyncEnabled () const |
Returns true if vertical synchronization flags is set. More... | |
void | SetVSyncEnabled (bool aEnabled) |
Sets vertical synchronization flag. More... | |
bool | GetDisplayChunkDataEnabled () const |
Returns true if data chunks should be displayed as a text overlay. More... | |
void | SetDisplayChunkDataEnabled (bool aEnabled) |
Sets if the data chunks should be displayed as a text overlay. More... | |
PvTapGeometryEnum | GetTapGeometry () const |
Returns the tap geometry the display thread is configured with. More... | |
void | SetTapGeometry (PvTapGeometryEnum aGeometry) |
Sets the tap geometry to be used to tap reconstruction. More... | |
void | ResetStatistics () |
Resets the statistics of the display thread. | |
virtual PvResult | Save (PvPropertyList &aPropertyList) |
Persists the current display thread configuration. More... | |
virtual PvResult | Load (PvPropertyList &aPropertyList) |
Restores a display thread options. More... | |
Protected Member Functions | |
virtual void | OnBufferRetrieved (PvBuffer *aBuffer) |
Override to get a callback when a buffer is retrieved from the pipeline. More... | |
virtual void | OnBufferDisplay (PvBuffer *aBuffer) |
Override to get a callback when a buffer needs to be displayed. More... | |
virtual void | OnBufferDone (PvBuffer *aBuffer) |
Override to get a just before a buffers is returned to the pipeline. More... | |
virtual void | OnBufferLog (const PvString &aLog) |
Override to get a logging events from the display thread. More... | |
virtual void | OnBufferTextOverlay (const PvString &aText) |
Override to get a callback about a text overlay to be displayed. More... | |
Thread taking buffers out of a PvPipeline in order to display them.
Inherit your own display thread from this class and override the virtual protected members to carry own the tasks of the display thread.
This class does not know about the display object. It interacts with your display through OnBufferXXX methods.
bool PvDisplayThread::GetBufferLogAllEnabled | ( | ) | const |
Gets whether all buffers are logged (invoking the log callback)
bool PvDisplayThread::GetBufferLogErrorEnabled | ( | ) | const |
Gets whether buffer errors are logged (invoking the log callback)
bool PvDisplayThread::GetChunkLogEnabled | ( | ) | const |
Gets whether buffer chunks are logged (invoking the log callback)
PvDeinterlacingType PvDisplayThread::GetDeinterlacing | ( | ) | const |
Gets the current deinterlacing mode.
Only applicable if displaying an interlaced video stream.
bool PvDisplayThread::GetDisplayChunkDataEnabled | ( | ) | const |
Returns true if data chunks should be displayed as a text overlay.
The specialized class must implement the right overloaded method in order to receive text overlay updates from this class.
uint32_t PvDisplayThread::GetFPS | ( | ) | const |
Returns the average, effective frame per second rate.
bool PvDisplayThread::GetKeepPartialImagesEnabled | ( | ) | const |
Returns true if the display thread will attempt to display partial images.
uint32_t PvDisplayThread::GetPriority | ( | ) | const |
Gets the display thread priority.
PvTapGeometryEnum PvDisplayThread::GetTapGeometry | ( | ) | const |
Returns the tap geometry the display thread is configured with.
If set to a valid tap geometry, tap reconstruction is performed before displaying the image.
Disabled by default (PvTapGeometryUnknown).
uint32_t PvDisplayThread::GetTargetFPS | ( | ) | const |
Returns the targeted frame per second rate.
bool PvDisplayThread::GetVSyncEnabled | ( | ) | const |
Returns true if vertical synchronization flags is set.
The display thread does not use this flag, it only keeps it value so it can be read by specialized classes to request a vertical synchronization when a buffer is displayed.
bool PvDisplayThread::IsRunning | ( | ) | const |
Returns whether the display thread is running or not.
|
virtual |
Restores a display thread options.
The load works on a best effort basis. Whatever can be restored will be restored.
The order to properties in the aPropertyList is not important.
Defined as virtual. Can override in order to load configuration specific to specialized classes.
[in] | aPropertyList | A list of name/value pairs. |
|
protectedvirtual |
Override to get a callback when a buffer needs to be displayed.
Since the display thread does not own the display (the application owning the display thread usually does) this callback is used to ask the application to display a buffer on screen.
[in] | aBuffer | The buffer to display. |
|
protectedvirtual |
Override to get a just before a buffers is returned to the pipeline.
[in] | aBuffer | The buffer about to be returned to the pipeline. |
|
protectedvirtual |
Override to get a logging events from the display thread.
The display thread can be configured to generate various log events. The display thread does not have its own log, it simply calls OnBufferLog. The application must override OnBufferLog and funnel the log entry into its own log.
[in] | aLog | The string to append to a log. |
|
protectedvirtual |
Override to get a callback when a buffer is retrieved from the pipeline.
[in] | aBuffer | The buffer retrieved from the pipeline. |
|
protectedvirtual |
Override to get a callback about a text overlay to be displayed.
Since the display thread does not own the display (the application owning the display thread usually does) this callback is used to ask the application to display a text overlay.
A text overlay can be expected if chunk display is enabled and the buffers retrieved from PvBuffer data chunks.
[in] | aText | The text overlay to be displayed. |
PvBuffer * PvDisplayThread::RetrieveLatestBuffer | ( | ) |
Returns a pointer to the latest retrieved buffer.
Important: calling this method pretty much blocks the display thread. You need to call ReleaseLatestBuffer in order to unblock the display thread.
|
virtual |
Persists the current display thread configuration.
This call builds a list of properties containing pairs of names/values.
Defined as virtual. Can override in order to save configuration specific to specialized classes. Call the base implementation first.
[in] | aPropertyList | A list of pairs of names/values. |
void PvDisplayThread::SetBufferLogAllEnabled | ( | bool | aValue | ) |
Sets whether all buffers are logged or not.
aValue | [in] True if enabled. |
void PvDisplayThread::SetBufferLogErrorEnabled | ( | bool | aValue | ) |
Sets whether buffer errors are logged or not.
aValue | [in] True if enabled. |
void PvDisplayThread::SetChunkLogEnabled | ( | bool | aValue | ) |
Sets whether buffer chunks are logged or not.
aValue | [in] True if enabled. |
void PvDisplayThread::SetDeinterlacing | ( | PvDeinterlacingType | aValue | ) |
Sets the deinterlacing mode.
Only applicable if display an interlaced video stream.
[in] | aValue | Deinterlacing mdoe. |
void PvDisplayThread::SetDisplayChunkDataEnabled | ( | bool | aEnabled | ) |
Sets if the data chunks should be displayed as a text overlay.
The specialized class must implement the right overloaded method in order to receive text overlay updates from this class.
aEnabled | [in] New display chunk data mode. |
void PvDisplayThread::SetKeepPartialImagesEnabled | ( | bool | aEnabled | ) |
Sets whether or not the display thread will attempt to display partial images.
[in] | aEnabled | True to attempt to display partial images. |
PvResult PvDisplayThread::SetPriority | ( | uint32_t | aPriority | ) |
Set the priority of the display thread.
See PvDevice::GetHeartbeatThreadPriority
[in] | aPriority | See PvPipeline::SetBufferHandlingThreadPriority for description of the supported values |
void PvDisplayThread::SetTapGeometry | ( | PvTapGeometryEnum | aGeometry | ) |
Sets the tap geometry to be used to tap reconstruction.
[in] | aGeometry | Tap geometry: use PvTapGeometryUnknown to disable. |
void PvDisplayThread::SetTargetFPS | ( | uint32_t | aValue | ) |
Sets the targeted frame per second rate.
[in] | aValue | Targeted frame per second rate. |
void PvDisplayThread::SetVSyncEnabled | ( | bool | aEnabled | ) |
Sets vertical synchronization flag.
The display thread does not use this flag, it only keeps it value so it can be read by specialized classes to request a vertical synchronization when a buffer is displayed.
This flag will only have an effect if it is used when the specialized class. Not all display implementations support vertical synchronization.
aEnabled | [in] New vertical synchronization flag. |
PvResult PvDisplayThread::Start | ( | PvPipeline * | aPipeline, |
PvGenParameterArray * | aParameters | ||
) |
Starts the display thread.
[in] | aPipeline | The pipeline to retrieve the buffers from. |
[in] | aParameters | The display thread parameters. |
PvResult PvDisplayThread::Stop | ( | bool | aWait | ) |
Stops the display thread.
[in] | aWait | If true, waits until the thread completes. If false, call WaitComplete to wait |
PvResult PvDisplayThread::WaitComplete | ( | ) |
Stops the display thread.
Copyright (c) 2002-2021 Pleora Technologies Inc.
www.pleora.com