1 #ifndef RTC_VideoRender_H_ 2 #define RTC_VideoRender_H_ 21 virtual void onFirstFrameArrived(
IVideoRender* render) = 0;
47 for (ListenersType::size_type i = 0; i < pListeners_.size(); ++i) {
48 if (pListener == pListeners_[i]) {
52 pListeners_.push_back(pListener);
61 for (ListenersType::iterator it = pListeners_.begin(); it != pListeners_.end(); it++) {
62 if ((*it) == pListener) {
63 pListeners_.erase(it);
75 for (ListenersType::const_iterator it = listeners.begin(); it != listeners.end(); it++) {
76 (*it)->OnDestroy(
this);
97 virtual void SetSize(
int width,
int height) = 0;
102 virtual void RenderFrame(
const IVideoFrame& frame) = 0;
208 Scale_Aspect_Fit = 2,
209 Scale_Aspect_Full = 3,
214 const bool fullscreen,
bool isgdi =
false);
218 CreateVideoRender(
const uint32 renderId,
220 const float left,
const float top,
221 const float right,
const float bottom) = 0;
225 ScalingType scalingType,
226 const float left,
const float top,
227 const float right,
const float bottom) = 0;
230 DeleteVideoRender(
const uint32 renderId) = 0;
232 virtual int32 StartRender(
const uint32 renderId) = 0;
234 virtual int32 StopRender(
const uint32 renderId) = 0;
239 virtual bool SetScalingType(
const uint32 renderId, ScalingType type) = 0;
244 virtual ScalingType RenderScalingType(
const uint32 renderId) = 0;
246 virtual int32 UpdateWindowSize(
bool fillblack =
false) = 0;
249 virtual int32 SetBitmap(
const void* bitMap,
250 const uint8 pictureId,
251 const void* colorKey,
252 const float left,
const float top,
253 const float right,
const float bottom) = 0;
257 const int32 textLength,
258 const uint32 textColorRef,
259 const uint32 backgroundColorRef,
260 const float left,
const float top,
261 const float right,
const float bottom) = 0;
265 const int32 textLength,
267 const float left,
const float top,
268 const float rigth,
const float bottom,
274 const char* faceName,
275 const int32 faceNameSize) = 0;
293 static size_t SizeOf(
size_t w,
size_t h) {
294 return w * h + ((w + 1) / 2) * ((h + 1) / 2) * 2;
297 int32 size()
const {
return width() * height() + ((width() + 1) / 2) * ((height() + 1) / 2) * 2; }
298 virtual int32 width()
const = 0;
299 virtual int32 height()
const = 0;
300 virtual bool is_texture()
const = 0;
302 virtual const uint8 *dataY()
const = 0;
303 virtual const uint8 *dataU()
const = 0;
304 virtual const uint8 *dataV()
const = 0;
306 virtual uint8* mutableDataY() = 0;
307 virtual uint8* mutableDataU() = 0;
308 virtual uint8* mutableDataV() = 0;
310 virtual int32 strideY()
const = 0;
311 virtual int32 strideU()
const = 0;
312 virtual int32 strideV()
const = 0;
314 virtual int32 rotation()
const = 0;
318 size_t size,
int stride_rgb)
const = 0;
321 virtual IVideoFrame *CopyRange(
int x,
int y,
int w,
int h)
const = 0;
322 virtual bool MakeExclusive() = 0;
323 virtual IVideoFrame *Stretch(
size_t w,
size_t h,
bool interpolate,
bool crop)
const = 0;
344 virtual int64 GetTimeStamp()
const = 0;
345 static IVideoFrame *CreateFrame(
uint32 format,
const uint8 *data,
int32 size,
size_t width,
size_t height,
size_t widthDst,
size_t heightDst);
347 static IVideoFrame *CreateFrame(
uint32 format,
const uint8 *src_y,
const uint8 *src_uv,
size_t width,
size_t height,
size_t widthDst,
size_t heightDst);
351 #endif//RTC_VideoRender_H_ void Clear()
Definition: videorender.h:72
ListenersType pListeners_
Definition: videorender.h:82
视频渲染接口类
Definition: videorender.h:90
Definition: annotationobject.h:71
virtual Result RemoveDestroyNotify(IListener *pListener)
删除渲染对象销毁回调指针
Definition: videorender.h:60
Definition: mremotectrl.h:76
Definition: videorender.h:282
virtual ~IListener()
Definition: videorender.h:38
int32 GetYPitch() const
Definition: videorender.h:338
uint8 * GetVPlane()
Definition: videorender.h:336
int int32
Definition: defines.h:388
virtual Result AddDestroyNotify(IListener *pListener)
设置渲染对象销毁回调指针
Definition: videorender.h:46
virtual Result GetWindowId(AvdWindowId &id) const
获取render所在的WindowId
Definition: videorender.h:129
int Result
返回值类型
Definition: combase.h:13
#define Err_Not_Implemented
Definition: errorcode.h:20
uint8 * GetYPlane()
Definition: videorender.h:334
int32 GetUPitch() const
Definition: videorender.h:339
#define RT_API_EXPORT
Definition: defines.h:216
int32 GetVPitch() const
Definition: videorender.h:340
virtual int32 SetRemoteCtrlModule(IRemoteCtrl *remote, std::string othersideuid)
设置远程控制模块,对方userid
Definition: videorender.h:183
Definition: videorender.h:204
virtual IVideoFrame * Copy() const
Definition: videorender.h:342
unsigned int uint32
Definition: defines.h:387
virtual Result FillBlack()
Definition: videorender.h:186
IVideoRender attach到某个视频后,接收到首帧视频的回调
Definition: videorender.h:15
long long int64
Definition: defines.h:377
std::string String
定义的String类型
Definition: common.h:10
int32 size() const
Definition: videorender.h:297
外部对象销毁通知接口
Definition: videorender.h:32
ScalingType
Definition: videorender.h:206
std::vector< IListener * > ListenersType
Definition: videorender.h:40
virtual Result EnableCapture(bool enable)
启停图像抓取功能
Definition: videorender.h:111
Definition: videorender.h:34
virtual Result GetSize(int &width, int &height) const
获取图像大小
Definition: videorender.h:139
virtual Result CaptureImage(const String &fileName, int quality)
抓取图像
Definition: videorender.h:120
Definition: videorender.h:288
size_t GetHeight() const
Definition: videorender.h:326
#define AVD_OK
Definition: errorcode.h:7
virtual ~IVideoFrame()
Definition: videorender.h:290
Definition: videorender.h:284
size_t GetChromaWidth() const
Definition: videorender.h:327
size_t GetWidth() const
Definition: videorender.h:325
virtual Result setFirstFrameListener(IFirstFrameListener *listener)
设置首帧数据回调指针
Definition: videorender.h:168
const uint8 * GetVPlane() const
Definition: videorender.h:333
static size_t SizeOf(size_t w, size_t h)
Definition: videorender.h:293
virtual ~IVideoRender()
Definition: videorender.h:200
const uint8 * GetUPlane() const
Definition: videorender.h:332
Definition: mannotation.h:29
unsigned char uint8
Definition: defines.h:391
virtual Result SetAnnotation(rtc::IMAnnotation *atn)
设置注释接口
Definition: videorender.h:148
size_t GetChromaHeight() const
Definition: videorender.h:328
Definition: videorender.h:281
const uint8 * GetYPlane() const
Definition: videorender.h:331
virtual ~DestroyNotify()
Definition: videorender.h:69
virtual ~IVideoRenderView()
Definition: videorender.h:277
size_t GetChromaSize() const
Definition: videorender.h:329
virtual Result GetAnnotation(rtc::IMAnnotation **atn)
获取注释接口
Definition: videorender.h:157
virtual ~IFirstFrameListener()
Definition: videorender.h:23
Definition: videorender.h:283
uint8 * GetUPlane()
Definition: videorender.h:335
virtual bool getIsGdiView()
获取该render是否用gdi模式创建的
Definition: videorender.h:192