mi::bridge::IVideo_source Class Reference
[Bridge server]
Description
Abstract interface to generate video frames that are transmitted to the corresponding client-side video context.
See also:
mi::bridge::IServer_video_context::set_video_source()
Public Member Functions
- virtual void video_context_closed( Sint32 reason) =0
- Called when the video context has been closed. More...
- virtual void video_error( Sint32 error_code, const char* message) =0
- Called if the video context failed to encode or send the last frame delivered by a call to video_get_next_frame(). More...
- virtual Sint32 video_get_next_frame( neuraylib::ICanvas** frame, neuraylib::IBuffer** data) =0
- Returns data for the next frame. More...
Member Functions
- virtual void mi::bridge::IVideo_source::video_context_closed( Sint32 reason) [pure virtual]
-
Called when the video context has been closed.
Parameters
- reason
-
- 0: Closed by the server.
- 1: Closed by the client.
- -1: Network error.
- virtual void mi::bridge::IVideo_source::video_error( Sint32 error_code, const char* message) [pure virtual]
-
Called if the video context failed to encode or send the last frame delivered by a call to video_get_next_frame().
Parameters
- error_code
-
- -1: Invalid canvas. The canvas has unsupported features, or is not compatible with current settings.
- -3: Network error. Lost connection to the client.
- -4: Encoding error. Failed to encode the frame.
- message
- A short description of the error.
- virtual Sint32 mi::bridge::IVideo_source::video_get_next_frame( neuraylib::ICanvas** frame, neuraylib::IBuffer** data) [pure virtual]
-
Returns data for the next frame. The Bridge video protocol calls this method in response to a call to mi::bridge::IServer_video_context::frame_ready().
The data buffer can contain data associated with the canvas, or, if it suits the application more, it can be sent instead of a canvas. The raw data buffer will be delivered to the client as is (not encoded or compressed in any way) and it is up to the application to define the format of the data.
Note:The content of *frame and *data must not be modified until the next call of this method.
Parameters
- frame
- The optional frame to send. *frame can be NULL if only data is to be sent. If both *frame and *data are NULL, nothing will be sent.
- data
- The optional data to send. *data can be NULL if only a frame is to be sent. If both *frame and *data are NULL, nothing will be sent.
Returns
0 in case of success, < 0 in case of failure.