1 #ifndef RTC_VideoRender_H_
2 #define RTC_VideoRender_H_
22 virtual void onFirstFrameArrived(
IVideoRender* render) = 0;
46 for (ListenersType::size_type i = 0; i < pListeners_.size(); ++i) {
47 if (pListener == pListeners_[i]) {
51 pListeners_.push_back(pListener);
60 for (ListenersType::iterator it = pListeners_.begin(); it != pListeners_.end(); it++) {
61 if ((*it) == pListener) {
62 pListeners_.erase(it);
69 ListenersType listeners = pListeners_;
71 for (ListenersType::const_iterator it = listeners.begin(); it != listeners.end(); it++) {
72 (*it)->OnDestroy(
this);
93 virtual void SetSize(
int width,
int height) = 0;
98 virtual void RenderFrame(
const IVideoFrame* frame) = 0;
202 Scale_Aspect_Fit = 2,
203 Scale_Aspect_Full = 3,
208 const bool fullscreen,
bool isgdi =
false);
212 CreateVideoRender(
const uint32 renderId,
214 const float left,
const float top,
215 const float right,
const float bottom) = 0;
219 ScalingType scalingType,
220 const float left,
const float top,
221 const float right,
const float bottom) = 0;
224 DeleteVideoRender(
const uint32 renderId) = 0;
226 virtual int32 StartRender(
const uint32 renderId) = 0;
228 virtual int32 StopRender(
const uint32 renderId) = 0;
233 virtual bool SetScalingType(
const uint32 renderId, ScalingType type) = 0;
238 virtual ScalingType RenderScalingType(
const uint32 renderId) = 0;
240 virtual int32 UpdateWindowSize() = 0;
242 virtual int32 SetBitmap(
const void* bitMap,
243 const uint8 pictureId,
244 const void* colorKey,
245 const float left,
const float top,
246 const float right,
const float bottom) = 0;
250 const int32 textLength,
251 const uint32 textColorRef,
252 const uint32 backgroundColorRef,
253 const float left,
const float top,
254 const float right,
const float bottom) = 0;
258 const int32 textLength,
260 const float left,
const float top,
261 const float rigth,
const float bottom,
267 const char* faceName,
268 const int32 faceNameSize) = 0;
285 virtual bool InitToBlack(
int w,
int h,
size_t pixel_width,
286 size_t pixel_height,
int64 elapsed_time,
287 int64 time_stamp) = 0;
293 virtual bool Reset(
uint32 fourcc,
int w,
int h,
int dw,
int dh,
uint8 *sample,
294 size_t sample_size,
size_t pixel_width,
295 size_t pixel_height,
int64 elapsed_time,
int64 time_stamp,
299 virtual size_t GetWidth()
const = 0;
300 virtual size_t GetHeight()
const = 0;
305 virtual const uint8 *GetYPlane()
const = 0;
306 virtual const uint8 *GetUPlane()
const = 0;
307 virtual const uint8 *GetVPlane()
const = 0;
308 virtual uint8 *GetYPlane() = 0;
309 virtual uint8 *GetUPlane() = 0;
310 virtual uint8 *GetVPlane() = 0;
312 virtual int32 GetYPitch()
const = 0;
313 virtual int32 GetUPitch()
const = 0;
314 virtual int32 GetVPitch()
const = 0;
319 virtual void* GetNativeHandle()
const = 0;
323 virtual size_t GetPixelWidth()
const = 0;
324 virtual size_t GetPixelHeight()
const = 0;
326 virtual int64 GetElapsedTime()
const = 0;
327 virtual int64 GetTimeStamp()
const = 0;
328 virtual void SetElapsedTime(
int64 elapsed_time) = 0;
329 virtual void SetTimeStamp(
int64 time_stamp) = 0;
332 virtual int GetRotation()
const = 0;
344 virtual bool MakeExclusive() = 0;
350 virtual size_t CopyToBuffer(
uint8 *buffer,
size_t size)
const = 0;
356 virtual bool CopyToPlanes(
361 virtual void CopyToFrame(
IVideoFrame* target)
const = 0;
367 virtual size_t ConvertToRgbBuffer(
uint32 to_fourcc,
uint8 *buffer,
368 size_t size,
int stride_rgb)
const = 0;
374 virtual void StretchToPlanes(
376 size_t width,
size_t height,
bool interpolate,
bool crop)
const = 0;
382 virtual void StretchToFrame(
IVideoFrame *target,
bool interpolate,
383 bool crop)
const = 0;
389 virtual IVideoFrame *Stretch(
size_t w,
size_t h,
bool interpolate,
390 bool crop)
const = 0;
393 virtual bool SetToBlack() = 0;
396 virtual IVideoFrame *CopyRange(
int x,
int y,
int w,
int h)
const = 0;
399 static bool Validate(
uint32 fourcc,
int w,
int h,
const uint8 *sample,
403 static size_t SizeOf(
size_t w,
size_t h) {
404 return w * h + ((w + 1) / 2) * ((h + 1) / 2) * 2;
410 #endif//RTC_VideoRender_H_
static size_t SizeOf(size_t w, size_t h)
Definition: videorender.h:403
virtual ~IVideoFrame()
Definition: videorender.h:283
size_t GetChromaWidth() const
Definition: videorender.h:301
Definition: videorender.h:277
virtual Result GetWindowId(WindowId &id) const
Definition: videorender.h:125
NAMESPACE_TEE3_BEGIN typedef std::string String
Definition: common.h:10
Definition: videorender.h:198
int int32
Definition: defines.h:394
virtual Result GetAnnotation(tee3::avd::IMAnnotation **atn)
Definition: videorender.h:153
ListenersType pListeners_
Definition: videorender.h:77
Definition: mremotectrl.h:77
size_t GetChromaHeight() const
Definition: videorender.h:302
virtual ~IVideoRender()
Definition: videorender.h:194
int Result
Definition: combase.h:13
#define Err_Not_Implemented
Definition: errorcode.h:20
#define RT_API_EXPORT
Definition: defines.h:188
virtual Result CaptureImage(const String &fileName, int quality)
Definition: videorender.h:116
ScalingType
Definition: videorender.h:200
Definition: videorender.h:33
virtual ~IFirstFrameListener()
Definition: videorender.h:24
unsigned int uint32
Definition: defines.h:393
Definition: videorender.h:274
virtual Result SetAnnotation(tee3::avd::IMAnnotation *atn)
Definition: videorender.h:144
long long int64
Definition: defines.h:383
virtual ~IVideoRenderView()
Definition: videorender.h:270
Definition: videorender.h:16
Definition: videorender.h:276
virtual Result setFirstFrameListener(IFirstFrameListener *listener)
Definition: videorender.h:164
virtual Result GetSize(int &width, int &height) const
Definition: videorender.h:135
Definition: videorender.h:85
Definition: videorender.h:275
virtual Result RemoveDestroyNotify(IListener *pListener)
Definition: videorender.h:59
virtual Result AddDestroyNotify(IListener *pListener)
Definition: videorender.h:45
#define AVD_OK
Definition: errorcode.h:7
Definition: videorender.h:281
virtual ~DestroyNotify()
Definition: videorender.h:68
virtual Result EnableCapture(bool enable)
Definition: videorender.h:107
unsigned char uint8
Definition: defines.h:397
virtual int32 SetRemoteCtrlModule(IRemoteCtrl *remote, std::string othersideuid)
Definition: videorender.h:179
size_t GetChromaSize() const
Definition: videorender.h:303
Definition: audiocapture.h:5
Definition: videorender.h:35
std::vector< IListener * > ListenersType
Definition: videorender.h:39
Definition: mannotation.h:27
virtual bool getIsGdiView()
Definition: videorender.h:186