1 #ifndef RTC_VideoRender_H_ 2 #define RTC_VideoRender_H_ 30 for (ListenersType::size_type i = 0; i < pListeners_.size(); ++i) {
31 if (pListener == pListeners_[i]) {
35 pListeners_.push_back(pListener);
44 for (ListenersType::iterator it = pListeners_.begin(); it != pListeners_.end(); it++) {
45 if ((*it) == pListener) {
46 pListeners_.erase(it);
53 ListenersType listeners = pListeners_;
55 for (ListenersType::const_iterator it = listeners.begin(); it != listeners.end(); it++) {
56 (*it)->OnDestroy(
this);
77 virtual void SetSize(
int width,
int height) = 0;
82 virtual void RenderFrame(
const IVideoFrame* frame) = 0;
162 Scale_Aspect_Fit = 2,
163 Scale_Aspect_Full = 3,
168 const bool fullscreen,
bool isgdi =
false);
172 CreateVideoRender(
const uint32 renderId,
174 const float left,
const float top,
175 const float right,
const float bottom) = 0;
180 const float left,
const float top,
181 const float right,
const float bottom) = 0;
184 DeleteVideoRender(
const uint32 renderId) = 0;
186 virtual int32 StartRender(
const uint32 renderId) = 0;
188 virtual int32 StopRender(
const uint32 renderId) = 0;
200 virtual int32 UpdateWindowSize() = 0;
202 virtual int32 SetBitmap(
const void* bitMap,
203 const uint8 pictureId,
204 const void* colorKey,
205 const float left,
const float top,
206 const float right,
const float bottom) = 0;
210 const int32 textLength,
211 const uint32 textColorRef,
212 const uint32 backgroundColorRef,
213 const float left,
const float top,
214 const float right,
const float bottom) = 0;
218 const int32 textLength,
220 const float left,
const float top,
221 const float rigth,
const float bottom,
227 const char* faceName,
228 const int32 faceNameSize) = 0;
245 virtual bool InitToBlack(
int w,
int h,
size_t pixel_width,
246 size_t pixel_height,
int64 elapsed_time,
247 int64 time_stamp) = 0;
253 virtual bool Reset(
uint32 fourcc,
int w,
int h,
int dw,
int dh,
uint8 *sample,
254 size_t sample_size,
size_t pixel_width,
255 size_t pixel_height,
int64 elapsed_time,
int64 time_stamp,
259 virtual size_t GetWidth()
const = 0;
260 virtual size_t GetHeight()
const = 0;
265 virtual const uint8 *GetYPlane()
const = 0;
266 virtual const uint8 *GetUPlane()
const = 0;
267 virtual const uint8 *GetVPlane()
const = 0;
268 virtual uint8 *GetYPlane() = 0;
269 virtual uint8 *GetUPlane() = 0;
270 virtual uint8 *GetVPlane() = 0;
272 virtual int32 GetYPitch()
const = 0;
273 virtual int32 GetUPitch()
const = 0;
274 virtual int32 GetVPitch()
const = 0;
279 virtual void* GetNativeHandle()
const = 0;
283 virtual size_t GetPixelWidth()
const = 0;
284 virtual size_t GetPixelHeight()
const = 0;
286 virtual int64 GetElapsedTime()
const = 0;
287 virtual int64 GetTimeStamp()
const = 0;
288 virtual void SetElapsedTime(
int64 elapsed_time) = 0;
289 virtual void SetTimeStamp(
int64 time_stamp) = 0;
292 virtual int GetRotation()
const = 0;
304 virtual bool MakeExclusive() = 0;
310 virtual size_t CopyToBuffer(
uint8 *buffer,
size_t size)
const = 0;
316 virtual bool CopyToPlanes(
321 virtual void CopyToFrame(
IVideoFrame* target)
const = 0;
327 virtual size_t ConvertToRgbBuffer(
uint32 to_fourcc,
uint8 *buffer,
328 size_t size,
int stride_rgb)
const = 0;
334 virtual void StretchToPlanes(
336 size_t width,
size_t height,
bool interpolate,
bool crop)
const = 0;
342 virtual void StretchToFrame(
IVideoFrame *target,
bool interpolate,
343 bool crop)
const = 0;
349 virtual IVideoFrame *Stretch(
size_t w,
size_t h,
bool interpolate,
350 bool crop)
const = 0;
353 virtual bool SetToBlack() = 0;
356 virtual IVideoFrame *CopyRange(
int x,
int y,
int w,
int h)
const = 0;
359 static bool Validate(
uint32 fourcc,
int w,
int h,
const uint8 *sample,
363 static size_t SizeOf(
size_t w,
size_t h) {
364 return w * h + ((w + 1) / 2) * ((h + 1) / 2) * 2;
370 #endif//RTC_VideoRender_H_ size_t GetChromaWidth() const
Definition: videorender.h:261
Definition: videorender.h:237
int int32
Definition: defines.h:392
int Result
返回值类型
Definition: combase.h:9
#define Err_Not_Implemented
Definition: errorcode.h:20
视频渲染接口类
Definition: videorender.h:69
#define RT_API_EXPORT
Definition: defines.h:186
virtual Result SetAnnotation(tee3::avd::IMAnnotation *atn)
设置注释接口
Definition: videorender.h:128
ListenersType pListeners_
Definition: videorender.h:61
virtual Result EnableCapture(bool enable)
启停图像抓取功能
Definition: videorender.h:91
unsigned int uint32
Definition: defines.h:391
virtual Result RemoveDestroyNotify(IListener *pListener)
删除渲染对象销毁回调指针
Definition: videorender.h:43
Definition: videorender.h:234
long long int64
Definition: defines.h:381
std::string String
tee3定义的String类型
Definition: common.h:10
virtual ~DestroyNotify()
Definition: videorender.h:52
virtual ~IVideoRenderView()
Definition: videorender.h:230
Definition: videorender.h:236
virtual Result GetWindowId(WindowId &id) const
获取render所在的WindowId
Definition: videorender.h:109
virtual ~IVideoFrame()
Definition: videorender.h:243
Definition: videorender.h:235
Definition: videorender.h:158
virtual Result GetAnnotation(tee3::avd::IMAnnotation **atn)
获取注释接口
Definition: videorender.h:137
virtual Result GetSize(int &width, int &height) const
获取图像大小
Definition: videorender.h:119
#define AVD_OK
Definition: errorcode.h:7
Definition: mannotation.h:18
std::vector< IListener * > ListenersType
Definition: videorender.h:23
unsigned char uint8
Definition: defines.h:395
Definition: videorender.h:241
virtual Result CaptureImage(const String &fileName, int quality)
抓取图像
Definition: videorender.h:100
virtual Result AddDestroyNotify(IListener *pListener)
设置渲染对象销毁回调指针
Definition: videorender.h:29
static size_t SizeOf(size_t w, size_t h)
Definition: videorender.h:363
Definition: audiocapture.h:5
size_t GetChromaHeight() const
Definition: videorender.h:262
virtual ~IVideoRender()
Definition: videorender.h:153
ScalingType
Definition: videorender.h:160
size_t GetChromaSize() const
Definition: videorender.h:263
外部对象销毁通知接口
Definition: videorender.h:17
Definition: videorender.h:19