#include <RemoteViz/Rendering/FrameEncoders.h>
Public Types | |
enum | Encoder { NONE, JPEG, PNG, H264_NVENC, H264_OPENH264, VP9_VPX } |
enum | Status { SUPPORTED, UNSUPPORTED, INCOMPATIBLE, CLIENT_UNSUPPORTED } |
| |
FrameEncoders () | |
FrameEncoders (const FrameEncoders &obj) | |
FrameEncoders & | operator= (const FrameEncoders &obj) |
~FrameEncoders () | |
void | setInteractiveEncoder (Encoder value) |
Encoder | getInteractiveEncoder () const |
void | setStillEncoder (Encoder value) |
Encoder | getStillEncoder () const |
Status | getInteractiveEncoderStatus () const |
Status | getStillEncoderStatus () const |
Defines a pair of encoders that are used to encode still and interactive frames.
Default value for both still and interactive is NONE when a FrameEncoders object is created. But when a client connects to the service, RemoteViz will set PNG for still frames and JPEG for interactive frames. Frames are considered "interactive" when the user is interacting with the scene, for example dragging the mouse to move the camera. In this case it may be acceptable to use (for example) lossy JPEG encoding to maximize performance, then switch to loss-less PNG encoding for the "still" frame when the user interaction is finished.
Video encoding (H.264 or VP9) generally provides better performance (frames per second) than image encoding (JPEG and PNG). However this depends on many factors. Video encoded frames usually require less bandwidth, but the encoding of each frame can take more time. See the hardware and software dependencies for each encoder below.
A FrameEncoders object is passed to the RenderAreaListener methods onOpenedConnection(), onInitializedConnection() and onRefusedEncoder().
The current frame encoders can also be queried using ConnectionSettings::getFrameEncoders().
See also ConnectionSettings::setFrameEncodingPolicy().
See the examples HelloConeH264 and HelloConeVP9.
Limitations:
Frame encoder.
Frame encoder status.
SUPPORTED |
The encoder can be loaded and used by the service. |
UNSUPPORTED |
Reasons:
|
INCOMPATIBLE |
The pair (still encoder, interactive encoder) is incompatible. |
CLIENT_UNSUPPORTED |
The codec format is not supported by the client (Example: the client does not support H.264 decoding). |
RemoteViz::Rendering::FrameEncoders::FrameEncoders | ( | ) |
Constructor.
RemoteViz::Rendering::FrameEncoders::FrameEncoders | ( | const FrameEncoders & | obj | ) |
Copy constructor.
RemoteViz::Rendering::FrameEncoders::~FrameEncoders | ( | ) |
Destructor.
Encoder RemoteViz::Rendering::FrameEncoders::getInteractiveEncoder | ( | ) | const |
Gets the interactive encoder.
Default value is NONE when a FrameEncoders object is created. But note that, by default, RemoteViz will set this value to JPEG when a connection is initialized.
Status RemoteViz::Rendering::FrameEncoders::getInteractiveEncoderStatus | ( | ) | const |
Gets the interactive encoder status.
Default value is UNSUPPORTED.
Encoder RemoteViz::Rendering::FrameEncoders::getStillEncoder | ( | ) | const |
Gets the still encoder.
Default value is NONE when a FrameEncoders object is created. But note that, by default, RemoteViz will set this value to PNG when a connection is initialized.
Status RemoteViz::Rendering::FrameEncoders::getStillEncoderStatus | ( | ) | const |
Gets the still encoder status.
Default value is UNSUPPORTED.
FrameEncoders& RemoteViz::Rendering::FrameEncoders::operator= | ( | const FrameEncoders & | obj | ) |
Copy assignment operator.
void RemoteViz::Rendering::FrameEncoders::setInteractiveEncoder | ( | Encoder | value | ) |
Sets the interactive encoder.
This encoder will be used to encode interactive frames. Default value is NONE when a FrameEncoders object is created. But note that, by default, RemoteViz will set this value to JPEG when a connection is initialized.
value | : interactive encoder. |
void RemoteViz::Rendering::FrameEncoders::setStillEncoder | ( | Encoder | value | ) |
Sets the still encoder.
This encoder will be used to encode still frames.
Default value is NONE when a FrameEncoders object is created. But note that, by default, RemoteViz will set this value to PNG when a connection is initialized.
value | : still encoder. |