DiCE API nvidia_logo_transpbg.gif Up
ibridge_video_client.h
Go to the documentation of this file.
1/***************************************************************************************************
2 * Copyright 2023 NVIDIA Corporation. All rights reserved.
3 **************************************************************************************************/
6
7#ifndef MI_UNPUBLISHED_BRIDGE_VIDEO_CLIENT_H
8#define MI_UNPUBLISHED_BRIDGE_VIDEO_CLIENT_H
9
12#include <mi/neuraylib/idata.h>
13
14namespace mi {
15
16class IData;
17class IString;
18
19namespace neuraylib { class IBuffer; class ICanvas; }
20
21namespace bridge {
22
23class IVideo_source;
24class IVideo_sink;
25
43 mi::base::Interface_declare<0x4b817707,0xa206,0x46a6,0xa2,0xb4,0xb1,0x9b,0x3f,0x10,0x78,0xeb>
44{
45public:
50 virtual void set_video_sink( IVideo_sink* video_sink) = 0;
51
53 virtual IVideo_sink* get_video_sink() const = 0;
54
59 virtual Sint32 set_nvcuvid_device( Sint32 device) = 0;
60
64 virtual Sint32 get_nvcuvid_device() const = 0;
65
71 virtual void close() = 0;
72
77 virtual Uint32 get_id() const = 0;
78};
79
83class IVideo_frame : public
84 mi::base::Interface_declare<0xaf02b8cc,0x772f,0x4415,0x95,0xae,0x8c,0xb4,0xa3,0xf6,0xd9,0xdd>
85{
86public:
88 virtual neuraylib::ICanvas* get_canvas() const = 0;
89
91 virtual const char* get_video_format() const = 0;
92
94 virtual Float32 get_encode_time() const = 0;
95
97 virtual Float32 get_decode_time() const = 0;
98
100 virtual Size get_compressed_size() const = 0;
101
105 virtual IData* get_video_format_attribute(const char* attribute) const = 0;
106
107 template <typename T>
108 T* get_video_format_attribute(const char* attribute) const
109 {
110 IData* attr = get_video_format_attribute(attribute);
111 if(!attr)
112 return 0;
113 return static_cast<T*>(attr->get_interface( typename T::IID()));
114 }
115};
116
121class IVideo_sink : public
122 mi::base::Interface_declare<0xa94825d1,0x1ed8,0x4465,0x8d,0x80,0x9e,0x1f,0xf7,0xc6,0x1e,0x65>
123{
124public:
135 virtual void video_frame( IVideo_frame* video_frame, neuraylib::IBuffer* frame_data) = 0;
136
146 virtual void video_progress( Float64 value, const char* area, const char* message) = 0;
147
152 virtual void video_error( Sint32 error_code, const char* error_message) = 0;
153
160 virtual void video_context_closed( Sint32 reason) = 0;
161};
162 // end group mi_neuray_bridge_client
164
165} // namespace bridge
166
167} // namespace mi
168
169#endif // MI_UNPUBLISHED_BRIDGE_VIDEO_CLIENT_H
This interface is the base interface of all types.
Definition: idata.h:297
Mixin class template for deriving new interface declarations.
Definition: interface_declare.h:43
Client-side video context that receives and decodes video frames from the corresponding server-side v...
Definition: ibridge_video_client.h:44
virtual Sint32 set_nvcuvid_device(Sint32 device)=0
Sets the GPU to use for nvcuvid hardware h264 decoding.
virtual void close()=0
Closes the video stream associated with this context and frees all resources.
virtual Uint32 get_id() const =0
Returns the ID of this video context.
virtual void set_video_sink(IVideo_sink *video_sink)=0
Sets the video sink that will receive the decoded video frames sent from the server.
virtual Sint32 get_nvcuvid_device() const =0
Returns the GPU uses for nvcuvid hardware h264 decoding.
virtual IVideo_sink * get_video_sink() const =0
Returns the currently set video sink, or NULL if none is set.
Represents the data for a single video frame.
Definition: ibridge_video_client.h:85
virtual const char * get_video_format() const =0
The video format used when encoding this frame on the server.
virtual Float32 get_encode_time() const =0
The encoding time in seconds.
virtual IData * get_video_format_attribute(const char *attribute) const =0
Returns a video format attribute by name.
virtual Float32 get_decode_time() const =0
The decoding time in seconds.
virtual neuraylib::ICanvas * get_canvas() const =0
Returns the canvas that contains the decoded frame data.
virtual Size get_compressed_size() const =0
The size of the encoded frame in bytes.
Abstract interface to receive video frames produced by the corresponding server-side video context.
Definition: ibridge_video_client.h:123
virtual void video_context_closed(Sint32 reason)=0
Called when the video context has been closed.
virtual void video_progress(Float64 value, const char *area, const char *message)=0
Called when progress messages arrive for the next frame from the server-side video source.
virtual void video_error(Sint32 error_code, const char *error_message)=0
Called if rendering or encoding on the server failed.
virtual void video_frame(IVideo_frame *video_frame, neuraylib::IBuffer *frame_data)=0
Called when a frame has arrived from the corresponding server side video context.
Abstract interface for a canvas represented by a rectangular array of tiles.
Definition: icanvas.h:85
virtual const IInterface * get_interface(const Uuid &interface_id) const =0
Acquires a const interface from another.
unsigned int Uint32
32-bit unsigned integer.
Definition: types.h:49
Uint64 Size
Unsigned integral type that is large enough to hold the size of all types.
Definition: types.h:112
double Float64
64-bit float.
Definition: types.h:52
float Float32
32-bit float.
Definition: types.h:51
signed int Sint32
32-bit signed integer.
Definition: types.h:46
Types.
Mixin class template for deriving new interface declarations.
Common namespace for APIs of NVIDIA Advanced Rendering Center GmbH.
Definition: dice.h:89
Typedefs for types from the math API.