Manages a display thread for rendering buffers and reporting callbacks. More...
#include <PvDisplayThread.h>
Public Member Functions | |
| PvDisplayThread () | |
| Constructor. | |
| virtual | ~PvDisplayThread () |
| Destructor. | |
| PvResult | Start (PvPipeline *aPipeline, PvGenParameterArray *aParameters) |
| Starts the display thread using the provided pipeline and parameters. More... | |
| PvResult | Stop (bool aWait) |
| Stops the display thread. More... | |
| PvResult | WaitComplete () |
| Waits for the display thread to finish stopping. More... | |
| bool | IsRunning () const |
| Indicates whether the display thread is running. More... | |
| uint32_t | GetPriority () const |
| Gets the display thread priority. More... | |
| PvResult | SetPriority (uint32_t aPriority) |
| Sets the display thread priority. More... | |
| PvBuffer * | RetrieveLatestBuffer () |
| Retrieves the most recent buffer from the pipeline. More... | |
| void | ReleaseLatestBuffer () |
| Releases the most recent buffer previously retrieved. More... | |
| PvBuffer * | RetrieveCompressedBuffer () |
| Retrieves the most recent compressed buffer. More... | |
| void | ReleaseCompressedBuffer () |
| Releases the most recent compressed buffer previously retrieved. More... | |
| bool | GetKeepPartialImagesEnabled () const |
| Gets whether partial images are kept instead of dropped. More... | |
| void | SetKeepPartialImagesEnabled (bool aEnabled) |
| Enables or disables keeping partial images. More... | |
| bool | GetBufferLogErrorEnabled () const |
| Gets whether buffer error logging is enabled. More... | |
| void | SetBufferLogErrorEnabled (bool aValue) |
| Enables or disables buffer error logging. More... | |
| bool | GetBufferLogAllEnabled () const |
| Gets whether all buffer logging is enabled. More... | |
| void | SetBufferLogAllEnabled (bool aValue) |
| Enables or disables logging for all buffers. More... | |
| bool | GetChunkLogEnabled () const |
| Gets whether chunk data logging is enabled. More... | |
| void | SetChunkLogEnabled (bool aValue) |
| Enables or disables chunk data logging. More... | |
| PvDeinterlacingType | GetDeinterlacing () const |
| Gets the deinterlacing mode. More... | |
| void | SetDeinterlacing (PvDeinterlacingType aValue) |
| Sets the deinterlacing mode. More... | |
| uint32_t | GetFPS () const |
| Gets the current frames-per-second (FPS). More... | |
| uint32_t | GetTargetFPS () const |
| Gets the target frames-per-second (FPS). More... | |
| void | SetTargetFPS (uint32_t aValue) |
| Sets the target frames-per-second (FPS). More... | |
| bool | GetVSyncEnabled () const |
| Gets whether vertical sync is enabled. More... | |
| void | SetVSyncEnabled (bool aEnabled) |
| Enables or disables vertical sync. More... | |
| bool | GetDisplayChunkDataEnabled () const |
| Gets whether chunk data is displayed. More... | |
| void | SetDisplayChunkDataEnabled (bool aEnabled) |
| Enables or disables chunk data display. More... | |
| PvTapGeometryEnum | GetTapGeometry () const |
| Gets the current tap geometry used for display. More... | |
| void | SetTapGeometry (PvTapGeometryEnum aGeometry) |
| Sets the tap geometry used for display. More... | |
| void | ResetStatistics () |
| Resets display statistics. More... | |
| virtual PvResult | Save (PvPropertyList &aPropertyList) |
| Saves display thread settings to a property list. More... | |
| virtual PvResult | Load (PvPropertyList &aPropertyList) |
| Loads display thread settings from a property list. 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... | |
Manages a display thread for rendering buffers and reporting callbacks.
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 buffer logging is enabled.
Gets whether all buffers are logged (invoking the log callback)
| bool PvDisplayThread::GetBufferLogErrorEnabled | ( | ) | const |
Gets whether buffer error logging is enabled.
Gets whether buffer errors are logged (invoking the log callback)
| bool PvDisplayThread::GetChunkLogEnabled | ( | ) | const |
Gets whether chunk data logging is enabled.
Gets whether buffer chunks are logged (invoking the log callback)
| PvDeinterlacingType PvDisplayThread::GetDeinterlacing | ( | ) | const |
Gets the deinterlacing mode.
Gets the current deinterlacing mode.
Only applicable if displaying an interlaced video stream.
| bool PvDisplayThread::GetDisplayChunkDataEnabled | ( | ) | const |
Gets whether chunk data is displayed.
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 |
Gets the current frames-per-second (FPS).
Returns the average, effective frame per second rate.
| bool PvDisplayThread::GetKeepPartialImagesEnabled | ( | ) | const |
Gets whether partial images are kept instead of dropped.
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 |
Gets the current tap geometry used for display.
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 |
Gets the target frames-per-second (FPS).
Returns the targeted frame per second rate.
| bool PvDisplayThread::GetVSyncEnabled | ( | ) | const |
Gets whether vertical sync is enabled.
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 |
Indicates whether the display thread is running.
Returns whether the display thread is running or not.
|
virtual |
Loads display thread settings from a property list.
Restores a display thread options.
| [in] | aPropertyList | Property list containing settings to load. |
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. |
| void PvDisplayThread::ReleaseCompressedBuffer | ( | ) |
Releases the most recent compressed buffer previously retrieved.
Releases the buffer obtained through RetrieveCompressedBuffer.
| void PvDisplayThread::ReleaseLatestBuffer | ( | ) |
Releases the most recent buffer previously retrieved.
Releases the buffer obtained through RetrieveLatestBuffer.
| void PvDisplayThread::ResetStatistics | ( | ) |
Resets display statistics.
Resets the statistics of the display thread.
| PvBuffer * PvDisplayThread::RetrieveCompressedBuffer | ( | ) |
Retrieves the most recent compressed buffer.
Returns a pointer to the latest compressed buffer.
Important: calling this method pretty much blocks the display thread. You need to call ReleaseCompressedBuffer in order to unblock the display thread.
| PvBuffer * PvDisplayThread::RetrieveLatestBuffer | ( | ) |
Retrieves the most recent buffer from the pipeline.
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 |
Saves display thread settings to a property list.
Persists the current display thread configuration.
| [out] | aPropertyList | Property list to receive current settings. |
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 | ) |
Enables or disables logging for all buffers.
Sets whether all buffers are logged or not.
| [in] | aValue | True to log all buffers, false to disable. |
| aValue | [in] True if enabled. |
| void PvDisplayThread::SetBufferLogErrorEnabled | ( | bool | aValue | ) |
Enables or disables buffer error logging.
Sets whether buffer errors are logged or not.
| [in] | aValue | True to log buffer errors, false to disable. |
| aValue | [in] True if enabled. |
| void PvDisplayThread::SetChunkLogEnabled | ( | bool | aValue | ) |
Enables or disables chunk data logging.
Sets whether buffer chunks are logged or not.
| [in] | aValue | True to enable chunk logging, false to disable. |
| aValue | [in] True if enabled. |
| void PvDisplayThread::SetDeinterlacing | ( | PvDeinterlacingType | aValue | ) |
Sets the deinterlacing mode.
| [in] | aValue | Deinterlacing mode to apply. |
Only applicable if display an interlaced video stream.
| [in] | aValue | Deinterlacing mdoe. |
| void PvDisplayThread::SetDisplayChunkDataEnabled | ( | bool | aEnabled | ) |
Enables or disables chunk data display.
Sets if the data chunks should be displayed as a text overlay.
| [in] | aEnabled | True to display chunk data, false otherwise. |
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 | ) |
Enables or disables keeping partial images.
Sets whether or not the display thread will attempt to display partial images.
| [in] | aEnabled | True to keep partial images, false to drop them. |
| [in] | aEnabled | True to attempt to display partial images. |
| PvResult PvDisplayThread::SetPriority | ( | uint32_t | aPriority | ) |
Sets the display thread priority.
Set the priority of the display thread.
| [in] | aPriority | Priority value to assign to 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 used for display.
Sets the tap geometry to be used to tap reconstruction.
| [in] | aGeometry | Tap geometry to use. |
| [in] | aGeometry | Tap geometry: use PvTapGeometryUnknown to disable. |
| void PvDisplayThread::SetTargetFPS | ( | uint32_t | aValue | ) |
Sets the target frames-per-second (FPS).
Sets the targeted frame per second rate.
| [in] | aValue | Target FPS value. |
| [in] | aValue | Targeted frame per second rate. |
| void PvDisplayThread::SetVSyncEnabled | ( | bool | aEnabled | ) |
Enables or disables vertical sync.
Sets vertical synchronization flag.
| [in] | aEnabled | True to enable VSync, false to disable. |
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 using the provided pipeline and parameters.
Starts the display thread.
| [in] | aPipeline | Pointer to the PvPipeline to retrieve buffers from. |
| [in] | aParameters | Pointer to the PvGenParameterArray for configuration. |
| [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 | Indicates whether to wait for the thread to stop. |
| [in] | aWait | If true, waits until the thread completes. If false, call WaitComplete to wait |
| PvResult PvDisplayThread::WaitComplete | ( | ) |
Waits for the display thread to finish stopping.
Stops the display thread.
Copyright (c) 2002-2026 Pleora Technologies Inc.
www.pleora.com