WebRtc_Word32 -> int32_t in video_render/
BUG=314 Review URL: https://webrtc-codereview.appspot.com/1304006 git-svn-id: http://webrtc.googlecode.com/svn/trunk@3810 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
b7192b8247
commit
ddf94e71e5
@ -30,7 +30,7 @@ namespace webrtc {
|
|||||||
JavaVM* VideoRenderAndroid::g_jvm = NULL;
|
JavaVM* VideoRenderAndroid::g_jvm = NULL;
|
||||||
|
|
||||||
#if defined(WEBRTC_ANDROID) && !defined(WEBRTC_CHROMIUM_BUILD)
|
#if defined(WEBRTC_ANDROID) && !defined(WEBRTC_CHROMIUM_BUILD)
|
||||||
WebRtc_Word32 SetRenderAndroidVM(void* javaVM) {
|
int32_t SetRenderAndroidVM(void* javaVM) {
|
||||||
WEBRTC_TRACE(kTraceDebug, kTraceVideoRenderer, -1, "%s", __FUNCTION__);
|
WEBRTC_TRACE(kTraceDebug, kTraceVideoRenderer, -1, "%s", __FUNCTION__);
|
||||||
VideoRenderAndroid::g_jvm = (JavaVM*)javaVM;
|
VideoRenderAndroid::g_jvm = (JavaVM*)javaVM;
|
||||||
return 0;
|
return 0;
|
||||||
@ -38,7 +38,7 @@ WebRtc_Word32 SetRenderAndroidVM(void* javaVM) {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
VideoRenderAndroid::VideoRenderAndroid(
|
VideoRenderAndroid::VideoRenderAndroid(
|
||||||
const WebRtc_Word32 id,
|
const int32_t id,
|
||||||
const VideoRenderType videoRenderType,
|
const VideoRenderType videoRenderType,
|
||||||
void* window,
|
void* window,
|
||||||
const bool /*fullscreen*/):
|
const bool /*fullscreen*/):
|
||||||
@ -71,20 +71,20 @@ VideoRenderAndroid::~VideoRenderAndroid() {
|
|||||||
delete &_critSect;
|
delete &_critSect;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderAndroid::ChangeUniqueId(const WebRtc_Word32 id) {
|
int32_t VideoRenderAndroid::ChangeUniqueId(const int32_t id) {
|
||||||
CriticalSectionScoped cs(&_critSect);
|
CriticalSectionScoped cs(&_critSect);
|
||||||
_id = id;
|
_id = id;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderAndroid::ChangeWindow(void* /*window*/) {
|
int32_t VideoRenderAndroid::ChangeWindow(void* /*window*/) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
VideoRenderCallback*
|
VideoRenderCallback*
|
||||||
VideoRenderAndroid::AddIncomingRenderStream(const WebRtc_UWord32 streamId,
|
VideoRenderAndroid::AddIncomingRenderStream(const uint32_t streamId,
|
||||||
const WebRtc_UWord32 zOrder,
|
const uint32_t zOrder,
|
||||||
const float left, const float top,
|
const float left, const float top,
|
||||||
const float right,
|
const float right,
|
||||||
const float bottom) {
|
const float bottom) {
|
||||||
@ -114,8 +114,8 @@ VideoRenderAndroid::AddIncomingRenderStream(const WebRtc_UWord32 streamId,
|
|||||||
return renderStream;
|
return renderStream;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderAndroid::DeleteIncomingRenderStream(
|
int32_t VideoRenderAndroid::DeleteIncomingRenderStream(
|
||||||
const WebRtc_UWord32 streamId) {
|
const uint32_t streamId) {
|
||||||
CriticalSectionScoped cs(&_critSect);
|
CriticalSectionScoped cs(&_critSect);
|
||||||
|
|
||||||
MapItem* item = _streamsMap.Find(streamId);
|
MapItem* item = _streamsMap.Find(streamId);
|
||||||
@ -131,9 +131,9 @@ WebRtc_Word32 VideoRenderAndroid::DeleteIncomingRenderStream(
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderAndroid::GetIncomingRenderStreamProperties(
|
int32_t VideoRenderAndroid::GetIncomingRenderStreamProperties(
|
||||||
const WebRtc_UWord32 streamId,
|
const uint32_t streamId,
|
||||||
WebRtc_UWord32& zOrder,
|
uint32_t& zOrder,
|
||||||
float& left,
|
float& left,
|
||||||
float& top,
|
float& top,
|
||||||
float& right,
|
float& right,
|
||||||
@ -141,7 +141,7 @@ WebRtc_Word32 VideoRenderAndroid::GetIncomingRenderStreamProperties(
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderAndroid::StartRender() {
|
int32_t VideoRenderAndroid::StartRender() {
|
||||||
CriticalSectionScoped cs(&_critSect);
|
CriticalSectionScoped cs(&_critSect);
|
||||||
|
|
||||||
if (_javaRenderThread) {
|
if (_javaRenderThread) {
|
||||||
@ -174,7 +174,7 @@ WebRtc_Word32 VideoRenderAndroid::StartRender() {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderAndroid::StopRender() {
|
int32_t VideoRenderAndroid::StopRender() {
|
||||||
WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, _id, "%s:", __FUNCTION__);
|
WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, _id, "%s:", __FUNCTION__);
|
||||||
{
|
{
|
||||||
CriticalSectionScoped cs(&_critSect);
|
CriticalSectionScoped cs(&_critSect);
|
||||||
@ -268,31 +268,31 @@ bool VideoRenderAndroid::FullScreen() {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderAndroid::GetGraphicsMemory(
|
int32_t VideoRenderAndroid::GetGraphicsMemory(
|
||||||
WebRtc_UWord64& /*totalGraphicsMemory*/,
|
uint64_t& /*totalGraphicsMemory*/,
|
||||||
WebRtc_UWord64& /*availableGraphicsMemory*/) const {
|
uint64_t& /*availableGraphicsMemory*/) const {
|
||||||
WEBRTC_TRACE(kTraceError, kTraceVideoRenderer, _id,
|
WEBRTC_TRACE(kTraceError, kTraceVideoRenderer, _id,
|
||||||
"%s - not supported on Android", __FUNCTION__);
|
"%s - not supported on Android", __FUNCTION__);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderAndroid::GetScreenResolution(
|
int32_t VideoRenderAndroid::GetScreenResolution(
|
||||||
WebRtc_UWord32& /*screenWidth*/,
|
uint32_t& /*screenWidth*/,
|
||||||
WebRtc_UWord32& /*screenHeight*/) const {
|
uint32_t& /*screenHeight*/) const {
|
||||||
WEBRTC_TRACE(kTraceError, kTraceVideoRenderer, _id,
|
WEBRTC_TRACE(kTraceError, kTraceVideoRenderer, _id,
|
||||||
"%s - not supported on Android", __FUNCTION__);
|
"%s - not supported on Android", __FUNCTION__);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_UWord32 VideoRenderAndroid::RenderFrameRate(
|
uint32_t VideoRenderAndroid::RenderFrameRate(
|
||||||
const WebRtc_UWord32 /*streamId*/) {
|
const uint32_t /*streamId*/) {
|
||||||
WEBRTC_TRACE(kTraceError, kTraceVideoRenderer, _id,
|
WEBRTC_TRACE(kTraceError, kTraceVideoRenderer, _id,
|
||||||
"%s - not supported on Android", __FUNCTION__);
|
"%s - not supported on Android", __FUNCTION__);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderAndroid::SetStreamCropping(
|
int32_t VideoRenderAndroid::SetStreamCropping(
|
||||||
const WebRtc_UWord32 /*streamId*/,
|
const uint32_t /*streamId*/,
|
||||||
const float /*left*/,
|
const float /*left*/,
|
||||||
const float /*top*/,
|
const float /*top*/,
|
||||||
const float /*right*/,
|
const float /*right*/,
|
||||||
@ -302,14 +302,14 @@ WebRtc_Word32 VideoRenderAndroid::SetStreamCropping(
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderAndroid::SetTransparentBackground(const bool enable) {
|
int32_t VideoRenderAndroid::SetTransparentBackground(const bool enable) {
|
||||||
WEBRTC_TRACE(kTraceError, kTraceVideoRenderer, _id,
|
WEBRTC_TRACE(kTraceError, kTraceVideoRenderer, _id,
|
||||||
"%s - not supported on Android", __FUNCTION__);
|
"%s - not supported on Android", __FUNCTION__);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderAndroid::ConfigureRenderer(
|
int32_t VideoRenderAndroid::ConfigureRenderer(
|
||||||
const WebRtc_UWord32 streamId,
|
const uint32_t streamId,
|
||||||
const unsigned int zOrder,
|
const unsigned int zOrder,
|
||||||
const float left,
|
const float left,
|
||||||
const float top,
|
const float top,
|
||||||
@ -320,12 +320,12 @@ WebRtc_Word32 VideoRenderAndroid::ConfigureRenderer(
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderAndroid::SetText(
|
int32_t VideoRenderAndroid::SetText(
|
||||||
const WebRtc_UWord8 textId,
|
const uint8_t textId,
|
||||||
const WebRtc_UWord8* text,
|
const uint8_t* text,
|
||||||
const WebRtc_Word32 textLength,
|
const int32_t textLength,
|
||||||
const WebRtc_UWord32 textColorRef,
|
const uint32_t textColorRef,
|
||||||
const WebRtc_UWord32 backgroundColorRef,
|
const uint32_t backgroundColorRef,
|
||||||
const float left, const float top,
|
const float left, const float top,
|
||||||
const float rigth, const float bottom) {
|
const float rigth, const float bottom) {
|
||||||
WEBRTC_TRACE(kTraceError, kTraceVideoRenderer, _id,
|
WEBRTC_TRACE(kTraceError, kTraceVideoRenderer, _id,
|
||||||
@ -333,12 +333,12 @@ WebRtc_Word32 VideoRenderAndroid::SetText(
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderAndroid::SetBitmap(const void* bitMap,
|
int32_t VideoRenderAndroid::SetBitmap(const void* bitMap,
|
||||||
const WebRtc_UWord8 pictureId,
|
const uint8_t pictureId,
|
||||||
const void* colorKey,
|
const void* colorKey,
|
||||||
const float left, const float top,
|
const float left, const float top,
|
||||||
const float right,
|
const float right,
|
||||||
const float bottom) {
|
const float bottom) {
|
||||||
WEBRTC_TRACE(kTraceError, kTraceVideoRenderer, _id,
|
WEBRTC_TRACE(kTraceError, kTraceVideoRenderer, _id,
|
||||||
"%s - not supported on Android", __FUNCTION__);
|
"%s - not supported on Android", __FUNCTION__);
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -38,37 +38,37 @@ class AndroidStream : public VideoRenderCallback {
|
|||||||
|
|
||||||
class VideoRenderAndroid: IVideoRender {
|
class VideoRenderAndroid: IVideoRender {
|
||||||
public:
|
public:
|
||||||
VideoRenderAndroid(const WebRtc_Word32 id,
|
VideoRenderAndroid(const int32_t id,
|
||||||
const VideoRenderType videoRenderType,
|
const VideoRenderType videoRenderType,
|
||||||
void* window,
|
void* window,
|
||||||
const bool fullscreen);
|
const bool fullscreen);
|
||||||
|
|
||||||
virtual ~VideoRenderAndroid();
|
virtual ~VideoRenderAndroid();
|
||||||
|
|
||||||
virtual WebRtc_Word32 Init()=0;
|
virtual int32_t Init()=0;
|
||||||
|
|
||||||
virtual WebRtc_Word32 ChangeUniqueId(const WebRtc_Word32 id);
|
virtual int32_t ChangeUniqueId(const int32_t id);
|
||||||
|
|
||||||
virtual WebRtc_Word32 ChangeWindow(void* window);
|
virtual int32_t ChangeWindow(void* window);
|
||||||
|
|
||||||
virtual VideoRenderCallback* AddIncomingRenderStream(
|
virtual VideoRenderCallback* AddIncomingRenderStream(
|
||||||
const WebRtc_UWord32 streamId,
|
const uint32_t streamId,
|
||||||
const WebRtc_UWord32 zOrder,
|
const uint32_t zOrder,
|
||||||
const float left, const float top,
|
const float left, const float top,
|
||||||
const float right, const float bottom);
|
const float right, const float bottom);
|
||||||
|
|
||||||
virtual WebRtc_Word32 DeleteIncomingRenderStream(
|
virtual int32_t DeleteIncomingRenderStream(
|
||||||
const WebRtc_UWord32 streamId);
|
const uint32_t streamId);
|
||||||
|
|
||||||
virtual WebRtc_Word32 GetIncomingRenderStreamProperties(
|
virtual int32_t GetIncomingRenderStreamProperties(
|
||||||
const WebRtc_UWord32 streamId,
|
const uint32_t streamId,
|
||||||
WebRtc_UWord32& zOrder,
|
uint32_t& zOrder,
|
||||||
float& left, float& top,
|
float& left, float& top,
|
||||||
float& right, float& bottom) const;
|
float& right, float& bottom) const;
|
||||||
|
|
||||||
virtual WebRtc_Word32 StartRender();
|
virtual int32_t StartRender();
|
||||||
|
|
||||||
virtual WebRtc_Word32 StopRender();
|
virtual int32_t StopRender();
|
||||||
|
|
||||||
virtual void ReDraw();
|
virtual void ReDraw();
|
||||||
|
|
||||||
@ -80,55 +80,53 @@ class VideoRenderAndroid: IVideoRender {
|
|||||||
|
|
||||||
virtual bool FullScreen();
|
virtual bool FullScreen();
|
||||||
|
|
||||||
virtual WebRtc_Word32 GetGraphicsMemory(
|
virtual int32_t GetGraphicsMemory(
|
||||||
WebRtc_UWord64& totalGraphicsMemory,
|
uint64_t& totalGraphicsMemory,
|
||||||
WebRtc_UWord64& availableGraphicsMemory) const;
|
uint64_t& availableGraphicsMemory) const;
|
||||||
|
|
||||||
virtual WebRtc_Word32 GetScreenResolution(
|
virtual int32_t GetScreenResolution(
|
||||||
WebRtc_UWord32& screenWidth,
|
uint32_t& screenWidth,
|
||||||
WebRtc_UWord32& screenHeight) const;
|
uint32_t& screenHeight) const;
|
||||||
|
|
||||||
virtual WebRtc_UWord32 RenderFrameRate(const WebRtc_UWord32 streamId);
|
virtual uint32_t RenderFrameRate(const uint32_t streamId);
|
||||||
|
|
||||||
virtual WebRtc_Word32 SetStreamCropping(const WebRtc_UWord32 streamId,
|
virtual int32_t SetStreamCropping(const uint32_t streamId,
|
||||||
const float left, const float top,
|
const float left, const float top,
|
||||||
const float right,
|
const float right, const float bottom);
|
||||||
const float bottom);
|
|
||||||
|
|
||||||
virtual WebRtc_Word32 SetTransparentBackground(const bool enable);
|
virtual int32_t SetTransparentBackground(const bool enable);
|
||||||
|
|
||||||
virtual WebRtc_Word32 ConfigureRenderer(const WebRtc_UWord32 streamId,
|
virtual int32_t ConfigureRenderer(const uint32_t streamId,
|
||||||
const unsigned int zOrder,
|
const unsigned int zOrder,
|
||||||
const float left, const float top,
|
const float left, const float top,
|
||||||
const float right,
|
const float right, const float bottom);
|
||||||
const float bottom);
|
|
||||||
|
|
||||||
virtual WebRtc_Word32 SetText(const WebRtc_UWord8 textId,
|
virtual int32_t SetText(const uint8_t textId,
|
||||||
const WebRtc_UWord8* text,
|
const uint8_t* text,
|
||||||
const WebRtc_Word32 textLength,
|
const int32_t textLength,
|
||||||
const WebRtc_UWord32 textColorRef,
|
const uint32_t textColorRef,
|
||||||
const WebRtc_UWord32 backgroundColorRef,
|
const uint32_t backgroundColorRef,
|
||||||
const float left, const float top,
|
const float left, const float top,
|
||||||
const float rigth, const float bottom);
|
const float rigth, const float bottom);
|
||||||
|
|
||||||
virtual WebRtc_Word32 SetBitmap(const void* bitMap,
|
virtual int32_t SetBitmap(const void* bitMap,
|
||||||
const WebRtc_UWord8 pictureId,
|
const uint8_t pictureId,
|
||||||
const void* colorKey, const float left,
|
const void* colorKey, const float left,
|
||||||
const float top, const float right,
|
const float top, const float right,
|
||||||
const float bottom);
|
const float bottom);
|
||||||
static JavaVM* g_jvm;
|
static JavaVM* g_jvm;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual AndroidStream* CreateAndroidRenderChannel(
|
virtual AndroidStream* CreateAndroidRenderChannel(
|
||||||
WebRtc_Word32 streamId,
|
int32_t streamId,
|
||||||
WebRtc_Word32 zOrder,
|
int32_t zOrder,
|
||||||
const float left,
|
const float left,
|
||||||
const float top,
|
const float top,
|
||||||
const float right,
|
const float right,
|
||||||
const float bottom,
|
const float bottom,
|
||||||
VideoRenderAndroid& renderer) = 0;
|
VideoRenderAndroid& renderer) = 0;
|
||||||
|
|
||||||
WebRtc_Word32 _id;
|
int32_t _id;
|
||||||
CriticalSectionWrapper& _critSect;
|
CriticalSectionWrapper& _critSect;
|
||||||
VideoRenderType _renderType;
|
VideoRenderType _renderType;
|
||||||
jobject _ptrWindow;
|
jobject _ptrWindow;
|
||||||
@ -143,7 +141,7 @@ class VideoRenderAndroid: IVideoRender {
|
|||||||
bool _javaShutDownFlag;
|
bool _javaShutDownFlag;
|
||||||
EventWrapper& _javaShutdownEvent;
|
EventWrapper& _javaShutdownEvent;
|
||||||
EventWrapper& _javaRenderEvent;
|
EventWrapper& _javaRenderEvent;
|
||||||
WebRtc_Word64 _lastJavaRenderEvent;
|
int64_t _lastJavaRenderEvent;
|
||||||
JNIEnv* _javaRenderJniEnv; // JNIEnv for the java render thread.
|
JNIEnv* _javaRenderJniEnv; // JNIEnv for the java render thread.
|
||||||
ThreadWrapper* _javaRenderThread;
|
ThreadWrapper* _javaRenderThread;
|
||||||
};
|
};
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
|
|
||||||
AndroidNativeOpenGl2Renderer::AndroidNativeOpenGl2Renderer(
|
AndroidNativeOpenGl2Renderer::AndroidNativeOpenGl2Renderer(
|
||||||
const WebRtc_Word32 id,
|
const int32_t id,
|
||||||
const VideoRenderType videoRenderType,
|
const VideoRenderType videoRenderType,
|
||||||
void* window,
|
void* window,
|
||||||
const bool fullscreen) :
|
const bool fullscreen) :
|
||||||
@ -129,7 +129,7 @@ AndroidNativeOpenGl2Renderer::~AndroidNativeOpenGl2Renderer() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 AndroidNativeOpenGl2Renderer::Init() {
|
int32_t AndroidNativeOpenGl2Renderer::Init() {
|
||||||
WEBRTC_TRACE(kTraceDebug, kTraceVideoRenderer, _id, "%s", __FUNCTION__);
|
WEBRTC_TRACE(kTraceDebug, kTraceVideoRenderer, _id, "%s", __FUNCTION__);
|
||||||
if (!g_jvm) {
|
if (!g_jvm) {
|
||||||
WEBRTC_TRACE(kTraceError, kTraceVideoRenderer, _id,
|
WEBRTC_TRACE(kTraceError, kTraceVideoRenderer, _id,
|
||||||
@ -211,8 +211,8 @@ WebRtc_Word32 AndroidNativeOpenGl2Renderer::Init() {
|
|||||||
}
|
}
|
||||||
AndroidStream*
|
AndroidStream*
|
||||||
AndroidNativeOpenGl2Renderer::CreateAndroidRenderChannel(
|
AndroidNativeOpenGl2Renderer::CreateAndroidRenderChannel(
|
||||||
WebRtc_Word32 streamId,
|
int32_t streamId,
|
||||||
WebRtc_Word32 zOrder,
|
int32_t zOrder,
|
||||||
const float left,
|
const float left,
|
||||||
const float top,
|
const float top,
|
||||||
const float right,
|
const float right,
|
||||||
@ -232,7 +232,7 @@ AndroidNativeOpenGl2Renderer::CreateAndroidRenderChannel(
|
|||||||
}
|
}
|
||||||
|
|
||||||
AndroidNativeOpenGl2Channel::AndroidNativeOpenGl2Channel(
|
AndroidNativeOpenGl2Channel::AndroidNativeOpenGl2Channel(
|
||||||
WebRtc_UWord32 streamId,
|
uint32_t streamId,
|
||||||
JavaVM* jvm,
|
JavaVM* jvm,
|
||||||
VideoRenderAndroid& renderer,jobject javaRenderObj):
|
VideoRenderAndroid& renderer,jobject javaRenderObj):
|
||||||
_id(streamId),
|
_id(streamId),
|
||||||
@ -279,11 +279,11 @@ AndroidNativeOpenGl2Channel::~AndroidNativeOpenGl2Channel() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 AndroidNativeOpenGl2Channel::Init(WebRtc_Word32 zOrder,
|
int32_t AndroidNativeOpenGl2Channel::Init(int32_t zOrder,
|
||||||
const float left,
|
const float left,
|
||||||
const float top,
|
const float top,
|
||||||
const float right,
|
const float right,
|
||||||
const float bottom)
|
const float bottom)
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceDebug, kTraceVideoRenderer, _id,
|
WEBRTC_TRACE(kTraceDebug, kTraceVideoRenderer, _id,
|
||||||
"%s: AndroidNativeOpenGl2Channel", __FUNCTION__);
|
"%s: AndroidNativeOpenGl2Channel", __FUNCTION__);
|
||||||
@ -380,8 +380,8 @@ WebRtc_Word32 AndroidNativeOpenGl2Channel::Init(WebRtc_Word32 zOrder,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 AndroidNativeOpenGl2Channel::RenderFrame(
|
int32_t AndroidNativeOpenGl2Channel::RenderFrame(
|
||||||
const WebRtc_UWord32 /*streamId*/,
|
const uint32_t /*streamId*/,
|
||||||
I420VideoFrame& videoFrame) {
|
I420VideoFrame& videoFrame) {
|
||||||
// WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer,_id, "%s:" ,__FUNCTION__);
|
// WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer,_id, "%s:" ,__FUNCTION__);
|
||||||
_renderCritSect.Enter();
|
_renderCritSect.Enter();
|
||||||
|
@ -24,20 +24,17 @@ class CriticalSectionWrapper;
|
|||||||
class AndroidNativeOpenGl2Channel: public AndroidStream {
|
class AndroidNativeOpenGl2Channel: public AndroidStream {
|
||||||
public:
|
public:
|
||||||
AndroidNativeOpenGl2Channel(
|
AndroidNativeOpenGl2Channel(
|
||||||
WebRtc_UWord32 streamId,
|
uint32_t streamId,
|
||||||
JavaVM* jvm,
|
JavaVM* jvm,
|
||||||
VideoRenderAndroid& renderer,jobject javaRenderObj);
|
VideoRenderAndroid& renderer,jobject javaRenderObj);
|
||||||
~AndroidNativeOpenGl2Channel();
|
~AndroidNativeOpenGl2Channel();
|
||||||
|
|
||||||
WebRtc_Word32 Init(WebRtc_Word32 zOrder,
|
int32_t Init(int32_t zOrder, const float left, const float top,
|
||||||
const float left,
|
const float right, const float bottom);
|
||||||
const float top,
|
|
||||||
const float right,
|
|
||||||
const float bottom);
|
|
||||||
|
|
||||||
//Implement VideoRenderCallback
|
//Implement VideoRenderCallback
|
||||||
virtual WebRtc_Word32 RenderFrame(
|
virtual int32_t RenderFrame(
|
||||||
const WebRtc_UWord32 streamId,
|
const uint32_t streamId,
|
||||||
I420VideoFrame& videoFrame);
|
I420VideoFrame& videoFrame);
|
||||||
|
|
||||||
//Implements AndroidStream
|
//Implements AndroidStream
|
||||||
@ -54,7 +51,7 @@ class AndroidNativeOpenGl2Channel: public AndroidStream {
|
|||||||
|
|
||||||
static void DrawNativeStatic(JNIEnv * env,jobject, jlong context);
|
static void DrawNativeStatic(JNIEnv * env,jobject, jlong context);
|
||||||
void DrawNative();
|
void DrawNative();
|
||||||
WebRtc_UWord32 _id;
|
uint32_t _id;
|
||||||
CriticalSectionWrapper& _renderCritSect;
|
CriticalSectionWrapper& _renderCritSect;
|
||||||
|
|
||||||
I420VideoFrame _bufferToRender;
|
I420VideoFrame _bufferToRender;
|
||||||
@ -71,7 +68,7 @@ class AndroidNativeOpenGl2Channel: public AndroidStream {
|
|||||||
|
|
||||||
class AndroidNativeOpenGl2Renderer: private VideoRenderAndroid {
|
class AndroidNativeOpenGl2Renderer: private VideoRenderAndroid {
|
||||||
public:
|
public:
|
||||||
AndroidNativeOpenGl2Renderer(const WebRtc_Word32 id,
|
AndroidNativeOpenGl2Renderer(const int32_t id,
|
||||||
const VideoRenderType videoRenderType,
|
const VideoRenderType videoRenderType,
|
||||||
void* window,
|
void* window,
|
||||||
const bool fullscreen);
|
const bool fullscreen);
|
||||||
@ -79,10 +76,10 @@ class AndroidNativeOpenGl2Renderer: private VideoRenderAndroid {
|
|||||||
~AndroidNativeOpenGl2Renderer();
|
~AndroidNativeOpenGl2Renderer();
|
||||||
static bool UseOpenGL2(void* window);
|
static bool UseOpenGL2(void* window);
|
||||||
|
|
||||||
WebRtc_Word32 Init();
|
int32_t Init();
|
||||||
virtual AndroidStream* CreateAndroidRenderChannel(
|
virtual AndroidStream* CreateAndroidRenderChannel(
|
||||||
WebRtc_Word32 streamId,
|
int32_t streamId,
|
||||||
WebRtc_Word32 zOrder,
|
int32_t zOrder,
|
||||||
const float left,
|
const float left,
|
||||||
const float top,
|
const float top,
|
||||||
const float right,
|
const float right,
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
|
|
||||||
AndroidSurfaceViewRenderer::AndroidSurfaceViewRenderer(
|
AndroidSurfaceViewRenderer::AndroidSurfaceViewRenderer(
|
||||||
const WebRtc_Word32 id,
|
const int32_t id,
|
||||||
const VideoRenderType videoRenderType,
|
const VideoRenderType videoRenderType,
|
||||||
void* window,
|
void* window,
|
||||||
const bool fullscreen) :
|
const bool fullscreen) :
|
||||||
@ -77,7 +77,7 @@ AndroidSurfaceViewRenderer::~AndroidSurfaceViewRenderer() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 AndroidSurfaceViewRenderer::Init() {
|
int32_t AndroidSurfaceViewRenderer::Init() {
|
||||||
WEBRTC_TRACE(kTraceDebug, kTraceVideoRenderer, _id, "%s", __FUNCTION__);
|
WEBRTC_TRACE(kTraceDebug, kTraceVideoRenderer, _id, "%s", __FUNCTION__);
|
||||||
if (!g_jvm) {
|
if (!g_jvm) {
|
||||||
WEBRTC_TRACE(kTraceError,
|
WEBRTC_TRACE(kTraceError,
|
||||||
@ -200,8 +200,8 @@ WebRtc_Word32 AndroidSurfaceViewRenderer::Init() {
|
|||||||
|
|
||||||
AndroidStream*
|
AndroidStream*
|
||||||
AndroidSurfaceViewRenderer::CreateAndroidRenderChannel(
|
AndroidSurfaceViewRenderer::CreateAndroidRenderChannel(
|
||||||
WebRtc_Word32 streamId,
|
int32_t streamId,
|
||||||
WebRtc_Word32 zOrder,
|
int32_t zOrder,
|
||||||
const float left,
|
const float left,
|
||||||
const float top,
|
const float top,
|
||||||
const float right,
|
const float right,
|
||||||
@ -223,7 +223,7 @@ AndroidSurfaceViewRenderer::CreateAndroidRenderChannel(
|
|||||||
}
|
}
|
||||||
|
|
||||||
AndroidSurfaceViewChannel::AndroidSurfaceViewChannel(
|
AndroidSurfaceViewChannel::AndroidSurfaceViewChannel(
|
||||||
WebRtc_UWord32 streamId,
|
uint32_t streamId,
|
||||||
JavaVM* jvm,
|
JavaVM* jvm,
|
||||||
VideoRenderAndroid& renderer,
|
VideoRenderAndroid& renderer,
|
||||||
jobject javaRenderObj) :
|
jobject javaRenderObj) :
|
||||||
@ -284,8 +284,8 @@ AndroidSurfaceViewChannel::~AndroidSurfaceViewChannel() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 AndroidSurfaceViewChannel::Init(
|
int32_t AndroidSurfaceViewChannel::Init(
|
||||||
WebRtc_Word32 /*zOrder*/,
|
int32_t /*zOrder*/,
|
||||||
const float left,
|
const float left,
|
||||||
const float top,
|
const float top,
|
||||||
const float right,
|
const float right,
|
||||||
@ -410,8 +410,8 @@ WebRtc_Word32 AndroidSurfaceViewChannel::Init(
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
WebRtc_Word32 AndroidSurfaceViewChannel::RenderFrame(
|
int32_t AndroidSurfaceViewChannel::RenderFrame(
|
||||||
const WebRtc_UWord32 /*streamId*/,
|
const uint32_t /*streamId*/,
|
||||||
I420VideoFrame& videoFrame) {
|
I420VideoFrame& videoFrame) {
|
||||||
// WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer,_id, "%s:" ,__FUNCTION__);
|
// WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer,_id, "%s:" ,__FUNCTION__);
|
||||||
_renderCritSect.Enter();
|
_renderCritSect.Enter();
|
||||||
|
@ -22,27 +22,24 @@ class CriticalSectionWrapper;
|
|||||||
|
|
||||||
class AndroidSurfaceViewChannel : public AndroidStream {
|
class AndroidSurfaceViewChannel : public AndroidStream {
|
||||||
public:
|
public:
|
||||||
AndroidSurfaceViewChannel(WebRtc_UWord32 streamId,
|
AndroidSurfaceViewChannel(uint32_t streamId,
|
||||||
JavaVM* jvm,
|
JavaVM* jvm,
|
||||||
VideoRenderAndroid& renderer,
|
VideoRenderAndroid& renderer,
|
||||||
jobject javaRenderObj);
|
jobject javaRenderObj);
|
||||||
~AndroidSurfaceViewChannel();
|
~AndroidSurfaceViewChannel();
|
||||||
|
|
||||||
WebRtc_Word32 Init(WebRtc_Word32 zOrder,
|
int32_t Init(int32_t zOrder, const float left, const float top,
|
||||||
const float left,
|
const float right, const float bottom);
|
||||||
const float top,
|
|
||||||
const float right,
|
|
||||||
const float bottom);
|
|
||||||
|
|
||||||
//Implement VideoRenderCallback
|
//Implement VideoRenderCallback
|
||||||
virtual WebRtc_Word32 RenderFrame(const WebRtc_UWord32 streamId,
|
virtual int32_t RenderFrame(const uint32_t streamId,
|
||||||
I420VideoFrame& videoFrame);
|
I420VideoFrame& videoFrame);
|
||||||
|
|
||||||
//Implements AndroidStream
|
//Implements AndroidStream
|
||||||
virtual void DeliverFrame(JNIEnv* jniEnv);
|
virtual void DeliverFrame(JNIEnv* jniEnv);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
WebRtc_UWord32 _id;
|
uint32_t _id;
|
||||||
CriticalSectionWrapper& _renderCritSect;
|
CriticalSectionWrapper& _renderCritSect;
|
||||||
|
|
||||||
I420VideoFrame _bufferToRender;
|
I420VideoFrame _bufferToRender;
|
||||||
@ -62,15 +59,15 @@ class AndroidSurfaceViewChannel : public AndroidStream {
|
|||||||
|
|
||||||
class AndroidSurfaceViewRenderer : private VideoRenderAndroid {
|
class AndroidSurfaceViewRenderer : private VideoRenderAndroid {
|
||||||
public:
|
public:
|
||||||
AndroidSurfaceViewRenderer(const WebRtc_Word32 id,
|
AndroidSurfaceViewRenderer(const int32_t id,
|
||||||
const VideoRenderType videoRenderType,
|
const VideoRenderType videoRenderType,
|
||||||
void* window,
|
void* window,
|
||||||
const bool fullscreen);
|
const bool fullscreen);
|
||||||
~AndroidSurfaceViewRenderer();
|
~AndroidSurfaceViewRenderer();
|
||||||
WebRtc_Word32 Init();
|
int32_t Init();
|
||||||
virtual AndroidStream* CreateAndroidRenderChannel(
|
virtual AndroidStream* CreateAndroidRenderChannel(
|
||||||
WebRtc_Word32 streamId,
|
int32_t streamId,
|
||||||
WebRtc_Word32 zOrder,
|
int32_t zOrder,
|
||||||
const float left,
|
const float left,
|
||||||
const float top,
|
const float top,
|
||||||
const float right,
|
const float right,
|
||||||
|
@ -68,7 +68,7 @@ const char VideoRenderOpenGles20::g_fragmentShader[] = {
|
|||||||
" gl_FragColor=vec4(r,g,b,1.0);\n"
|
" gl_FragColor=vec4(r,g,b,1.0);\n"
|
||||||
"}\n" };
|
"}\n" };
|
||||||
|
|
||||||
VideoRenderOpenGles20::VideoRenderOpenGles20(WebRtc_Word32 id) :
|
VideoRenderOpenGles20::VideoRenderOpenGles20(int32_t id) :
|
||||||
_id(id),
|
_id(id),
|
||||||
_textureWidth(-1),
|
_textureWidth(-1),
|
||||||
_textureHeight(-1) {
|
_textureHeight(-1) {
|
||||||
@ -88,8 +88,7 @@ VideoRenderOpenGles20::VideoRenderOpenGles20(WebRtc_Word32 id) :
|
|||||||
VideoRenderOpenGles20::~VideoRenderOpenGles20() {
|
VideoRenderOpenGles20::~VideoRenderOpenGles20() {
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderOpenGles20::Setup(WebRtc_Word32 width,
|
int32_t VideoRenderOpenGles20::Setup(int32_t width, int32_t height) {
|
||||||
WebRtc_Word32 height) {
|
|
||||||
WEBRTC_TRACE(kTraceDebug, kTraceVideoRenderer, _id,
|
WEBRTC_TRACE(kTraceDebug, kTraceVideoRenderer, _id,
|
||||||
"%s: width %d, height %d", __FUNCTION__, (int) width,
|
"%s: width %d, height %d", __FUNCTION__, (int) width,
|
||||||
(int) height);
|
(int) height);
|
||||||
@ -174,11 +173,11 @@ WebRtc_Word32 VideoRenderOpenGles20::Setup(WebRtc_Word32 width,
|
|||||||
// SetCoordinates
|
// SetCoordinates
|
||||||
// Sets the coordinates where the stream shall be rendered.
|
// Sets the coordinates where the stream shall be rendered.
|
||||||
// Values must be between 0 and 1.
|
// Values must be between 0 and 1.
|
||||||
WebRtc_Word32 VideoRenderOpenGles20::SetCoordinates(WebRtc_Word32 zOrder,
|
int32_t VideoRenderOpenGles20::SetCoordinates(int32_t zOrder,
|
||||||
const float left,
|
const float left,
|
||||||
const float top,
|
const float top,
|
||||||
const float right,
|
const float right,
|
||||||
const float bottom) {
|
const float bottom) {
|
||||||
if ((top > 1 || top < 0) || (right > 1 || right < 0) ||
|
if ((top > 1 || top < 0) || (right > 1 || right < 0) ||
|
||||||
(bottom > 1 || bottom < 0) || (left > 1 || left < 0)) {
|
(bottom > 1 || bottom < 0) || (left > 1 || left < 0)) {
|
||||||
WEBRTC_TRACE(kTraceError, kTraceVideoRenderer, _id,
|
WEBRTC_TRACE(kTraceError, kTraceVideoRenderer, _id,
|
||||||
@ -215,8 +214,7 @@ WebRtc_Word32 VideoRenderOpenGles20::SetCoordinates(WebRtc_Word32 zOrder,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderOpenGles20::Render(const I420VideoFrame&
|
int32_t VideoRenderOpenGles20::Render(const I420VideoFrame& frameToRender) {
|
||||||
frameToRender) {
|
|
||||||
|
|
||||||
if (frameToRender.IsZeroSize()) {
|
if (frameToRender.IsZeroSize()) {
|
||||||
return -1;
|
return -1;
|
||||||
@ -361,7 +359,7 @@ void VideoRenderOpenGles20::SetupTextures(const I420VideoFrame& frameToRender) {
|
|||||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||||
|
|
||||||
const WebRtc_UWord8* uComponent = frameToRender.buffer(kUPlane);
|
const uint8_t* uComponent = frameToRender.buffer(kUPlane);
|
||||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE, width / 2, height / 2, 0,
|
glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE, width / 2, height / 2, 0,
|
||||||
GL_LUMINANCE, GL_UNSIGNED_BYTE, (const GLvoid*) uComponent);
|
GL_LUMINANCE, GL_UNSIGNED_BYTE, (const GLvoid*) uComponent);
|
||||||
|
|
||||||
@ -374,7 +372,7 @@ void VideoRenderOpenGles20::SetupTextures(const I420VideoFrame& frameToRender) {
|
|||||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||||
|
|
||||||
const WebRtc_UWord8* vComponent = frameToRender.buffer(kVPlane);
|
const uint8_t* vComponent = frameToRender.buffer(kVPlane);
|
||||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE, width / 2, height / 2, 0,
|
glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE, width / 2, height / 2, 0,
|
||||||
GL_LUMINANCE, GL_UNSIGNED_BYTE, (const GLvoid*) vComponent);
|
GL_LUMINANCE, GL_UNSIGNED_BYTE, (const GLvoid*) vComponent);
|
||||||
checkGlError("SetupTextures");
|
checkGlError("SetupTextures");
|
||||||
|
@ -21,16 +21,13 @@ namespace webrtc
|
|||||||
|
|
||||||
class VideoRenderOpenGles20 {
|
class VideoRenderOpenGles20 {
|
||||||
public:
|
public:
|
||||||
VideoRenderOpenGles20(WebRtc_Word32 id);
|
VideoRenderOpenGles20(int32_t id);
|
||||||
~VideoRenderOpenGles20();
|
~VideoRenderOpenGles20();
|
||||||
|
|
||||||
WebRtc_Word32 Setup(WebRtc_Word32 widht, WebRtc_Word32 height);
|
int32_t Setup(int32_t widht, int32_t height);
|
||||||
WebRtc_Word32 Render(const I420VideoFrame& frameToRender);
|
int32_t Render(const I420VideoFrame& frameToRender);
|
||||||
WebRtc_Word32 SetCoordinates(WebRtc_Word32 zOrder,
|
int32_t SetCoordinates(int32_t zOrder, const float left, const float top,
|
||||||
const float left,
|
const float right, const float bottom);
|
||||||
const float top,
|
|
||||||
const float right,
|
|
||||||
const float bottom);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void printGLString(const char *name, GLenum s);
|
void printGLString(const char *name, GLenum s);
|
||||||
@ -41,7 +38,7 @@ class VideoRenderOpenGles20 {
|
|||||||
void SetupTextures(const I420VideoFrame& frameToRender);
|
void SetupTextures(const I420VideoFrame& frameToRender);
|
||||||
void UpdateTextures(const I420VideoFrame& frameToRender);
|
void UpdateTextures(const I420VideoFrame& frameToRender);
|
||||||
|
|
||||||
WebRtc_Word32 _id;
|
int32_t _id;
|
||||||
GLuint _textureIds[3]; // Texture id of Y,U and V texture.
|
GLuint _textureIds[3]; // Texture id of Y,U and V texture.
|
||||||
GLuint _program;
|
GLuint _program;
|
||||||
GLuint _vPositionHandle;
|
GLuint _vPositionHandle;
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
|
|
||||||
VideoRenderExternalImpl::VideoRenderExternalImpl(
|
VideoRenderExternalImpl::VideoRenderExternalImpl(
|
||||||
const WebRtc_Word32 id,
|
const int32_t id,
|
||||||
const VideoRenderType videoRenderType,
|
const VideoRenderType videoRenderType,
|
||||||
void* window,
|
void* window,
|
||||||
const bool fullscreen) :
|
const bool fullscreen) :
|
||||||
@ -27,27 +27,27 @@ VideoRenderExternalImpl::~VideoRenderExternalImpl()
|
|||||||
delete &_critSect;
|
delete &_critSect;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderExternalImpl::Init()
|
int32_t VideoRenderExternalImpl::Init()
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderExternalImpl::ChangeUniqueId(const WebRtc_Word32 id)
|
int32_t VideoRenderExternalImpl::ChangeUniqueId(const int32_t id)
|
||||||
{
|
{
|
||||||
CriticalSectionScoped cs(&_critSect);
|
CriticalSectionScoped cs(&_critSect);
|
||||||
_id = id;
|
_id = id;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderExternalImpl::ChangeWindow(void* window)
|
int32_t VideoRenderExternalImpl::ChangeWindow(void* window)
|
||||||
{
|
{
|
||||||
CriticalSectionScoped cs(&_critSect);
|
CriticalSectionScoped cs(&_critSect);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
VideoRenderCallback*
|
VideoRenderCallback*
|
||||||
VideoRenderExternalImpl::AddIncomingRenderStream(const WebRtc_UWord32 streamId,
|
VideoRenderExternalImpl::AddIncomingRenderStream(const uint32_t streamId,
|
||||||
const WebRtc_UWord32 zOrder,
|
const uint32_t zOrder,
|
||||||
const float left,
|
const float left,
|
||||||
const float top,
|
const float top,
|
||||||
const float right,
|
const float right,
|
||||||
@ -57,16 +57,16 @@ VideoRenderExternalImpl::AddIncomingRenderStream(const WebRtc_UWord32 streamId,
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderExternalImpl::DeleteIncomingRenderStream(
|
int32_t VideoRenderExternalImpl::DeleteIncomingRenderStream(
|
||||||
const WebRtc_UWord32 streamId)
|
const uint32_t streamId)
|
||||||
{
|
{
|
||||||
CriticalSectionScoped cs(&_critSect);
|
CriticalSectionScoped cs(&_critSect);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderExternalImpl::GetIncomingRenderStreamProperties(
|
int32_t VideoRenderExternalImpl::GetIncomingRenderStreamProperties(
|
||||||
const WebRtc_UWord32 streamId,
|
const uint32_t streamId,
|
||||||
WebRtc_UWord32& zOrder,
|
uint32_t& zOrder,
|
||||||
float& left,
|
float& left,
|
||||||
float& top,
|
float& top,
|
||||||
float& right,
|
float& right,
|
||||||
@ -83,13 +83,13 @@ WebRtc_Word32 VideoRenderExternalImpl::GetIncomingRenderStreamProperties(
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderExternalImpl::StartRender()
|
int32_t VideoRenderExternalImpl::StartRender()
|
||||||
{
|
{
|
||||||
CriticalSectionScoped cs(&_critSect);
|
CriticalSectionScoped cs(&_critSect);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderExternalImpl::StopRender()
|
int32_t VideoRenderExternalImpl::StopRender()
|
||||||
{
|
{
|
||||||
CriticalSectionScoped cs(&_critSect);
|
CriticalSectionScoped cs(&_critSect);
|
||||||
return 0;
|
return 0;
|
||||||
@ -111,18 +111,18 @@ bool VideoRenderExternalImpl::FullScreen()
|
|||||||
return _fullscreen;
|
return _fullscreen;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderExternalImpl::GetGraphicsMemory(
|
int32_t VideoRenderExternalImpl::GetGraphicsMemory(
|
||||||
WebRtc_UWord64& totalGraphicsMemory,
|
uint64_t& totalGraphicsMemory,
|
||||||
WebRtc_UWord64& availableGraphicsMemory) const
|
uint64_t& availableGraphicsMemory) const
|
||||||
{
|
{
|
||||||
totalGraphicsMemory = 0;
|
totalGraphicsMemory = 0;
|
||||||
availableGraphicsMemory = 0;
|
availableGraphicsMemory = 0;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderExternalImpl::GetScreenResolution(
|
int32_t VideoRenderExternalImpl::GetScreenResolution(
|
||||||
WebRtc_UWord32& screenWidth,
|
uint32_t& screenWidth,
|
||||||
WebRtc_UWord32& screenHeight) const
|
uint32_t& screenHeight) const
|
||||||
{
|
{
|
||||||
CriticalSectionScoped cs(&_critSect);
|
CriticalSectionScoped cs(&_critSect);
|
||||||
screenWidth = 0;
|
screenWidth = 0;
|
||||||
@ -130,15 +130,15 @@ WebRtc_Word32 VideoRenderExternalImpl::GetScreenResolution(
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_UWord32 VideoRenderExternalImpl::RenderFrameRate(
|
uint32_t VideoRenderExternalImpl::RenderFrameRate(
|
||||||
const WebRtc_UWord32 streamId)
|
const uint32_t streamId)
|
||||||
{
|
{
|
||||||
CriticalSectionScoped cs(&_critSect);
|
CriticalSectionScoped cs(&_critSect);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderExternalImpl::SetStreamCropping(
|
int32_t VideoRenderExternalImpl::SetStreamCropping(
|
||||||
const WebRtc_UWord32 streamId,
|
const uint32_t streamId,
|
||||||
const float left,
|
const float left,
|
||||||
const float top,
|
const float top,
|
||||||
const float right,
|
const float right,
|
||||||
@ -148,8 +148,8 @@ WebRtc_Word32 VideoRenderExternalImpl::SetStreamCropping(
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderExternalImpl::ConfigureRenderer(
|
int32_t VideoRenderExternalImpl::ConfigureRenderer(
|
||||||
const WebRtc_UWord32 streamId,
|
const uint32_t streamId,
|
||||||
const unsigned int zOrder,
|
const unsigned int zOrder,
|
||||||
const float left,
|
const float left,
|
||||||
const float top,
|
const float top,
|
||||||
@ -160,19 +160,19 @@ WebRtc_Word32 VideoRenderExternalImpl::ConfigureRenderer(
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderExternalImpl::SetTransparentBackground(
|
int32_t VideoRenderExternalImpl::SetTransparentBackground(
|
||||||
const bool enable)
|
const bool enable)
|
||||||
{
|
{
|
||||||
CriticalSectionScoped cs(&_critSect);
|
CriticalSectionScoped cs(&_critSect);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderExternalImpl::SetText(
|
int32_t VideoRenderExternalImpl::SetText(
|
||||||
const WebRtc_UWord8 textId,
|
const uint8_t textId,
|
||||||
const WebRtc_UWord8* text,
|
const uint8_t* text,
|
||||||
const WebRtc_Word32 textLength,
|
const int32_t textLength,
|
||||||
const WebRtc_UWord32 textColorRef,
|
const uint32_t textColorRef,
|
||||||
const WebRtc_UWord32 backgroundColorRef,
|
const uint32_t backgroundColorRef,
|
||||||
const float left,
|
const float left,
|
||||||
const float top,
|
const float top,
|
||||||
const float right,
|
const float right,
|
||||||
@ -182,21 +182,21 @@ WebRtc_Word32 VideoRenderExternalImpl::SetText(
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderExternalImpl::SetBitmap(const void* bitMap,
|
int32_t VideoRenderExternalImpl::SetBitmap(const void* bitMap,
|
||||||
const WebRtc_UWord8 pictureId,
|
const uint8_t pictureId,
|
||||||
const void* colorKey,
|
const void* colorKey,
|
||||||
const float left,
|
const float left,
|
||||||
const float top,
|
const float top,
|
||||||
const float right,
|
const float right,
|
||||||
const float bottom)
|
const float bottom)
|
||||||
{
|
{
|
||||||
CriticalSectionScoped cs(&_critSect);
|
CriticalSectionScoped cs(&_critSect);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// VideoRenderCallback
|
// VideoRenderCallback
|
||||||
WebRtc_Word32 VideoRenderExternalImpl::RenderFrame(
|
int32_t VideoRenderExternalImpl::RenderFrame(
|
||||||
const WebRtc_UWord32 streamId,
|
const uint32_t streamId,
|
||||||
I420VideoFrame& videoFrame)
|
I420VideoFrame& videoFrame)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -25,17 +25,17 @@ public:
|
|||||||
* Constructor/destructor
|
* Constructor/destructor
|
||||||
*/
|
*/
|
||||||
|
|
||||||
VideoRenderExternalImpl(const WebRtc_Word32 id,
|
VideoRenderExternalImpl(const int32_t id,
|
||||||
const VideoRenderType videoRenderType,
|
const VideoRenderType videoRenderType,
|
||||||
void* window, const bool fullscreen);
|
void* window, const bool fullscreen);
|
||||||
|
|
||||||
virtual ~VideoRenderExternalImpl();
|
virtual ~VideoRenderExternalImpl();
|
||||||
|
|
||||||
virtual WebRtc_Word32 Init();
|
virtual int32_t Init();
|
||||||
|
|
||||||
virtual WebRtc_Word32 ChangeUniqueId(const WebRtc_Word32 id);
|
virtual int32_t ChangeUniqueId(const int32_t id);
|
||||||
|
|
||||||
virtual WebRtc_Word32 ChangeWindow(void* window);
|
virtual int32_t ChangeWindow(void* window);
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
@ -44,17 +44,17 @@ public:
|
|||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
virtual VideoRenderCallback
|
virtual VideoRenderCallback
|
||||||
* AddIncomingRenderStream(const WebRtc_UWord32 streamId,
|
* AddIncomingRenderStream(const uint32_t streamId,
|
||||||
const WebRtc_UWord32 zOrder,
|
const uint32_t zOrder,
|
||||||
const float left, const float top,
|
const float left, const float top,
|
||||||
const float right, const float bottom);
|
const float right, const float bottom);
|
||||||
|
|
||||||
virtual WebRtc_Word32
|
virtual int32_t
|
||||||
DeleteIncomingRenderStream(const WebRtc_UWord32 streamId);
|
DeleteIncomingRenderStream(const uint32_t streamId);
|
||||||
|
|
||||||
virtual WebRtc_Word32
|
virtual int32_t
|
||||||
GetIncomingRenderStreamProperties(const WebRtc_UWord32 streamId,
|
GetIncomingRenderStreamProperties(const uint32_t streamId,
|
||||||
WebRtc_UWord32& zOrder,
|
uint32_t& zOrder,
|
||||||
float& left, float& top,
|
float& left, float& top,
|
||||||
float& right, float& bottom) const;
|
float& right, float& bottom) const;
|
||||||
|
|
||||||
@ -64,9 +64,9 @@ public:
|
|||||||
*
|
*
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
virtual WebRtc_Word32 StartRender();
|
virtual int32_t StartRender();
|
||||||
|
|
||||||
virtual WebRtc_Word32 StopRender();
|
virtual int32_t StopRender();
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
@ -80,49 +80,47 @@ public:
|
|||||||
|
|
||||||
virtual bool FullScreen();
|
virtual bool FullScreen();
|
||||||
|
|
||||||
virtual WebRtc_Word32
|
virtual int32_t
|
||||||
GetGraphicsMemory(WebRtc_UWord64& totalGraphicsMemory,
|
GetGraphicsMemory(uint64_t& totalGraphicsMemory,
|
||||||
WebRtc_UWord64& availableGraphicsMemory) const;
|
uint64_t& availableGraphicsMemory) const;
|
||||||
|
|
||||||
virtual WebRtc_Word32
|
virtual int32_t
|
||||||
GetScreenResolution(WebRtc_UWord32& screenWidth,
|
GetScreenResolution(uint32_t& screenWidth,
|
||||||
WebRtc_UWord32& screenHeight) const;
|
uint32_t& screenHeight) const;
|
||||||
|
|
||||||
virtual WebRtc_UWord32 RenderFrameRate(const WebRtc_UWord32 streamId);
|
virtual uint32_t RenderFrameRate(const uint32_t streamId);
|
||||||
|
|
||||||
virtual WebRtc_Word32 SetStreamCropping(const WebRtc_UWord32 streamId,
|
virtual int32_t SetStreamCropping(const uint32_t streamId,
|
||||||
const float left, const float top,
|
const float left, const float top,
|
||||||
const float right,
|
const float right, const float bottom);
|
||||||
const float bottom);
|
|
||||||
|
|
||||||
virtual WebRtc_Word32 ConfigureRenderer(const WebRtc_UWord32 streamId,
|
virtual int32_t ConfigureRenderer(const uint32_t streamId,
|
||||||
const unsigned int zOrder,
|
const unsigned int zOrder,
|
||||||
const float left, const float top,
|
const float left, const float top,
|
||||||
const float right,
|
const float right, const float bottom);
|
||||||
const float bottom);
|
|
||||||
|
|
||||||
virtual WebRtc_Word32 SetTransparentBackground(const bool enable);
|
virtual int32_t SetTransparentBackground(const bool enable);
|
||||||
|
|
||||||
virtual WebRtc_Word32 SetText(const WebRtc_UWord8 textId,
|
virtual int32_t SetText(const uint8_t textId,
|
||||||
const WebRtc_UWord8* text,
|
const uint8_t* text,
|
||||||
const WebRtc_Word32 textLength,
|
const int32_t textLength,
|
||||||
const WebRtc_UWord32 textColorRef,
|
const uint32_t textColorRef,
|
||||||
const WebRtc_UWord32 backgroundColorRef,
|
const uint32_t backgroundColorRef,
|
||||||
const float left, const float top,
|
const float left, const float top,
|
||||||
const float right, const float bottom);
|
const float right, const float bottom);
|
||||||
|
|
||||||
virtual WebRtc_Word32 SetBitmap(const void* bitMap,
|
virtual int32_t SetBitmap(const void* bitMap,
|
||||||
const WebRtc_UWord8 pictureId,
|
const uint8_t pictureId,
|
||||||
const void* colorKey, const float left,
|
const void* colorKey, const float left,
|
||||||
const float top, const float right,
|
const float top, const float right,
|
||||||
const float bottom);
|
const float bottom);
|
||||||
|
|
||||||
// VideoRenderCallback
|
// VideoRenderCallback
|
||||||
virtual WebRtc_Word32 RenderFrame(const WebRtc_UWord32 streamId,
|
virtual int32_t RenderFrame(const uint32_t streamId,
|
||||||
I420VideoFrame& videoFrame);
|
I420VideoFrame& videoFrame);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
WebRtc_Word32 _id;
|
int32_t _id;
|
||||||
CriticalSectionWrapper& _critSect;
|
CriticalSectionWrapper& _critSect;
|
||||||
bool _fullscreen;
|
bool _fullscreen;
|
||||||
};
|
};
|
||||||
|
@ -27,11 +27,11 @@ public:
|
|||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
virtual WebRtc_Word32 Init() = 0;
|
virtual int32_t Init() = 0;
|
||||||
|
|
||||||
virtual WebRtc_Word32 ChangeUniqueId(const WebRtc_Word32 id) = 0;
|
virtual int32_t ChangeUniqueId(const int32_t id) = 0;
|
||||||
|
|
||||||
virtual WebRtc_Word32 ChangeWindow(void* window) = 0;
|
virtual int32_t ChangeWindow(void* window) = 0;
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
@ -40,26 +40,26 @@ public:
|
|||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
virtual VideoRenderCallback
|
virtual VideoRenderCallback
|
||||||
* AddIncomingRenderStream(const WebRtc_UWord32 streamId,
|
* AddIncomingRenderStream(const uint32_t streamId,
|
||||||
const WebRtc_UWord32 zOrder,
|
const uint32_t zOrder,
|
||||||
const float left,
|
const float left,
|
||||||
const float top,
|
const float top,
|
||||||
const float right,
|
const float right,
|
||||||
const float bottom) = 0;
|
const float bottom) = 0;
|
||||||
|
|
||||||
virtual WebRtc_Word32
|
virtual int32_t
|
||||||
DeleteIncomingRenderStream(const WebRtc_UWord32 streamId) = 0;
|
DeleteIncomingRenderStream(const uint32_t streamId) = 0;
|
||||||
|
|
||||||
virtual WebRtc_Word32
|
virtual int32_t
|
||||||
GetIncomingRenderStreamProperties(const WebRtc_UWord32 streamId,
|
GetIncomingRenderStreamProperties(const uint32_t streamId,
|
||||||
WebRtc_UWord32& zOrder,
|
uint32_t& zOrder,
|
||||||
float& left,
|
float& left,
|
||||||
float& top,
|
float& top,
|
||||||
float& right,
|
float& right,
|
||||||
float& bottom) const = 0;
|
float& bottom) const = 0;
|
||||||
// Implemented in common code?
|
// Implemented in common code?
|
||||||
//virtual WebRtc_UWord32 GetNumIncomingRenderStreams() const = 0;
|
//virtual uint32_t GetNumIncomingRenderStreams() const = 0;
|
||||||
//virtual bool HasIncomingRenderStream(const WebRtc_UWord16 stramId) const = 0;
|
//virtual bool HasIncomingRenderStream(const uint16_t stramId) const = 0;
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
@ -68,9 +68,9 @@ public:
|
|||||||
*
|
*
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
virtual WebRtc_Word32 StartRender() = 0;
|
virtual int32_t StartRender() = 0;
|
||||||
|
|
||||||
virtual WebRtc_Word32 StopRender() = 0;
|
virtual int32_t StopRender() = 0;
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
@ -84,48 +84,48 @@ public:
|
|||||||
virtual bool FullScreen() = 0;
|
virtual bool FullScreen() = 0;
|
||||||
|
|
||||||
// TODO: This should be treated in platform specific code only
|
// TODO: This should be treated in platform specific code only
|
||||||
virtual WebRtc_Word32
|
virtual int32_t
|
||||||
GetGraphicsMemory(WebRtc_UWord64& totalGraphicsMemory,
|
GetGraphicsMemory(uint64_t& totalGraphicsMemory,
|
||||||
WebRtc_UWord64& availableGraphicsMemory) const = 0;
|
uint64_t& availableGraphicsMemory) const = 0;
|
||||||
|
|
||||||
virtual WebRtc_Word32
|
virtual int32_t
|
||||||
GetScreenResolution(WebRtc_UWord32& screenWidth,
|
GetScreenResolution(uint32_t& screenWidth,
|
||||||
WebRtc_UWord32& screenHeight) const = 0;
|
uint32_t& screenHeight) const = 0;
|
||||||
|
|
||||||
virtual WebRtc_UWord32 RenderFrameRate(const WebRtc_UWord32 streamId) = 0;
|
virtual uint32_t RenderFrameRate(const uint32_t streamId) = 0;
|
||||||
|
|
||||||
virtual WebRtc_Word32 SetStreamCropping(const WebRtc_UWord32 streamId,
|
virtual int32_t SetStreamCropping(const uint32_t streamId,
|
||||||
const float left,
|
const float left,
|
||||||
const float top,
|
const float top,
|
||||||
const float right,
|
const float right,
|
||||||
const float bottom) = 0;
|
const float bottom) = 0;
|
||||||
|
|
||||||
virtual WebRtc_Word32 ConfigureRenderer(const WebRtc_UWord32 streamId,
|
virtual int32_t ConfigureRenderer(const uint32_t streamId,
|
||||||
const unsigned int zOrder,
|
const unsigned int zOrder,
|
||||||
const float left,
|
const float left,
|
||||||
const float top,
|
const float top,
|
||||||
const float right,
|
const float right,
|
||||||
const float bottom) = 0;
|
const float bottom) = 0;
|
||||||
|
|
||||||
virtual WebRtc_Word32 SetTransparentBackground(const bool enable) = 0;
|
virtual int32_t SetTransparentBackground(const bool enable) = 0;
|
||||||
|
|
||||||
virtual WebRtc_Word32 SetText(const WebRtc_UWord8 textId,
|
virtual int32_t SetText(const uint8_t textId,
|
||||||
const WebRtc_UWord8* text,
|
const uint8_t* text,
|
||||||
const WebRtc_Word32 textLength,
|
const int32_t textLength,
|
||||||
const WebRtc_UWord32 textColorRef,
|
const uint32_t textColorRef,
|
||||||
const WebRtc_UWord32 backgroundColorRef,
|
const uint32_t backgroundColorRef,
|
||||||
const float left,
|
const float left,
|
||||||
const float top,
|
const float top,
|
||||||
const float rigth,
|
const float rigth,
|
||||||
const float bottom) = 0;
|
const float bottom) = 0;
|
||||||
|
|
||||||
virtual WebRtc_Word32 SetBitmap(const void* bitMap,
|
virtual int32_t SetBitmap(const void* bitMap,
|
||||||
const WebRtc_UWord8 pictureId,
|
const uint8_t pictureId,
|
||||||
const void* colorKey,
|
const void* colorKey,
|
||||||
const float left,
|
const float left,
|
||||||
const float top,
|
const float top,
|
||||||
const float right,
|
const float right,
|
||||||
const float bottom) = 0;
|
const float bottom) = 0;
|
||||||
|
|
||||||
};
|
};
|
||||||
} //namespace webrtc
|
} //namespace webrtc
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
|
|
||||||
#if defined(WEBRTC_ANDROID) && !defined(WEBRTC_CHROMIUM_BUILD)
|
#if defined(WEBRTC_ANDROID) && !defined(WEBRTC_CHROMIUM_BUILD)
|
||||||
WebRtc_Word32 SetRenderAndroidVM(void* javaVM);
|
int32_t SetRenderAndroidVM(void* javaVM);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Class definitions
|
// Class definitions
|
||||||
@ -43,7 +43,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
static VideoRender
|
static VideoRender
|
||||||
* CreateVideoRender(
|
* CreateVideoRender(
|
||||||
const WebRtc_Word32 id,
|
const int32_t id,
|
||||||
void* window,
|
void* window,
|
||||||
const bool fullscreen,
|
const bool fullscreen,
|
||||||
const VideoRenderType videoRenderType =
|
const VideoRenderType videoRenderType =
|
||||||
@ -61,10 +61,10 @@ public:
|
|||||||
*
|
*
|
||||||
* id - new unique identifier of this video render module object
|
* id - new unique identifier of this video render module object
|
||||||
*/
|
*/
|
||||||
virtual WebRtc_Word32 ChangeUniqueId(const WebRtc_Word32 id) = 0;
|
virtual int32_t ChangeUniqueId(const int32_t id) = 0;
|
||||||
|
|
||||||
virtual WebRtc_Word32 TimeUntilNextProcess() = 0;
|
virtual int32_t TimeUntilNextProcess() = 0;
|
||||||
virtual WebRtc_Word32 Process() = 0;
|
virtual int32_t Process() = 0;
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
@ -82,7 +82,7 @@ public:
|
|||||||
*
|
*
|
||||||
* window - the new render window, assuming same type as originally created.
|
* window - the new render window, assuming same type as originally created.
|
||||||
*/
|
*/
|
||||||
virtual WebRtc_Word32 ChangeWindow(void* window) = 0;
|
virtual int32_t ChangeWindow(void* window) = 0;
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
@ -103,8 +103,8 @@ public:
|
|||||||
* Return - callback class to use for delivering new frames to render.
|
* Return - callback class to use for delivering new frames to render.
|
||||||
*/
|
*/
|
||||||
virtual VideoRenderCallback
|
virtual VideoRenderCallback
|
||||||
* AddIncomingRenderStream(const WebRtc_UWord32 streamId,
|
* AddIncomingRenderStream(const uint32_t streamId,
|
||||||
const WebRtc_UWord32 zOrder,
|
const uint32_t zOrder,
|
||||||
const float left, const float top,
|
const float left, const float top,
|
||||||
const float right, const float bottom) = 0;
|
const float right, const float bottom) = 0;
|
||||||
/*
|
/*
|
||||||
@ -112,8 +112,8 @@ public:
|
|||||||
*
|
*
|
||||||
* streamID - id of the stream to add
|
* streamID - id of the stream to add
|
||||||
*/
|
*/
|
||||||
virtual WebRtc_Word32
|
virtual int32_t
|
||||||
DeleteIncomingRenderStream(const WebRtc_UWord32 streamId) = 0;
|
DeleteIncomingRenderStream(const uint32_t streamId) = 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Add incoming render callback, used for external rendering
|
* Add incoming render callback, used for external rendering
|
||||||
@ -123,8 +123,8 @@ public:
|
|||||||
*
|
*
|
||||||
* Return - callback class to use for delivering new frames to render.
|
* Return - callback class to use for delivering new frames to render.
|
||||||
*/
|
*/
|
||||||
virtual WebRtc_Word32
|
virtual int32_t
|
||||||
AddExternalRenderCallback(const WebRtc_UWord32 streamId,
|
AddExternalRenderCallback(const uint32_t streamId,
|
||||||
VideoRenderCallback* renderObject) = 0;
|
VideoRenderCallback* renderObject) = 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -137,41 +137,41 @@ public:
|
|||||||
* right - [out] position of the stream in the window, [0.0f, 1.0f]
|
* right - [out] position of the stream in the window, [0.0f, 1.0f]
|
||||||
* bottom - [out] position of the stream in the window, [0.0f, 1.0f]
|
* bottom - [out] position of the stream in the window, [0.0f, 1.0f]
|
||||||
*/
|
*/
|
||||||
virtual WebRtc_Word32
|
virtual int32_t
|
||||||
GetIncomingRenderStreamProperties(const WebRtc_UWord32 streamId,
|
GetIncomingRenderStreamProperties(const uint32_t streamId,
|
||||||
WebRtc_UWord32& zOrder,
|
uint32_t& zOrder,
|
||||||
float& left, float& top,
|
float& left, float& top,
|
||||||
float& right, float& bottom) const = 0;
|
float& right, float& bottom) const = 0;
|
||||||
/*
|
/*
|
||||||
* The incoming frame rate to the module, not the rate rendered in the window.
|
* The incoming frame rate to the module, not the rate rendered in the window.
|
||||||
*/
|
*/
|
||||||
virtual WebRtc_UWord32
|
virtual uint32_t
|
||||||
GetIncomingFrameRate(const WebRtc_UWord32 streamId) = 0;
|
GetIncomingFrameRate(const uint32_t streamId) = 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Returns the number of incoming streams added to this render module
|
* Returns the number of incoming streams added to this render module
|
||||||
*/
|
*/
|
||||||
virtual WebRtc_UWord32 GetNumIncomingRenderStreams() const = 0;
|
virtual uint32_t GetNumIncomingRenderStreams() const = 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Returns true if this render module has the streamId added, false otherwise.
|
* Returns true if this render module has the streamId added, false otherwise.
|
||||||
*/
|
*/
|
||||||
virtual bool
|
virtual bool
|
||||||
HasIncomingRenderStream(const WebRtc_UWord32 streamId) const = 0;
|
HasIncomingRenderStream(const uint32_t streamId) const = 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Registers a callback to get raw images in the same time as sent
|
* Registers a callback to get raw images in the same time as sent
|
||||||
* to the renderer. To be used for external rendering.
|
* to the renderer. To be used for external rendering.
|
||||||
*/
|
*/
|
||||||
virtual WebRtc_Word32
|
virtual int32_t
|
||||||
RegisterRawFrameCallback(const WebRtc_UWord32 streamId,
|
RegisterRawFrameCallback(const uint32_t streamId,
|
||||||
VideoRenderCallback* callbackObj) = 0;
|
VideoRenderCallback* callbackObj) = 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This method is usefull to get last rendered frame for the stream specified
|
* This method is usefull to get last rendered frame for the stream specified
|
||||||
*/
|
*/
|
||||||
virtual WebRtc_Word32
|
virtual int32_t
|
||||||
GetLastRenderedFrame(const WebRtc_UWord32 streamId,
|
GetLastRenderedFrame(const uint32_t streamId,
|
||||||
I420VideoFrame &frame) const = 0;
|
I420VideoFrame &frame) const = 0;
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
@ -183,18 +183,18 @@ public:
|
|||||||
/*
|
/*
|
||||||
* Starts rendering the specified stream
|
* Starts rendering the specified stream
|
||||||
*/
|
*/
|
||||||
virtual WebRtc_Word32 StartRender(const WebRtc_UWord32 streamId) = 0;
|
virtual int32_t StartRender(const uint32_t streamId) = 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Stops the renderer
|
* Stops the renderer
|
||||||
*/
|
*/
|
||||||
virtual WebRtc_Word32 StopRender(const WebRtc_UWord32 streamId) = 0;
|
virtual int32_t StopRender(const uint32_t streamId) = 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Resets the renderer
|
* Resets the renderer
|
||||||
* No streams are removed. The state should be as after AddStream was called.
|
* No streams are removed. The state should be as after AddStream was called.
|
||||||
*/
|
*/
|
||||||
virtual WebRtc_Word32 ResetRender() = 0;
|
virtual int32_t ResetRender() = 0;
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
@ -215,23 +215,24 @@ public:
|
|||||||
/*
|
/*
|
||||||
* Gets screen resolution in pixels
|
* Gets screen resolution in pixels
|
||||||
*/
|
*/
|
||||||
virtual WebRtc_Word32
|
virtual int32_t
|
||||||
GetScreenResolution(WebRtc_UWord32& screenWidth,
|
GetScreenResolution(uint32_t& screenWidth,
|
||||||
WebRtc_UWord32& screenHeight) const = 0;
|
uint32_t& screenHeight) const = 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Get the actual render rate for this stream. I.e rendered frame rate,
|
* Get the actual render rate for this stream. I.e rendered frame rate,
|
||||||
* not frames delivered to the renderer.
|
* not frames delivered to the renderer.
|
||||||
*/
|
*/
|
||||||
virtual WebRtc_UWord32 RenderFrameRate(const WebRtc_UWord32 streamId) = 0;
|
virtual uint32_t RenderFrameRate(const uint32_t streamId) = 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Set cropping of incoming stream
|
* Set cropping of incoming stream
|
||||||
*/
|
*/
|
||||||
virtual WebRtc_Word32 SetStreamCropping(const WebRtc_UWord32 streamId,
|
virtual int32_t SetStreamCropping(const uint32_t streamId,
|
||||||
const float left, const float top,
|
const float left,
|
||||||
const float right,
|
const float top,
|
||||||
const float bottom) = 0;
|
const float right,
|
||||||
|
const float bottom) = 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* re-configure renderer
|
* re-configure renderer
|
||||||
@ -240,51 +241,52 @@ public:
|
|||||||
// Set the expected time needed by the graphics card or external renderer,
|
// Set the expected time needed by the graphics card or external renderer,
|
||||||
// i.e. frames will be released for rendering |delay_ms| before set render
|
// i.e. frames will be released for rendering |delay_ms| before set render
|
||||||
// time in the video frame.
|
// time in the video frame.
|
||||||
virtual WebRtc_Word32 SetExpectedRenderDelay(WebRtc_UWord32 stream_id,
|
virtual int32_t SetExpectedRenderDelay(uint32_t stream_id,
|
||||||
WebRtc_Word32 delay_ms) = 0;
|
int32_t delay_ms) = 0;
|
||||||
|
|
||||||
virtual WebRtc_Word32 ConfigureRenderer(const WebRtc_UWord32 streamId,
|
virtual int32_t ConfigureRenderer(const uint32_t streamId,
|
||||||
const unsigned int zOrder,
|
const unsigned int zOrder,
|
||||||
const float left, const float top,
|
const float left,
|
||||||
const float right,
|
const float top,
|
||||||
const float bottom) = 0;
|
const float right,
|
||||||
|
const float bottom) = 0;
|
||||||
|
|
||||||
virtual WebRtc_Word32 SetTransparentBackground(const bool enable) = 0;
|
virtual int32_t SetTransparentBackground(const bool enable) = 0;
|
||||||
|
|
||||||
virtual WebRtc_Word32 FullScreenRender(void* window, const bool enable) = 0;
|
virtual int32_t FullScreenRender(void* window, const bool enable) = 0;
|
||||||
|
|
||||||
virtual WebRtc_Word32 SetBitmap(const void* bitMap,
|
virtual int32_t SetBitmap(const void* bitMap,
|
||||||
const WebRtc_UWord8 pictureId,
|
const uint8_t pictureId,
|
||||||
const void* colorKey, const float left,
|
const void* colorKey,
|
||||||
const float top, const float right,
|
const float left, const float top,
|
||||||
const float bottom) = 0;
|
const float right, const float bottom) = 0;
|
||||||
|
|
||||||
virtual WebRtc_Word32 SetText(const WebRtc_UWord8 textId,
|
virtual int32_t SetText(const uint8_t textId,
|
||||||
const WebRtc_UWord8* text,
|
const uint8_t* text,
|
||||||
const WebRtc_Word32 textLength,
|
const int32_t textLength,
|
||||||
const WebRtc_UWord32 textColorRef,
|
const uint32_t textColorRef,
|
||||||
const WebRtc_UWord32 backgroundColorRef,
|
const uint32_t backgroundColorRef,
|
||||||
const float left, const float top,
|
const float left, const float top,
|
||||||
const float right, const float bottom) = 0;
|
const float right, const float bottom) = 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Set a start image. The image is rendered before the first image has been delivered
|
* Set a start image. The image is rendered before the first image has been delivered
|
||||||
*/
|
*/
|
||||||
virtual WebRtc_Word32
|
virtual int32_t
|
||||||
SetStartImage(const WebRtc_UWord32 streamId,
|
SetStartImage(const uint32_t streamId,
|
||||||
const I420VideoFrame& videoFrame) = 0;
|
const I420VideoFrame& videoFrame) = 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Set a timout image. The image is rendered if no videoframe has been delivered
|
* Set a timout image. The image is rendered if no videoframe has been delivered
|
||||||
*/
|
*/
|
||||||
virtual WebRtc_Word32 SetTimeoutImage(const WebRtc_UWord32 streamId,
|
virtual int32_t SetTimeoutImage(const uint32_t streamId,
|
||||||
const I420VideoFrame& videoFrame,
|
const I420VideoFrame& videoFrame,
|
||||||
const WebRtc_UWord32 timeout)= 0;
|
const uint32_t timeout)= 0;
|
||||||
|
|
||||||
virtual WebRtc_Word32 MirrorRenderStream(const int renderId,
|
virtual int32_t MirrorRenderStream(const int renderId,
|
||||||
const bool enable,
|
const bool enable,
|
||||||
const bool mirrorXAxis,
|
const bool mirrorXAxis,
|
||||||
const bool mirrorYAxis) = 0;
|
const bool mirrorYAxis) = 0;
|
||||||
};
|
};
|
||||||
} //namespace webrtc
|
} //namespace webrtc
|
||||||
#endif // WEBRTC_MODULES_VIDEO_RENDER_MAIN_INTERFACE_VIDEO_RENDER_H_
|
#endif // WEBRTC_MODULES_VIDEO_RENDER_MAIN_INTERFACE_VIDEO_RENDER_H_
|
||||||
|
@ -48,8 +48,8 @@ enum VideoRenderError
|
|||||||
class VideoRenderCallback
|
class VideoRenderCallback
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual WebRtc_Word32 RenderFrame(const WebRtc_UWord32 streamId,
|
virtual int32_t RenderFrame(const uint32_t streamId,
|
||||||
I420VideoFrame& videoFrame) = 0;
|
I420VideoFrame& videoFrame) = 0;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual ~VideoRenderCallback()
|
virtual ~VideoRenderCallback()
|
||||||
@ -61,7 +61,7 @@ protected:
|
|||||||
class VideoRenderFeedback
|
class VideoRenderFeedback
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual void OnRenderError(const WebRtc_Word32 streamId,
|
virtual void OnRenderError(const int32_t streamId,
|
||||||
const VideoRenderError error) = 0;
|
const VideoRenderError error) = 0;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -32,8 +32,8 @@
|
|||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
|
|
||||||
IncomingVideoStream::IncomingVideoStream(const WebRtc_Word32 module_id,
|
IncomingVideoStream::IncomingVideoStream(const int32_t module_id,
|
||||||
const WebRtc_UWord32 stream_id)
|
const uint32_t stream_id)
|
||||||
: module_id_(module_id),
|
: module_id_(module_id),
|
||||||
stream_id_(stream_id),
|
stream_id_(stream_id),
|
||||||
stream_critsect_(*CriticalSectionWrapper::CreateCriticalSection()),
|
stream_critsect_(*CriticalSectionWrapper::CreateCriticalSection()),
|
||||||
@ -77,7 +77,7 @@ IncomingVideoStream::~IncomingVideoStream() {
|
|||||||
delete &deliver_buffer_event_;
|
delete &deliver_buffer_event_;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 IncomingVideoStream::ChangeModuleId(const WebRtc_Word32 id) {
|
int32_t IncomingVideoStream::ChangeModuleId(const int32_t id) {
|
||||||
CriticalSectionScoped cs(&stream_critsect_);
|
CriticalSectionScoped cs(&stream_critsect_);
|
||||||
module_id_ = id;
|
module_id_ = id;
|
||||||
return 0;
|
return 0;
|
||||||
@ -88,8 +88,8 @@ VideoRenderCallback* IncomingVideoStream::ModuleCallback() {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 IncomingVideoStream::RenderFrame(const WebRtc_UWord32 stream_id,
|
int32_t IncomingVideoStream::RenderFrame(const uint32_t stream_id,
|
||||||
I420VideoFrame& video_frame) {
|
I420VideoFrame& video_frame) {
|
||||||
CriticalSectionScoped csS(&stream_critsect_);
|
CriticalSectionScoped csS(&stream_critsect_);
|
||||||
WEBRTC_TRACE(kTraceStream, kTraceVideoRenderer, module_id_,
|
WEBRTC_TRACE(kTraceStream, kTraceVideoRenderer, module_id_,
|
||||||
"%s for stream %d, render time: %u", __FUNCTION__, stream_id_,
|
"%s for stream %d, render time: %u", __FUNCTION__, stream_id_,
|
||||||
@ -121,11 +121,11 @@ WebRtc_Word32 IncomingVideoStream::RenderFrame(const WebRtc_UWord32 stream_id,
|
|||||||
|
|
||||||
// Rate statistics.
|
// Rate statistics.
|
||||||
num_frames_since_last_calculation_++;
|
num_frames_since_last_calculation_++;
|
||||||
WebRtc_Word64 now_ms = TickTime::MillisecondTimestamp();
|
int64_t now_ms = TickTime::MillisecondTimestamp();
|
||||||
if (now_ms >= last_rate_calculation_time_ms_ + KFrameRatePeriodMs) {
|
if (now_ms >= last_rate_calculation_time_ms_ + KFrameRatePeriodMs) {
|
||||||
incoming_rate_ =
|
incoming_rate_ =
|
||||||
static_cast<WebRtc_UWord32>(1000 * num_frames_since_last_calculation_ /
|
static_cast<uint32_t>(1000 * num_frames_since_last_calculation_ /
|
||||||
(now_ms - last_rate_calculation_time_ms_));
|
(now_ms - last_rate_calculation_time_ms_));
|
||||||
num_frames_since_last_calculation_ = 0;
|
num_frames_since_last_calculation_ = 0;
|
||||||
last_rate_calculation_time_ms_ = now_ms;
|
last_rate_calculation_time_ms_ = now_ms;
|
||||||
}
|
}
|
||||||
@ -138,20 +138,20 @@ WebRtc_Word32 IncomingVideoStream::RenderFrame(const WebRtc_UWord32 stream_id,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 IncomingVideoStream::SetStartImage(
|
int32_t IncomingVideoStream::SetStartImage(
|
||||||
const I420VideoFrame& video_frame) {
|
const I420VideoFrame& video_frame) {
|
||||||
CriticalSectionScoped csS(&thread_critsect_);
|
CriticalSectionScoped csS(&thread_critsect_);
|
||||||
return start_image_.CopyFrame(video_frame);
|
return start_image_.CopyFrame(video_frame);
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 IncomingVideoStream::SetTimeoutImage(
|
int32_t IncomingVideoStream::SetTimeoutImage(
|
||||||
const I420VideoFrame& video_frame, const WebRtc_UWord32 timeout) {
|
const I420VideoFrame& video_frame, const uint32_t timeout) {
|
||||||
CriticalSectionScoped csS(&thread_critsect_);
|
CriticalSectionScoped csS(&thread_critsect_);
|
||||||
timeout_time_ = timeout;
|
timeout_time_ = timeout;
|
||||||
return timeout_image_.CopyFrame(video_frame);
|
return timeout_image_.CopyFrame(video_frame);
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 IncomingVideoStream::SetRenderCallback(
|
int32_t IncomingVideoStream::SetRenderCallback(
|
||||||
VideoRenderCallback* render_callback) {
|
VideoRenderCallback* render_callback) {
|
||||||
CriticalSectionScoped cs(&stream_critsect_);
|
CriticalSectionScoped cs(&stream_critsect_);
|
||||||
|
|
||||||
@ -162,9 +162,9 @@ WebRtc_Word32 IncomingVideoStream::SetRenderCallback(
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 IncomingVideoStream::EnableMirroring(const bool enable,
|
int32_t IncomingVideoStream::EnableMirroring(const bool enable,
|
||||||
const bool mirror_x_axis,
|
const bool mirror_x_axis,
|
||||||
const bool mirror_y_axis) {
|
const bool mirror_y_axis) {
|
||||||
CriticalSectionScoped cs(&stream_critsect_);
|
CriticalSectionScoped cs(&stream_critsect_);
|
||||||
mirror_frames_enabled_ = enable;
|
mirror_frames_enabled_ = enable;
|
||||||
mirroring_.mirror_x_axis = mirror_x_axis;
|
mirroring_.mirror_x_axis = mirror_x_axis;
|
||||||
@ -173,8 +173,8 @@ WebRtc_Word32 IncomingVideoStream::EnableMirroring(const bool enable,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 IncomingVideoStream::SetExpectedRenderDelay(
|
int32_t IncomingVideoStream::SetExpectedRenderDelay(
|
||||||
WebRtc_Word32 delay_ms) {
|
int32_t delay_ms) {
|
||||||
CriticalSectionScoped csS(&stream_critsect_);
|
CriticalSectionScoped csS(&stream_critsect_);
|
||||||
if (running_) {
|
if (running_) {
|
||||||
WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, module_id_,
|
WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, module_id_,
|
||||||
@ -185,7 +185,7 @@ WebRtc_Word32 IncomingVideoStream::SetExpectedRenderDelay(
|
|||||||
return render_buffers_.SetRenderDelay(delay_ms);
|
return render_buffers_.SetRenderDelay(delay_ms);
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 IncomingVideoStream::SetExternalCallback(
|
int32_t IncomingVideoStream::SetExternalCallback(
|
||||||
VideoRenderCallback* external_callback) {
|
VideoRenderCallback* external_callback) {
|
||||||
CriticalSectionScoped cs(&stream_critsect_);
|
CriticalSectionScoped cs(&stream_critsect_);
|
||||||
WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, module_id_,
|
WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, module_id_,
|
||||||
@ -198,7 +198,7 @@ WebRtc_Word32 IncomingVideoStream::SetExternalCallback(
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 IncomingVideoStream::Start() {
|
int32_t IncomingVideoStream::Start() {
|
||||||
CriticalSectionScoped csS(&stream_critsect_);
|
CriticalSectionScoped csS(&stream_critsect_);
|
||||||
WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, module_id_,
|
WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, module_id_,
|
||||||
"%s for stream %d", __FUNCTION__, stream_id_);
|
"%s for stream %d", __FUNCTION__, stream_id_);
|
||||||
@ -235,7 +235,7 @@ WebRtc_Word32 IncomingVideoStream::Start() {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 IncomingVideoStream::Stop() {
|
int32_t IncomingVideoStream::Stop() {
|
||||||
CriticalSectionScoped cs_stream(&stream_critsect_);
|
CriticalSectionScoped cs_stream(&stream_critsect_);
|
||||||
WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, module_id_,
|
WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, module_id_,
|
||||||
"%s for stream %d", __FUNCTION__, stream_id_);
|
"%s for stream %d", __FUNCTION__, stream_id_);
|
||||||
@ -269,19 +269,19 @@ WebRtc_Word32 IncomingVideoStream::Stop() {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 IncomingVideoStream::Reset() {
|
int32_t IncomingVideoStream::Reset() {
|
||||||
CriticalSectionScoped cs_stream(&stream_critsect_);
|
CriticalSectionScoped cs_stream(&stream_critsect_);
|
||||||
CriticalSectionScoped cs_buffer(&buffer_critsect_);
|
CriticalSectionScoped cs_buffer(&buffer_critsect_);
|
||||||
render_buffers_.ReleaseAllFrames();
|
render_buffers_.ReleaseAllFrames();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_UWord32 IncomingVideoStream::StreamId() const {
|
uint32_t IncomingVideoStream::StreamId() const {
|
||||||
CriticalSectionScoped cs_stream(&stream_critsect_);
|
CriticalSectionScoped cs_stream(&stream_critsect_);
|
||||||
return stream_id_;
|
return stream_id_;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_UWord32 IncomingVideoStream::IncomingRate() const {
|
uint32_t IncomingVideoStream::IncomingRate() const {
|
||||||
CriticalSectionScoped cs(&stream_critsect_);
|
CriticalSectionScoped cs(&stream_critsect_);
|
||||||
return incoming_rate_;
|
return incoming_rate_;
|
||||||
}
|
}
|
||||||
@ -304,7 +304,7 @@ bool IncomingVideoStream::IncomingVideoStreamProcess() {
|
|||||||
// Get a new frame to render and the time for the frame after this one.
|
// Get a new frame to render and the time for the frame after this one.
|
||||||
buffer_critsect_.Enter();
|
buffer_critsect_.Enter();
|
||||||
frame_to_render = render_buffers_.FrameToRender();
|
frame_to_render = render_buffers_.FrameToRender();
|
||||||
WebRtc_UWord32 wait_time = render_buffers_.TimeToNextFrameRelease();
|
uint32_t wait_time = render_buffers_.TimeToNextFrameRelease();
|
||||||
buffer_critsect_.Leave();
|
buffer_critsect_.Leave();
|
||||||
|
|
||||||
// Set timer for next frame to render.
|
// Set timer for next frame to render.
|
||||||
@ -362,7 +362,7 @@ bool IncomingVideoStream::IncomingVideoStreamProcess() {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 IncomingVideoStream::GetLastRenderedFrame(
|
int32_t IncomingVideoStream::GetLastRenderedFrame(
|
||||||
I420VideoFrame& video_frame) const {
|
I420VideoFrame& video_frame) const {
|
||||||
CriticalSectionScoped cs(&buffer_critsect_);
|
CriticalSectionScoped cs(&buffer_critsect_);
|
||||||
return video_frame.CopyFrame(last_rendered_frame_);
|
return video_frame.CopyFrame(last_rendered_frame_);
|
||||||
|
@ -29,46 +29,46 @@ struct VideoMirroring {
|
|||||||
|
|
||||||
class IncomingVideoStream : public VideoRenderCallback {
|
class IncomingVideoStream : public VideoRenderCallback {
|
||||||
public:
|
public:
|
||||||
IncomingVideoStream(const WebRtc_Word32 module_id,
|
IncomingVideoStream(const int32_t module_id,
|
||||||
const WebRtc_UWord32 stream_id);
|
const uint32_t stream_id);
|
||||||
~IncomingVideoStream();
|
~IncomingVideoStream();
|
||||||
|
|
||||||
WebRtc_Word32 ChangeModuleId(const WebRtc_Word32 id);
|
int32_t ChangeModuleId(const int32_t id);
|
||||||
|
|
||||||
// Get callback to deliver frames to the module.
|
// Get callback to deliver frames to the module.
|
||||||
VideoRenderCallback* ModuleCallback();
|
VideoRenderCallback* ModuleCallback();
|
||||||
virtual WebRtc_Word32 RenderFrame(const WebRtc_UWord32 stream_id,
|
virtual int32_t RenderFrame(const uint32_t stream_id,
|
||||||
I420VideoFrame& video_frame);
|
I420VideoFrame& video_frame);
|
||||||
|
|
||||||
// Set callback to the platform dependent code.
|
// Set callback to the platform dependent code.
|
||||||
WebRtc_Word32 SetRenderCallback(VideoRenderCallback* render_callback);
|
int32_t SetRenderCallback(VideoRenderCallback* render_callback);
|
||||||
|
|
||||||
// Callback for file recording, snapshot, ...
|
// Callback for file recording, snapshot, ...
|
||||||
WebRtc_Word32 SetExternalCallback(VideoRenderCallback* render_object);
|
int32_t SetExternalCallback(VideoRenderCallback* render_object);
|
||||||
|
|
||||||
// Start/Stop.
|
// Start/Stop.
|
||||||
WebRtc_Word32 Start();
|
int32_t Start();
|
||||||
WebRtc_Word32 Stop();
|
int32_t Stop();
|
||||||
|
|
||||||
// Clear all buffers.
|
// Clear all buffers.
|
||||||
WebRtc_Word32 Reset();
|
int32_t Reset();
|
||||||
|
|
||||||
// Properties.
|
// Properties.
|
||||||
WebRtc_UWord32 StreamId() const;
|
uint32_t StreamId() const;
|
||||||
WebRtc_UWord32 IncomingRate() const;
|
uint32_t IncomingRate() const;
|
||||||
|
|
||||||
WebRtc_Word32 GetLastRenderedFrame(I420VideoFrame& video_frame) const;
|
int32_t GetLastRenderedFrame(I420VideoFrame& video_frame) const;
|
||||||
|
|
||||||
WebRtc_Word32 SetStartImage(const I420VideoFrame& video_frame);
|
int32_t SetStartImage(const I420VideoFrame& video_frame);
|
||||||
|
|
||||||
WebRtc_Word32 SetTimeoutImage(const I420VideoFrame& video_frame,
|
int32_t SetTimeoutImage(const I420VideoFrame& video_frame,
|
||||||
const WebRtc_UWord32 timeout);
|
const uint32_t timeout);
|
||||||
|
|
||||||
WebRtc_Word32 EnableMirroring(const bool enable,
|
int32_t EnableMirroring(const bool enable,
|
||||||
const bool mirror_xaxis,
|
const bool mirror_xaxis,
|
||||||
const bool mirror_yaxis);
|
const bool mirror_yaxis);
|
||||||
|
|
||||||
WebRtc_Word32 SetExpectedRenderDelay(WebRtc_Word32 delay_ms);
|
int32_t SetExpectedRenderDelay(int32_t delay_ms);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
static bool IncomingVideoStreamThreadFun(void* obj);
|
static bool IncomingVideoStreamThreadFun(void* obj);
|
||||||
@ -79,8 +79,8 @@ class IncomingVideoStream : public VideoRenderCallback {
|
|||||||
enum { KEventMaxWaitTimeMs = 100 };
|
enum { KEventMaxWaitTimeMs = 100 };
|
||||||
enum { KFrameRatePeriodMs = 1000 };
|
enum { KFrameRatePeriodMs = 1000 };
|
||||||
|
|
||||||
WebRtc_Word32 module_id_;
|
int32_t module_id_;
|
||||||
WebRtc_UWord32 stream_id_;
|
uint32_t stream_id_;
|
||||||
// Critsects in allowed to enter order.
|
// Critsects in allowed to enter order.
|
||||||
CriticalSectionWrapper& stream_critsect_;
|
CriticalSectionWrapper& stream_critsect_;
|
||||||
CriticalSectionWrapper& thread_critsect_;
|
CriticalSectionWrapper& thread_critsect_;
|
||||||
@ -94,17 +94,17 @@ class IncomingVideoStream : public VideoRenderCallback {
|
|||||||
VideoRenderFrames& render_buffers_;
|
VideoRenderFrames& render_buffers_;
|
||||||
|
|
||||||
RawVideoType callbackVideoType_;
|
RawVideoType callbackVideoType_;
|
||||||
WebRtc_UWord32 callbackWidth_;
|
uint32_t callbackWidth_;
|
||||||
WebRtc_UWord32 callbackHeight_;
|
uint32_t callbackHeight_;
|
||||||
|
|
||||||
WebRtc_UWord32 incoming_rate_;
|
uint32_t incoming_rate_;
|
||||||
WebRtc_Word64 last_rate_calculation_time_ms_;
|
int64_t last_rate_calculation_time_ms_;
|
||||||
WebRtc_UWord16 num_frames_since_last_calculation_;
|
uint16_t num_frames_since_last_calculation_;
|
||||||
I420VideoFrame last_rendered_frame_;
|
I420VideoFrame last_rendered_frame_;
|
||||||
I420VideoFrame temp_frame_;
|
I420VideoFrame temp_frame_;
|
||||||
I420VideoFrame start_image_;
|
I420VideoFrame start_image_;
|
||||||
I420VideoFrame timeout_image_;
|
I420VideoFrame timeout_image_;
|
||||||
WebRtc_UWord32 timeout_time_;
|
uint32_t timeout_time_;
|
||||||
|
|
||||||
bool mirror_frames_enabled_;
|
bool mirror_frames_enabled_;
|
||||||
VideoMirroring mirroring_;
|
VideoMirroring mirroring_;
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
|
|
||||||
VideoRenderLinuxImpl::VideoRenderLinuxImpl(
|
VideoRenderLinuxImpl::VideoRenderLinuxImpl(
|
||||||
const WebRtc_Word32 id,
|
const int32_t id,
|
||||||
const VideoRenderType videoRenderType,
|
const VideoRenderType videoRenderType,
|
||||||
void* window, const bool fullscreen) :
|
void* window, const bool fullscreen) :
|
||||||
_id(id),
|
_id(id),
|
||||||
@ -37,7 +37,7 @@ VideoRenderLinuxImpl::~VideoRenderLinuxImpl()
|
|||||||
delete &_renderLinuxCritsect;
|
delete &_renderLinuxCritsect;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderLinuxImpl::Init()
|
int32_t VideoRenderLinuxImpl::Init()
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, _id, "%s",
|
WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, _id, "%s",
|
||||||
__FUNCTION__);
|
__FUNCTION__);
|
||||||
@ -61,7 +61,7 @@ WebRtc_Word32 VideoRenderLinuxImpl::Init()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderLinuxImpl::ChangeUniqueId(const WebRtc_Word32 id)
|
int32_t VideoRenderLinuxImpl::ChangeUniqueId(const int32_t id)
|
||||||
{
|
{
|
||||||
CriticalSectionScoped cs(&_renderLinuxCritsect);
|
CriticalSectionScoped cs(&_renderLinuxCritsect);
|
||||||
|
|
||||||
@ -69,7 +69,7 @@ WebRtc_Word32 VideoRenderLinuxImpl::ChangeUniqueId(const WebRtc_Word32 id)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderLinuxImpl::ChangeWindow(void* window)
|
int32_t VideoRenderLinuxImpl::ChangeWindow(void* window)
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, _id, "%s",
|
WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, _id, "%s",
|
||||||
__FUNCTION__);
|
__FUNCTION__);
|
||||||
@ -86,8 +86,8 @@ WebRtc_Word32 VideoRenderLinuxImpl::ChangeWindow(void* window)
|
|||||||
}
|
}
|
||||||
|
|
||||||
VideoRenderCallback* VideoRenderLinuxImpl::AddIncomingRenderStream(
|
VideoRenderCallback* VideoRenderLinuxImpl::AddIncomingRenderStream(
|
||||||
const WebRtc_UWord32 streamId,
|
const uint32_t streamId,
|
||||||
const WebRtc_UWord32 zOrder,
|
const uint32_t zOrder,
|
||||||
const float left,
|
const float left,
|
||||||
const float top,
|
const float top,
|
||||||
const float right,
|
const float right,
|
||||||
@ -121,8 +121,8 @@ VideoRenderCallback* VideoRenderLinuxImpl::AddIncomingRenderStream(
|
|||||||
return renderCallback;
|
return renderCallback;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderLinuxImpl::DeleteIncomingRenderStream(
|
int32_t VideoRenderLinuxImpl::DeleteIncomingRenderStream(
|
||||||
const WebRtc_UWord32 streamId)
|
const uint32_t streamId)
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, _id, "%s",
|
WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, _id, "%s",
|
||||||
__FUNCTION__);
|
__FUNCTION__);
|
||||||
@ -135,9 +135,9 @@ WebRtc_Word32 VideoRenderLinuxImpl::DeleteIncomingRenderStream(
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderLinuxImpl::GetIncomingRenderStreamProperties(
|
int32_t VideoRenderLinuxImpl::GetIncomingRenderStreamProperties(
|
||||||
const WebRtc_UWord32 streamId,
|
const uint32_t streamId,
|
||||||
WebRtc_UWord32& zOrder,
|
uint32_t& zOrder,
|
||||||
float& left,
|
float& left,
|
||||||
float& top,
|
float& top,
|
||||||
float& right,
|
float& right,
|
||||||
@ -156,14 +156,14 @@ WebRtc_Word32 VideoRenderLinuxImpl::GetIncomingRenderStreamProperties(
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderLinuxImpl::StartRender()
|
int32_t VideoRenderLinuxImpl::StartRender()
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, _id, "%s",
|
WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, _id, "%s",
|
||||||
__FUNCTION__);
|
__FUNCTION__);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderLinuxImpl::StopRender()
|
int32_t VideoRenderLinuxImpl::StopRender()
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, _id, "%s",
|
WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, _id, "%s",
|
||||||
__FUNCTION__);
|
__FUNCTION__);
|
||||||
@ -185,29 +185,29 @@ bool VideoRenderLinuxImpl::FullScreen()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderLinuxImpl::GetGraphicsMemory(
|
int32_t VideoRenderLinuxImpl::GetGraphicsMemory(
|
||||||
WebRtc_UWord64& /*totalGraphicsMemory*/,
|
uint64_t& /*totalGraphicsMemory*/,
|
||||||
WebRtc_UWord64& /*availableGraphicsMemory*/) const
|
uint64_t& /*availableGraphicsMemory*/) const
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceError, kTraceVideoRenderer, _id,
|
WEBRTC_TRACE(kTraceError, kTraceVideoRenderer, _id,
|
||||||
"%s - not supported on Linux", __FUNCTION__);
|
"%s - not supported on Linux", __FUNCTION__);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderLinuxImpl::GetScreenResolution(
|
int32_t VideoRenderLinuxImpl::GetScreenResolution(
|
||||||
WebRtc_UWord32& /*screenWidth*/,
|
uint32_t& /*screenWidth*/,
|
||||||
WebRtc_UWord32& /*screenHeight*/) const
|
uint32_t& /*screenHeight*/) const
|
||||||
{
|
{
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_UWord32 VideoRenderLinuxImpl::RenderFrameRate(const WebRtc_UWord32 /*streamId*/)
|
uint32_t VideoRenderLinuxImpl::RenderFrameRate(const uint32_t /*streamId*/)
|
||||||
{
|
{
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderLinuxImpl::SetStreamCropping(
|
int32_t VideoRenderLinuxImpl::SetStreamCropping(
|
||||||
const WebRtc_UWord32 /*streamId*/,
|
const uint32_t /*streamId*/,
|
||||||
const float /*left*/,
|
const float /*left*/,
|
||||||
const float /*top*/,
|
const float /*top*/,
|
||||||
const float /*right*/,
|
const float /*right*/,
|
||||||
@ -218,15 +218,15 @@ WebRtc_Word32 VideoRenderLinuxImpl::SetStreamCropping(
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderLinuxImpl::SetTransparentBackground(const bool /*enable*/)
|
int32_t VideoRenderLinuxImpl::SetTransparentBackground(const bool /*enable*/)
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceError, kTraceVideoRenderer, _id,
|
WEBRTC_TRACE(kTraceError, kTraceVideoRenderer, _id,
|
||||||
"%s - not supported on Linux", __FUNCTION__);
|
"%s - not supported on Linux", __FUNCTION__);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderLinuxImpl::ConfigureRenderer(
|
int32_t VideoRenderLinuxImpl::ConfigureRenderer(
|
||||||
const WebRtc_UWord32 streamId,
|
const uint32_t streamId,
|
||||||
const unsigned int zOrder,
|
const unsigned int zOrder,
|
||||||
const float left,
|
const float left,
|
||||||
const float top,
|
const float top,
|
||||||
@ -238,12 +238,12 @@ WebRtc_Word32 VideoRenderLinuxImpl::ConfigureRenderer(
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderLinuxImpl::SetText(
|
int32_t VideoRenderLinuxImpl::SetText(
|
||||||
const WebRtc_UWord8 textId,
|
const uint8_t textId,
|
||||||
const WebRtc_UWord8* text,
|
const uint8_t* text,
|
||||||
const WebRtc_Word32 textLength,
|
const int32_t textLength,
|
||||||
const WebRtc_UWord32 textColorRef,
|
const uint32_t textColorRef,
|
||||||
const WebRtc_UWord32 backgroundColorRef,
|
const uint32_t backgroundColorRef,
|
||||||
const float left, const float top,
|
const float left, const float top,
|
||||||
const float rigth,
|
const float rigth,
|
||||||
const float bottom)
|
const float bottom)
|
||||||
@ -253,13 +253,13 @@ WebRtc_Word32 VideoRenderLinuxImpl::SetText(
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderLinuxImpl::SetBitmap(const void* bitMap,
|
int32_t VideoRenderLinuxImpl::SetBitmap(const void* bitMap,
|
||||||
const WebRtc_UWord8 pictureId,
|
const uint8_t pictureId,
|
||||||
const void* colorKey,
|
const void* colorKey,
|
||||||
const float left,
|
const float left,
|
||||||
const float top,
|
const float top,
|
||||||
const float right,
|
const float right,
|
||||||
const float bottom)
|
const float bottom)
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceError, kTraceVideoRenderer, _id,
|
WEBRTC_TRACE(kTraceError, kTraceVideoRenderer, _id,
|
||||||
"%s - not supported on Linux", __FUNCTION__);
|
"%s - not supported on Linux", __FUNCTION__);
|
||||||
|
@ -26,17 +26,17 @@ public:
|
|||||||
* Constructor/destructor
|
* Constructor/destructor
|
||||||
*/
|
*/
|
||||||
|
|
||||||
VideoRenderLinuxImpl(const WebRtc_Word32 id,
|
VideoRenderLinuxImpl(const int32_t id,
|
||||||
const VideoRenderType videoRenderType,
|
const VideoRenderType videoRenderType,
|
||||||
void* window, const bool fullscreen);
|
void* window, const bool fullscreen);
|
||||||
|
|
||||||
virtual ~VideoRenderLinuxImpl();
|
virtual ~VideoRenderLinuxImpl();
|
||||||
|
|
||||||
virtual WebRtc_Word32 Init();
|
virtual int32_t Init();
|
||||||
|
|
||||||
virtual WebRtc_Word32 ChangeUniqueId(const WebRtc_Word32 id);
|
virtual int32_t ChangeUniqueId(const int32_t id);
|
||||||
|
|
||||||
virtual WebRtc_Word32 ChangeWindow(void* window);
|
virtual int32_t ChangeWindow(void* window);
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
@ -45,17 +45,17 @@ public:
|
|||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
virtual VideoRenderCallback
|
virtual VideoRenderCallback
|
||||||
* AddIncomingRenderStream(const WebRtc_UWord32 streamId,
|
* AddIncomingRenderStream(const uint32_t streamId,
|
||||||
const WebRtc_UWord32 zOrder,
|
const uint32_t zOrder,
|
||||||
const float left, const float top,
|
const float left, const float top,
|
||||||
const float right, const float bottom);
|
const float right, const float bottom);
|
||||||
|
|
||||||
virtual WebRtc_Word32
|
virtual int32_t
|
||||||
DeleteIncomingRenderStream(const WebRtc_UWord32 streamId);
|
DeleteIncomingRenderStream(const uint32_t streamId);
|
||||||
|
|
||||||
virtual WebRtc_Word32
|
virtual int32_t
|
||||||
GetIncomingRenderStreamProperties(const WebRtc_UWord32 streamId,
|
GetIncomingRenderStreamProperties(const uint32_t streamId,
|
||||||
WebRtc_UWord32& zOrder,
|
uint32_t& zOrder,
|
||||||
float& left, float& top,
|
float& left, float& top,
|
||||||
float& right, float& bottom) const;
|
float& right, float& bottom) const;
|
||||||
|
|
||||||
@ -65,9 +65,9 @@ public:
|
|||||||
*
|
*
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
virtual WebRtc_Word32 StartRender();
|
virtual int32_t StartRender();
|
||||||
|
|
||||||
virtual WebRtc_Word32 StopRender();
|
virtual int32_t StopRender();
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
@ -81,45 +81,43 @@ public:
|
|||||||
|
|
||||||
virtual bool FullScreen();
|
virtual bool FullScreen();
|
||||||
|
|
||||||
virtual WebRtc_Word32
|
virtual int32_t
|
||||||
GetGraphicsMemory(WebRtc_UWord64& totalGraphicsMemory,
|
GetGraphicsMemory(uint64_t& totalGraphicsMemory,
|
||||||
WebRtc_UWord64& availableGraphicsMemory) const;
|
uint64_t& availableGraphicsMemory) const;
|
||||||
|
|
||||||
virtual WebRtc_Word32
|
virtual int32_t
|
||||||
GetScreenResolution(WebRtc_UWord32& screenWidth,
|
GetScreenResolution(uint32_t& screenWidth,
|
||||||
WebRtc_UWord32& screenHeight) const;
|
uint32_t& screenHeight) const;
|
||||||
|
|
||||||
virtual WebRtc_UWord32 RenderFrameRate(const WebRtc_UWord32 streamId);
|
virtual uint32_t RenderFrameRate(const uint32_t streamId);
|
||||||
|
|
||||||
virtual WebRtc_Word32 SetStreamCropping(const WebRtc_UWord32 streamId,
|
virtual int32_t SetStreamCropping(const uint32_t streamId,
|
||||||
const float left, const float top,
|
const float left, const float top,
|
||||||
const float right,
|
const float right, const float bottom);
|
||||||
const float bottom);
|
|
||||||
|
|
||||||
virtual WebRtc_Word32 SetTransparentBackground(const bool enable);
|
virtual int32_t SetTransparentBackground(const bool enable);
|
||||||
|
|
||||||
virtual WebRtc_Word32 ConfigureRenderer(const WebRtc_UWord32 streamId,
|
virtual int32_t ConfigureRenderer(const uint32_t streamId,
|
||||||
const unsigned int zOrder,
|
const unsigned int zOrder,
|
||||||
const float left, const float top,
|
const float left, const float top,
|
||||||
const float right,
|
const float right, const float bottom);
|
||||||
const float bottom);
|
|
||||||
|
|
||||||
virtual WebRtc_Word32 SetText(const WebRtc_UWord8 textId,
|
virtual int32_t SetText(const uint8_t textId,
|
||||||
const WebRtc_UWord8* text,
|
const uint8_t* text,
|
||||||
const WebRtc_Word32 textLength,
|
const int32_t textLength,
|
||||||
const WebRtc_UWord32 textColorRef,
|
const uint32_t textColorRef,
|
||||||
const WebRtc_UWord32 backgroundColorRef,
|
const uint32_t backgroundColorRef,
|
||||||
const float left, const float top,
|
const float left, const float top,
|
||||||
const float rigth, const float bottom);
|
const float rigth, const float bottom);
|
||||||
|
|
||||||
virtual WebRtc_Word32 SetBitmap(const void* bitMap,
|
virtual int32_t SetBitmap(const void* bitMap,
|
||||||
const WebRtc_UWord8 pictureId,
|
const uint8_t pictureId,
|
||||||
const void* colorKey, const float left,
|
const void* colorKey,
|
||||||
const float top, const float right,
|
const float left, const float top,
|
||||||
const float bottom);
|
const float right, const float bottom);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
WebRtc_Word32 _id;
|
int32_t _id;
|
||||||
CriticalSectionWrapper& _renderLinuxCritsect;
|
CriticalSectionWrapper& _renderLinuxCritsect;
|
||||||
|
|
||||||
void* _ptrWindow;
|
void* _ptrWindow;
|
||||||
|
@ -21,7 +21,7 @@ static Display *dispArray[DISP_MAX];
|
|||||||
static int dispCount = 0;
|
static int dispCount = 0;
|
||||||
|
|
||||||
|
|
||||||
VideoX11Channel::VideoX11Channel(WebRtc_Word32 id) :
|
VideoX11Channel::VideoX11Channel(int32_t id) :
|
||||||
_crit(*CriticalSectionWrapper::CreateCriticalSection()), _display(NULL),
|
_crit(*CriticalSectionWrapper::CreateCriticalSection()), _display(NULL),
|
||||||
_shminfo(), _image(NULL), _window(0L), _gc(NULL),
|
_shminfo(), _image(NULL), _window(0L), _gc(NULL),
|
||||||
_width(DEFAULT_RENDER_FRAME_WIDTH),
|
_width(DEFAULT_RENDER_FRAME_WIDTH),
|
||||||
@ -43,8 +43,8 @@ VideoX11Channel::~VideoX11Channel()
|
|||||||
delete &_crit;
|
delete &_crit;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoX11Channel::RenderFrame(const WebRtc_UWord32 streamId,
|
int32_t VideoX11Channel::RenderFrame(const uint32_t streamId,
|
||||||
I420VideoFrame& videoFrame) {
|
I420VideoFrame& videoFrame) {
|
||||||
CriticalSectionScoped cs(&_crit);
|
CriticalSectionScoped cs(&_crit);
|
||||||
if (_width != videoFrame.width() || _height
|
if (_width != videoFrame.width() || _height
|
||||||
!= videoFrame.height()) {
|
!= videoFrame.height()) {
|
||||||
@ -55,9 +55,9 @@ WebRtc_Word32 VideoX11Channel::RenderFrame(const WebRtc_UWord32 streamId,
|
|||||||
return DeliverFrame(videoFrame);
|
return DeliverFrame(videoFrame);
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoX11Channel::FrameSizeChange(WebRtc_Word32 width,
|
int32_t VideoX11Channel::FrameSizeChange(int32_t width,
|
||||||
WebRtc_Word32 height,
|
int32_t height,
|
||||||
WebRtc_Word32 /*numberOfStreams */)
|
int32_t /*numberOfStreams */)
|
||||||
{
|
{
|
||||||
CriticalSectionScoped cs(&_crit);
|
CriticalSectionScoped cs(&_crit);
|
||||||
if (_prepared)
|
if (_prepared)
|
||||||
@ -72,7 +72,7 @@ WebRtc_Word32 VideoX11Channel::FrameSizeChange(WebRtc_Word32 width,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoX11Channel::DeliverFrame(const I420VideoFrame& videoFrame) {
|
int32_t VideoX11Channel::DeliverFrame(const I420VideoFrame& videoFrame) {
|
||||||
CriticalSectionScoped cs(&_crit);
|
CriticalSectionScoped cs(&_crit);
|
||||||
if (!_prepared) {
|
if (!_prepared) {
|
||||||
return 0;
|
return 0;
|
||||||
@ -93,8 +93,7 @@ WebRtc_Word32 VideoX11Channel::DeliverFrame(const I420VideoFrame& videoFrame) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoX11Channel::GetFrameSize(WebRtc_Word32& width,
|
int32_t VideoX11Channel::GetFrameSize(int32_t& width, int32_t& height)
|
||||||
WebRtc_Word32& height)
|
|
||||||
{
|
{
|
||||||
width = _width;
|
width = _width;
|
||||||
height = _height;
|
height = _height;
|
||||||
@ -102,8 +101,8 @@ WebRtc_Word32 VideoX11Channel::GetFrameSize(WebRtc_Word32& width,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoX11Channel::Init(Window window, float left, float top,
|
int32_t VideoX11Channel::Init(Window window, float left, float top,
|
||||||
float right, float bottom)
|
float right, float bottom)
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, _Id, "%s",
|
WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, _Id, "%s",
|
||||||
__FUNCTION__);
|
__FUNCTION__);
|
||||||
@ -148,10 +147,10 @@ WebRtc_Word32 VideoX11Channel::Init(Window window, float left, float top,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
_xPos = (WebRtc_Word32) (winWidth * left);
|
_xPos = (int32_t) (winWidth * left);
|
||||||
_yPos = (WebRtc_Word32) (winHeight * top);
|
_yPos = (int32_t) (winHeight * top);
|
||||||
_outWidth = (WebRtc_Word32) (winWidth * (right - left));
|
_outWidth = (int32_t) (winWidth * (right - left));
|
||||||
_outHeight = (WebRtc_Word32) (winHeight * (bottom - top));
|
_outHeight = (int32_t) (winHeight * (bottom - top));
|
||||||
if (_outWidth % 2)
|
if (_outWidth % 2)
|
||||||
_outWidth++; // the renderer want's sizes that are multiples of two
|
_outWidth++; // the renderer want's sizes that are multiples of two
|
||||||
if (_outHeight % 2)
|
if (_outHeight % 2)
|
||||||
@ -172,7 +171,7 @@ WebRtc_Word32 VideoX11Channel::Init(Window window, float left, float top,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoX11Channel::ChangeWindow(Window window)
|
int32_t VideoX11Channel::ChangeWindow(Window window)
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, _Id, "%s",
|
WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, _Id, "%s",
|
||||||
__FUNCTION__);
|
__FUNCTION__);
|
||||||
@ -208,7 +207,7 @@ WebRtc_Word32 VideoX11Channel::ChangeWindow(Window window)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoX11Channel::ReleaseWindow()
|
int32_t VideoX11Channel::ReleaseWindow()
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, _Id, "%s",
|
WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, _Id, "%s",
|
||||||
__FUNCTION__);
|
__FUNCTION__);
|
||||||
@ -227,8 +226,7 @@ WebRtc_Word32 VideoX11Channel::ReleaseWindow()
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoX11Channel::CreateLocalRenderer(WebRtc_Word32 width,
|
int32_t VideoX11Channel::CreateLocalRenderer(int32_t width, int32_t height)
|
||||||
WebRtc_Word32 height)
|
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, _Id, "%s",
|
WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, _Id, "%s",
|
||||||
__FUNCTION__);
|
__FUNCTION__);
|
||||||
@ -274,7 +272,7 @@ WebRtc_Word32 VideoX11Channel::CreateLocalRenderer(WebRtc_Word32 width,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoX11Channel::RemoveRenderer()
|
int32_t VideoX11Channel::RemoveRenderer()
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, _Id, "%s",
|
WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, _Id, "%s",
|
||||||
__FUNCTION__);
|
__FUNCTION__);
|
||||||
@ -297,10 +295,9 @@ WebRtc_Word32 VideoX11Channel::RemoveRenderer()
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoX11Channel::GetStreamProperties(WebRtc_UWord32& zOrder,
|
int32_t VideoX11Channel::GetStreamProperties(uint32_t& zOrder,
|
||||||
float& left, float& top,
|
float& left, float& top,
|
||||||
float& right,
|
float& right, float& bottom) const
|
||||||
float& bottom) const
|
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, _Id, "%s",
|
WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, _Id, "%s",
|
||||||
__FUNCTION__);
|
__FUNCTION__);
|
||||||
|
@ -29,24 +29,24 @@ class CriticalSectionWrapper;
|
|||||||
class VideoX11Channel: public VideoRenderCallback
|
class VideoX11Channel: public VideoRenderCallback
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
VideoX11Channel(WebRtc_Word32 id);
|
VideoX11Channel(int32_t id);
|
||||||
|
|
||||||
virtual ~VideoX11Channel();
|
virtual ~VideoX11Channel();
|
||||||
|
|
||||||
virtual WebRtc_Word32 RenderFrame(const WebRtc_UWord32 streamId,
|
virtual int32_t RenderFrame(const uint32_t streamId,
|
||||||
I420VideoFrame& videoFrame);
|
I420VideoFrame& videoFrame);
|
||||||
|
|
||||||
WebRtc_Word32 FrameSizeChange(WebRtc_Word32 width, WebRtc_Word32 height,
|
int32_t FrameSizeChange(int32_t width, int32_t height,
|
||||||
WebRtc_Word32 numberOfStreams);
|
int32_t numberOfStreams);
|
||||||
WebRtc_Word32 DeliverFrame(const I420VideoFrame& videoFrame);
|
int32_t DeliverFrame(const I420VideoFrame& videoFrame);
|
||||||
WebRtc_Word32 GetFrameSize(WebRtc_Word32& width, WebRtc_Word32& height);
|
int32_t GetFrameSize(int32_t& width, int32_t& height);
|
||||||
WebRtc_Word32 Init(Window window, float left, float top, float right,
|
int32_t Init(Window window, float left, float top, float right,
|
||||||
float bottom);
|
float bottom);
|
||||||
WebRtc_Word32 ChangeWindow(Window window);
|
int32_t ChangeWindow(Window window);
|
||||||
WebRtc_Word32
|
int32_t
|
||||||
GetStreamProperties(WebRtc_UWord32& zOrder, float& left,
|
GetStreamProperties(uint32_t& zOrder, float& left,
|
||||||
float& top, float& right, float& bottom) const;
|
float& top, float& right, float& bottom) const;
|
||||||
WebRtc_Word32 ReleaseWindow();
|
int32_t ReleaseWindow();
|
||||||
|
|
||||||
bool IsPrepared()
|
bool IsPrepared()
|
||||||
{
|
{
|
||||||
@ -55,9 +55,9 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
WebRtc_Word32
|
int32_t
|
||||||
CreateLocalRenderer(WebRtc_Word32 width, WebRtc_Word32 height);
|
CreateLocalRenderer(int32_t width, int32_t height);
|
||||||
WebRtc_Word32 RemoveRenderer();
|
int32_t RemoveRenderer();
|
||||||
|
|
||||||
//FIXME a better place for this method? the GetWidthHeight no longer
|
//FIXME a better place for this method? the GetWidthHeight no longer
|
||||||
// supported by common_video.
|
// supported by common_video.
|
||||||
@ -71,14 +71,14 @@ private:
|
|||||||
XImage* _image;
|
XImage* _image;
|
||||||
Window _window;
|
Window _window;
|
||||||
GC _gc;
|
GC _gc;
|
||||||
WebRtc_Word32 _width; // incoming frame width
|
int32_t _width; // incoming frame width
|
||||||
WebRtc_Word32 _height; // incoming frame height
|
int32_t _height; // incoming frame height
|
||||||
WebRtc_Word32 _outWidth; // render frame width
|
int32_t _outWidth; // render frame width
|
||||||
WebRtc_Word32 _outHeight; // render frame height
|
int32_t _outHeight; // render frame height
|
||||||
WebRtc_Word32 _xPos; // position within window
|
int32_t _xPos; // position within window
|
||||||
WebRtc_Word32 _yPos;
|
int32_t _yPos;
|
||||||
bool _prepared; // true if ready to use
|
bool _prepared; // true if ready to use
|
||||||
WebRtc_Word32 _dispCount;
|
int32_t _dispCount;
|
||||||
|
|
||||||
unsigned char* _buffer;
|
unsigned char* _buffer;
|
||||||
float _top;
|
float _top;
|
||||||
@ -86,7 +86,7 @@ private:
|
|||||||
float _right;
|
float _right;
|
||||||
float _bottom;
|
float _bottom;
|
||||||
|
|
||||||
WebRtc_Word32 _Id;
|
int32_t _Id;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ VideoX11Render::~VideoX11Render()
|
|||||||
delete &_critSect;
|
delete &_critSect;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoX11Render::Init()
|
int32_t VideoX11Render::Init()
|
||||||
{
|
{
|
||||||
CriticalSectionScoped cs(&_critSect);
|
CriticalSectionScoped cs(&_critSect);
|
||||||
|
|
||||||
@ -36,7 +36,7 @@ WebRtc_Word32 VideoX11Render::Init()
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoX11Render::ChangeWindow(Window window)
|
int32_t VideoX11Render::ChangeWindow(Window window)
|
||||||
{
|
{
|
||||||
CriticalSectionScoped cs(&_critSect);
|
CriticalSectionScoped cs(&_critSect);
|
||||||
VideoX11Channel* renderChannel = NULL;
|
VideoX11Channel* renderChannel = NULL;
|
||||||
@ -60,8 +60,8 @@ WebRtc_Word32 VideoX11Render::ChangeWindow(Window window)
|
|||||||
}
|
}
|
||||||
|
|
||||||
VideoX11Channel* VideoX11Render::CreateX11RenderChannel(
|
VideoX11Channel* VideoX11Render::CreateX11RenderChannel(
|
||||||
WebRtc_Word32 streamId,
|
int32_t streamId,
|
||||||
WebRtc_Word32 zOrder,
|
int32_t zOrder,
|
||||||
const float left,
|
const float left,
|
||||||
const float top,
|
const float top,
|
||||||
const float right,
|
const float right,
|
||||||
@ -99,7 +99,7 @@ VideoX11Channel* VideoX11Render::CreateX11RenderChannel(
|
|||||||
return renderChannel;
|
return renderChannel;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoX11Render::DeleteX11RenderChannel(WebRtc_Word32 streamId)
|
int32_t VideoX11Render::DeleteX11RenderChannel(int32_t streamId)
|
||||||
{
|
{
|
||||||
CriticalSectionScoped cs(&_critSect);
|
CriticalSectionScoped cs(&_critSect);
|
||||||
|
|
||||||
@ -123,9 +123,9 @@ WebRtc_Word32 VideoX11Render::DeleteX11RenderChannel(WebRtc_Word32 streamId)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoX11Render::GetIncomingStreamProperties(
|
int32_t VideoX11Render::GetIncomingStreamProperties(
|
||||||
WebRtc_Word32 streamId,
|
int32_t streamId,
|
||||||
WebRtc_UWord32& zOrder,
|
uint32_t& zOrder,
|
||||||
float& left,
|
float& left,
|
||||||
float& top,
|
float& top,
|
||||||
float& right,
|
float& right,
|
||||||
|
@ -28,22 +28,22 @@ public:
|
|||||||
VideoX11Render(Window window);
|
VideoX11Render(Window window);
|
||||||
~VideoX11Render();
|
~VideoX11Render();
|
||||||
|
|
||||||
WebRtc_Word32 Init();
|
int32_t Init();
|
||||||
WebRtc_Word32 ChangeWindow(Window window);
|
int32_t ChangeWindow(Window window);
|
||||||
|
|
||||||
VideoX11Channel* CreateX11RenderChannel(WebRtc_Word32 streamId,
|
VideoX11Channel* CreateX11RenderChannel(int32_t streamId,
|
||||||
WebRtc_Word32 zOrder,
|
int32_t zOrder,
|
||||||
const float left,
|
const float left,
|
||||||
const float top,
|
const float top,
|
||||||
const float right,
|
const float right,
|
||||||
const float bottom);
|
const float bottom);
|
||||||
|
|
||||||
WebRtc_Word32 DeleteX11RenderChannel(WebRtc_Word32 streamId);
|
int32_t DeleteX11RenderChannel(int32_t streamId);
|
||||||
|
|
||||||
WebRtc_Word32 GetIncomingStreamProperties(WebRtc_Word32 streamId,
|
int32_t GetIncomingStreamProperties(int32_t streamId,
|
||||||
WebRtc_UWord32& zOrder,
|
uint32_t& zOrder,
|
||||||
float& left, float& top,
|
float& left, float& top,
|
||||||
float& right, float& bottom);
|
float& right, float& bottom);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Window _window;
|
Window _window;
|
||||||
|
@ -80,8 +80,8 @@ VideoChannelAGL::~VideoChannelAGL()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoChannelAGL::RenderFrame(const WebRtc_UWord32 streamId,
|
int32_t VideoChannelAGL::RenderFrame(const uint32_t streamId,
|
||||||
I420VideoFrame& videoFrame) {
|
I420VideoFrame& videoFrame) {
|
||||||
_owner->LockAGLCntx();
|
_owner->LockAGLCntx();
|
||||||
if (_width != videoFrame.width() ||
|
if (_width != videoFrame.width() ||
|
||||||
_height != videoFrame.height()) {
|
_height != videoFrame.height()) {
|
||||||
@ -1872,7 +1872,7 @@ int VideoRenderAGL::ChangeWindow(void* newWindowRef)
|
|||||||
UnlockAGLCntx();
|
UnlockAGLCntx();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
WebRtc_Word32 VideoRenderAGL::ChangeUniqueID(WebRtc_Word32 id)
|
int32_t VideoRenderAGL::ChangeUniqueID(int32_t id)
|
||||||
{
|
{
|
||||||
LockAGLCntx();
|
LockAGLCntx();
|
||||||
|
|
||||||
@ -1880,7 +1880,7 @@ WebRtc_Word32 VideoRenderAGL::ChangeUniqueID(WebRtc_Word32 id)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderAGL::StartRender()
|
int32_t VideoRenderAGL::StartRender()
|
||||||
{
|
{
|
||||||
|
|
||||||
LockAGLCntx();
|
LockAGLCntx();
|
||||||
@ -1926,7 +1926,7 @@ WebRtc_Word32 VideoRenderAGL::StartRender()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderAGL::StopRender()
|
int32_t VideoRenderAGL::StopRender()
|
||||||
{
|
{
|
||||||
LockAGLCntx();
|
LockAGLCntx();
|
||||||
|
|
||||||
@ -1952,7 +1952,7 @@ WebRtc_Word32 VideoRenderAGL::StopRender()
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderAGL::DeleteAGLChannel(const WebRtc_UWord32 streamID)
|
int32_t VideoRenderAGL::DeleteAGLChannel(const uint32_t streamID)
|
||||||
{
|
{
|
||||||
|
|
||||||
LockAGLCntx();
|
LockAGLCntx();
|
||||||
@ -1973,12 +1973,12 @@ WebRtc_Word32 VideoRenderAGL::DeleteAGLChannel(const WebRtc_UWord32 streamID)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderAGL::GetChannelProperties(const WebRtc_UWord16 streamId,
|
int32_t VideoRenderAGL::GetChannelProperties(const uint16_t streamId,
|
||||||
WebRtc_UWord32& zOrder,
|
uint32_t& zOrder,
|
||||||
float& left,
|
float& left,
|
||||||
float& top,
|
float& top,
|
||||||
float& right,
|
float& right,
|
||||||
float& bottom)
|
float& bottom)
|
||||||
{
|
{
|
||||||
|
|
||||||
LockAGLCntx();
|
LockAGLCntx();
|
||||||
|
@ -15,12 +15,10 @@
|
|||||||
#ifndef WEBRTC_MODULES_VIDEO_RENDER_MAIN_SOURCE_MAC_VIDEO_RENDER_AGL_H_
|
#ifndef WEBRTC_MODULES_VIDEO_RENDER_MAIN_SOURCE_MAC_VIDEO_RENDER_AGL_H_
|
||||||
#define WEBRTC_MODULES_VIDEO_RENDER_MAIN_SOURCE_MAC_VIDEO_RENDER_AGL_H_
|
#define WEBRTC_MODULES_VIDEO_RENDER_MAIN_SOURCE_MAC_VIDEO_RENDER_AGL_H_
|
||||||
|
|
||||||
|
|
||||||
#include "video_render_defines.h"
|
#include "video_render_defines.h"
|
||||||
|
|
||||||
|
|
||||||
#define NEW_HIVIEW_PARENT_EVENT_HANDLER 1
|
#define NEW_HIVIEW_PARENT_EVENT_HANDLER 1
|
||||||
#define NEW_HIVIEW_EVENT_HANDLER 1
|
#define NEW_HIVIEW_EVENT_HANDLER 1
|
||||||
#define USE_STRUCT_RGN
|
#define USE_STRUCT_RGN
|
||||||
|
|
||||||
#include <AGL/agl.h>
|
#include <AGL/agl.h>
|
||||||
@ -38,149 +36,145 @@ class CriticalSectionWrapper;
|
|||||||
class EventWrapper;
|
class EventWrapper;
|
||||||
class ThreadWrapper;
|
class ThreadWrapper;
|
||||||
|
|
||||||
class VideoChannelAGL : public VideoRenderCallback
|
class VideoChannelAGL : public VideoRenderCallback {
|
||||||
{
|
public:
|
||||||
public:
|
|
||||||
|
|
||||||
VideoChannelAGL(AGLContext& aglContext, int iId, VideoRenderAGL* owner);
|
VideoChannelAGL(AGLContext& aglContext, int iId, VideoRenderAGL* owner);
|
||||||
virtual ~VideoChannelAGL();
|
virtual ~VideoChannelAGL();
|
||||||
virtual int FrameSizeChange(int width, int height, int numberOfStreams);
|
virtual int FrameSizeChange(int width, int height, int numberOfStreams);
|
||||||
virtual int DeliverFrame(const I420VideoFrame& videoFrame);
|
virtual int DeliverFrame(const I420VideoFrame& videoFrame);
|
||||||
virtual int UpdateSize(int width, int height);
|
virtual int UpdateSize(int width, int height);
|
||||||
int SetStreamSettings(int streamId, float startWidth, float startHeight, float stopWidth, float stopHeight);
|
int SetStreamSettings(int streamId, float startWidth, float startHeight,
|
||||||
int SetStreamCropSettings(int streamId, float startWidth, float startHeight, float stopWidth, float stopHeight);
|
float stopWidth, float stopHeight);
|
||||||
int RenderOffScreenBuffer();
|
int SetStreamCropSettings(int streamId, float startWidth, float startHeight,
|
||||||
int IsUpdated(bool& isUpdated);
|
float stopWidth, float stopHeight);
|
||||||
virtual int UpdateStretchSize(int stretchHeight, int stretchWidth);
|
int RenderOffScreenBuffer();
|
||||||
virtual WebRtc_Word32 RenderFrame(const WebRtc_UWord32 streamId,
|
int IsUpdated(bool& isUpdated);
|
||||||
I420VideoFrame& videoFrame);
|
virtual int UpdateStretchSize(int stretchHeight, int stretchWidth);
|
||||||
|
virtual int32_t RenderFrame(const uint32_t streamId,
|
||||||
|
I420VideoFrame& videoFrame);
|
||||||
private:
|
|
||||||
|
private:
|
||||||
AGLContext _aglContext;
|
|
||||||
int _id;
|
AGLContext _aglContext;
|
||||||
VideoRenderAGL* _owner;
|
int _id;
|
||||||
int _width;
|
VideoRenderAGL* _owner;
|
||||||
int _height;
|
int _width;
|
||||||
int _stretchedWidth;
|
int _height;
|
||||||
int _stretchedHeight;
|
int _stretchedWidth;
|
||||||
float _startHeight;
|
int _stretchedHeight;
|
||||||
float _startWidth;
|
float _startHeight;
|
||||||
float _stopWidth;
|
float _startWidth;
|
||||||
float _stopHeight;
|
float _stopWidth;
|
||||||
int _xOldWidth;
|
float _stopHeight;
|
||||||
int _yOldHeight;
|
int _xOldWidth;
|
||||||
int _oldStretchedHeight;
|
int _yOldHeight;
|
||||||
int _oldStretchedWidth;
|
int _oldStretchedHeight;
|
||||||
unsigned char* _buffer;
|
int _oldStretchedWidth;
|
||||||
int _bufferSize;
|
unsigned char* _buffer;
|
||||||
int _incommingBufferSize;
|
int _bufferSize;
|
||||||
bool _bufferIsUpdated;
|
int _incommingBufferSize;
|
||||||
bool _sizeInitialized;
|
bool _bufferIsUpdated;
|
||||||
int _numberOfStreams;
|
bool _sizeInitialized;
|
||||||
bool _bVideoSizeStartedChanging;
|
int _numberOfStreams;
|
||||||
GLenum _pixelFormat;
|
bool _bVideoSizeStartedChanging;
|
||||||
GLenum _pixelDataType;
|
GLenum _pixelFormat;
|
||||||
unsigned int _texture;
|
GLenum _pixelDataType;
|
||||||
|
unsigned int _texture;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class VideoRenderAGL {
|
||||||
|
public:
|
||||||
|
VideoRenderAGL(WindowRef windowRef, bool fullscreen, int iId);
|
||||||
|
VideoRenderAGL(HIViewRef windowRef, bool fullscreen, int iId);
|
||||||
|
~VideoRenderAGL();
|
||||||
|
|
||||||
|
int Init();
|
||||||
|
VideoChannelAGL* CreateAGLChannel(int channel, int zOrder, float startWidth,
|
||||||
|
float startHeight, float stopWidth,
|
||||||
|
float stopHeight);
|
||||||
|
VideoChannelAGL* ConfigureAGLChannel(int channel, int zOrder,
|
||||||
|
float startWidth, float startHeight,
|
||||||
|
float stopWidth, float stopHeight);
|
||||||
|
int DeleteAGLChannel(int channel);
|
||||||
|
int DeleteAllAGLChannels();
|
||||||
|
int StopThread();
|
||||||
|
bool IsFullScreen();
|
||||||
|
bool HasChannels();
|
||||||
|
bool HasChannel(int channel);
|
||||||
|
int GetChannels(std::list<int>& channelList);
|
||||||
|
void LockAGLCntx();
|
||||||
|
void UnlockAGLCntx();
|
||||||
|
|
||||||
|
static int GetOpenGLVersion(int& aglMajor, int& aglMinor);
|
||||||
|
|
||||||
class VideoRenderAGL
|
// ********** new module functions ************ //
|
||||||
{
|
int ChangeWindow(void* newWindowRef);
|
||||||
public:
|
int32_t ChangeUniqueID(int32_t id);
|
||||||
VideoRenderAGL(WindowRef windowRef, bool fullscreen, int iId);
|
int32_t StartRender();
|
||||||
VideoRenderAGL(HIViewRef windowRef, bool fullscreen, int iId);
|
int32_t StopRender();
|
||||||
~VideoRenderAGL();
|
int32_t DeleteAGLChannel(const uint32_t streamID);
|
||||||
|
int32_t GetChannelProperties(const uint16_t streamId, uint32_t& zOrder,
|
||||||
|
float& left, float& top, float& right,
|
||||||
|
float& bottom);
|
||||||
|
|
||||||
int Init();
|
protected:
|
||||||
VideoChannelAGL* CreateAGLChannel(int channel, int zOrder, float startWidth, float startHeight, float stopWidth, float stopHeight);
|
static bool ScreenUpdateThreadProc(void* obj);
|
||||||
VideoChannelAGL* ConfigureAGLChannel(int channel, int zOrder, float startWidth, float startHeight, float stopWidth, float stopHeight);
|
bool ScreenUpdateProcess();
|
||||||
int DeleteAGLChannel(int channel);
|
int GetWindowRect(Rect& rect);
|
||||||
int DeleteAllAGLChannels();
|
|
||||||
int StopThread();
|
|
||||||
bool IsFullScreen();
|
|
||||||
bool HasChannels();
|
|
||||||
bool HasChannel(int channel);
|
|
||||||
int GetChannels(std::list<int>& channelList);
|
|
||||||
void LockAGLCntx();
|
|
||||||
void UnlockAGLCntx();
|
|
||||||
|
|
||||||
static int GetOpenGLVersion(int& aglMajor, int& aglMinor);
|
|
||||||
|
|
||||||
// ********** new module functions ************ //
|
|
||||||
int ChangeWindow(void* newWindowRef);
|
|
||||||
WebRtc_Word32 ChangeUniqueID(WebRtc_Word32 id);
|
|
||||||
WebRtc_Word32 StartRender();
|
|
||||||
WebRtc_Word32 StopRender();
|
|
||||||
WebRtc_Word32 DeleteAGLChannel(const WebRtc_UWord32 streamID);
|
|
||||||
WebRtc_Word32 GetChannelProperties(const WebRtc_UWord16 streamId,
|
|
||||||
WebRtc_UWord32& zOrder,
|
|
||||||
float& left,
|
|
||||||
float& top,
|
|
||||||
float& right,
|
|
||||||
float& bottom);
|
|
||||||
|
|
||||||
protected:
|
private:
|
||||||
static bool ScreenUpdateThreadProc(void* obj);
|
int CreateMixingContext();
|
||||||
bool ScreenUpdateProcess();
|
int RenderOffScreenBuffers();
|
||||||
int GetWindowRect(Rect& rect);
|
int SwapAndDisplayBuffers();
|
||||||
|
int UpdateClipping();
|
||||||
private:
|
int CalculateVisibleRegion(ControlRef control, RgnHandle& visibleRgn,
|
||||||
int CreateMixingContext();
|
bool clipChildren);
|
||||||
int RenderOffScreenBuffers();
|
bool CheckValidRegion(RgnHandle rHandle);
|
||||||
int SwapAndDisplayBuffers();
|
void ParentWindowResized(WindowRef window);
|
||||||
int UpdateClipping();
|
|
||||||
int CalculateVisibleRegion(ControlRef control, RgnHandle &visibleRgn, bool clipChildren);
|
|
||||||
bool CheckValidRegion(RgnHandle rHandle);
|
|
||||||
void ParentWindowResized(WindowRef window);
|
|
||||||
|
|
||||||
// Carbon GUI event handlers
|
// Carbon GUI event handlers
|
||||||
static pascal OSStatus sHandleWindowResized (EventHandlerCallRef nextHandler, EventRef theEvent, void* userData);
|
static pascal OSStatus sHandleWindowResized(
|
||||||
static pascal OSStatus sHandleHiViewResized (EventHandlerCallRef nextHandler, EventRef theEvent, void* userData);
|
EventHandlerCallRef nextHandler, EventRef theEvent, void* userData);
|
||||||
|
static pascal OSStatus sHandleHiViewResized(
|
||||||
|
EventHandlerCallRef nextHandler, EventRef theEvent, void* userData);
|
||||||
|
|
||||||
|
HIViewRef _hiviewRef;
|
||||||
|
WindowRef _windowRef;
|
||||||
|
bool _fullScreen;
|
||||||
|
int _id;
|
||||||
|
webrtc::CriticalSectionWrapper& _renderCritSec;
|
||||||
|
webrtc::ThreadWrapper* _screenUpdateThread;
|
||||||
|
webrtc::EventWrapper* _screenUpdateEvent;
|
||||||
|
bool _isHIViewRef;
|
||||||
|
AGLContext _aglContext;
|
||||||
|
int _windowWidth;
|
||||||
|
int _windowHeight;
|
||||||
|
int _lastWindowWidth;
|
||||||
|
int _lastWindowHeight;
|
||||||
|
int _lastHiViewWidth;
|
||||||
|
int _lastHiViewHeight;
|
||||||
|
int _currentParentWindowHeight;
|
||||||
|
int _currentParentWindowWidth;
|
||||||
|
Rect _currentParentWindowBounds;
|
||||||
|
bool _windowHasResized;
|
||||||
|
Rect _lastParentWindowBounds;
|
||||||
|
Rect _currentHIViewBounds;
|
||||||
|
Rect _lastHIViewBounds;
|
||||||
|
Rect _windowRect;
|
||||||
|
std::map<int, VideoChannelAGL*> _aglChannels;
|
||||||
|
std::multimap<int, int> _zOrderToChannel;
|
||||||
|
EventHandlerRef _hiviewEventHandlerRef;
|
||||||
|
EventHandlerRef _windowEventHandlerRef;
|
||||||
|
HIRect _currentViewBounds;
|
||||||
|
HIRect _lastViewBounds;
|
||||||
|
bool _renderingIsPaused;
|
||||||
|
unsigned int _threadID;
|
||||||
|
|
||||||
HIViewRef _hiviewRef;
|
|
||||||
WindowRef _windowRef;
|
|
||||||
bool _fullScreen;
|
|
||||||
int _id;
|
|
||||||
webrtc::CriticalSectionWrapper& _renderCritSec;
|
|
||||||
webrtc::ThreadWrapper* _screenUpdateThread;
|
|
||||||
webrtc::EventWrapper* _screenUpdateEvent;
|
|
||||||
bool _isHIViewRef;
|
|
||||||
AGLContext _aglContext;
|
|
||||||
int _windowWidth;
|
|
||||||
int _windowHeight;
|
|
||||||
int _lastWindowWidth;
|
|
||||||
int _lastWindowHeight;
|
|
||||||
int _lastHiViewWidth;
|
|
||||||
int _lastHiViewHeight;
|
|
||||||
int _currentParentWindowHeight;
|
|
||||||
int _currentParentWindowWidth;
|
|
||||||
Rect _currentParentWindowBounds;
|
|
||||||
bool _windowHasResized;
|
|
||||||
Rect _lastParentWindowBounds;
|
|
||||||
Rect _currentHIViewBounds;
|
|
||||||
Rect _lastHIViewBounds;
|
|
||||||
Rect _windowRect;
|
|
||||||
std::map<int, VideoChannelAGL*> _aglChannels;
|
|
||||||
std::multimap<int, int> _zOrderToChannel;
|
|
||||||
EventHandlerRef _hiviewEventHandlerRef;
|
|
||||||
EventHandlerRef _windowEventHandlerRef;
|
|
||||||
HIRect _currentViewBounds;
|
|
||||||
HIRect _lastViewBounds;
|
|
||||||
bool _renderingIsPaused;
|
|
||||||
unsigned int _threadID;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} //namespace webrtc
|
} //namespace webrtc
|
||||||
|
|
||||||
|
#endif // WEBRTC_MODULES_VIDEO_RENDER_MAIN_SOURCE_MAC_VIDEO_RENDER_AGL_H_
|
||||||
|
|
||||||
#endif // WEBRTC_MODULES_VIDEO_RENDER_MAIN_SOURCE_MAC_VIDEO_RENDER_AGL_H_
|
#endif // CARBON_RENDERING
|
||||||
|
|
||||||
#endif // CARBON_RENDERING
|
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
|
|
||||||
VideoRenderMacCarbonImpl::VideoRenderMacCarbonImpl(const WebRtc_Word32 id,
|
VideoRenderMacCarbonImpl::VideoRenderMacCarbonImpl(const int32_t id,
|
||||||
const VideoRenderType videoRenderType,
|
const VideoRenderType videoRenderType,
|
||||||
void* window,
|
void* window,
|
||||||
const bool fullscreen) :
|
const bool fullscreen) :
|
||||||
@ -39,7 +39,7 @@ VideoRenderMacCarbonImpl::~VideoRenderMacCarbonImpl()
|
|||||||
delete &_renderMacCarbonCritsect;
|
delete &_renderMacCarbonCritsect;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32
|
int32_t
|
||||||
VideoRenderMacCarbonImpl::Init()
|
VideoRenderMacCarbonImpl::Init()
|
||||||
{
|
{
|
||||||
CriticalSectionScoped cs(&_renderMacCarbonCritsect);
|
CriticalSectionScoped cs(&_renderMacCarbonCritsect);
|
||||||
@ -96,8 +96,8 @@ VideoRenderMacCarbonImpl::Init()
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32
|
int32_t
|
||||||
VideoRenderMacCarbonImpl::ChangeUniqueId(const WebRtc_Word32 id)
|
VideoRenderMacCarbonImpl::ChangeUniqueId(const int32_t id)
|
||||||
{
|
{
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
@ -113,7 +113,7 @@ VideoRenderMacCarbonImpl::ChangeUniqueId(const WebRtc_Word32 id)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32
|
int32_t
|
||||||
VideoRenderMacCarbonImpl::ChangeWindow(void* window)
|
VideoRenderMacCarbonImpl::ChangeWindow(void* window)
|
||||||
{
|
{
|
||||||
return -1;
|
return -1;
|
||||||
@ -133,8 +133,8 @@ VideoRenderMacCarbonImpl::ChangeWindow(void* window)
|
|||||||
}
|
}
|
||||||
|
|
||||||
VideoRenderCallback*
|
VideoRenderCallback*
|
||||||
VideoRenderMacCarbonImpl::AddIncomingRenderStream(const WebRtc_UWord32 streamId,
|
VideoRenderMacCarbonImpl::AddIncomingRenderStream(const uint32_t streamId,
|
||||||
const WebRtc_UWord32 zOrder,
|
const uint32_t zOrder,
|
||||||
const float left,
|
const float left,
|
||||||
const float top,
|
const float top,
|
||||||
const float right,
|
const float right,
|
||||||
@ -158,8 +158,8 @@ VideoRenderMacCarbonImpl::AddIncomingRenderStream(const WebRtc_UWord32 streamId,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32
|
int32_t
|
||||||
VideoRenderMacCarbonImpl::DeleteIncomingRenderStream(const WebRtc_UWord32 streamId)
|
VideoRenderMacCarbonImpl::DeleteIncomingRenderStream(const uint32_t streamId)
|
||||||
{
|
{
|
||||||
|
|
||||||
WEBRTC_TRACE(kTraceDebug, kTraceVideoRenderer, _id, "%s:%d", __FUNCTION__, __LINE__);
|
WEBRTC_TRACE(kTraceDebug, kTraceVideoRenderer, _id, "%s:%d", __FUNCTION__, __LINE__);
|
||||||
@ -169,9 +169,9 @@ VideoRenderMacCarbonImpl::DeleteIncomingRenderStream(const WebRtc_UWord32 stream
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32
|
int32_t
|
||||||
VideoRenderMacCarbonImpl::GetIncomingRenderStreamProperties(const WebRtc_UWord32 streamId,
|
VideoRenderMacCarbonImpl::GetIncomingRenderStreamProperties(const uint32_t streamId,
|
||||||
WebRtc_UWord32& zOrder,
|
uint32_t& zOrder,
|
||||||
float& left,
|
float& left,
|
||||||
float& top,
|
float& top,
|
||||||
float& right,
|
float& right,
|
||||||
@ -181,13 +181,13 @@ VideoRenderMacCarbonImpl::GetIncomingRenderStreamProperties(const WebRtc_UWord32
|
|||||||
return _ptrCarbonRender->GetChannelProperties(streamId, zOrder, left, top, right, bottom);
|
return _ptrCarbonRender->GetChannelProperties(streamId, zOrder, left, top, right, bottom);
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32
|
int32_t
|
||||||
VideoRenderMacCarbonImpl::StartRender()
|
VideoRenderMacCarbonImpl::StartRender()
|
||||||
{
|
{
|
||||||
return _ptrCarbonRender->StartRender();
|
return _ptrCarbonRender->StartRender();
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32
|
int32_t
|
||||||
VideoRenderMacCarbonImpl::StopRender()
|
VideoRenderMacCarbonImpl::StopRender()
|
||||||
{
|
{
|
||||||
return _ptrCarbonRender->StopRender();
|
return _ptrCarbonRender->StopRender();
|
||||||
@ -211,18 +211,18 @@ VideoRenderMacCarbonImpl::FullScreen()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32
|
int32_t
|
||||||
VideoRenderMacCarbonImpl::GetGraphicsMemory(WebRtc_UWord64& totalGraphicsMemory,
|
VideoRenderMacCarbonImpl::GetGraphicsMemory(uint64_t& totalGraphicsMemory,
|
||||||
WebRtc_UWord64& availableGraphicsMemory) const
|
uint64_t& availableGraphicsMemory) const
|
||||||
{
|
{
|
||||||
totalGraphicsMemory = 0;
|
totalGraphicsMemory = 0;
|
||||||
availableGraphicsMemory = 0;
|
availableGraphicsMemory = 0;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32
|
int32_t
|
||||||
VideoRenderMacCarbonImpl::GetScreenResolution(WebRtc_UWord32& screenWidth,
|
VideoRenderMacCarbonImpl::GetScreenResolution(uint32_t& screenWidth,
|
||||||
WebRtc_UWord32& screenHeight) const
|
uint32_t& screenHeight) const
|
||||||
{
|
{
|
||||||
CriticalSectionScoped cs(&_renderMacCarbonCritsect);
|
CriticalSectionScoped cs(&_renderMacCarbonCritsect);
|
||||||
//NSScreen* mainScreen = [NSScreen mainScreen];
|
//NSScreen* mainScreen = [NSScreen mainScreen];
|
||||||
@ -234,15 +234,15 @@ VideoRenderMacCarbonImpl::GetScreenResolution(WebRtc_UWord32& screenWidth,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_UWord32
|
uint32_t
|
||||||
VideoRenderMacCarbonImpl::RenderFrameRate(const WebRtc_UWord32 streamId)
|
VideoRenderMacCarbonImpl::RenderFrameRate(const uint32_t streamId)
|
||||||
{
|
{
|
||||||
CriticalSectionScoped cs(&_renderMacCarbonCritsect);
|
CriticalSectionScoped cs(&_renderMacCarbonCritsect);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32
|
int32_t
|
||||||
VideoRenderMacCarbonImpl::SetStreamCropping(const WebRtc_UWord32 streamId,
|
VideoRenderMacCarbonImpl::SetStreamCropping(const uint32_t streamId,
|
||||||
const float left,
|
const float left,
|
||||||
const float top,
|
const float top,
|
||||||
const float right,
|
const float right,
|
||||||
@ -251,42 +251,42 @@ VideoRenderMacCarbonImpl::SetStreamCropping(const WebRtc_UWord32 streamId,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderMacCarbonImpl::ConfigureRenderer(const WebRtc_UWord32 streamId,
|
int32_t VideoRenderMacCarbonImpl::ConfigureRenderer(const uint32_t streamId,
|
||||||
const unsigned int zOrder,
|
const unsigned int zOrder,
|
||||||
const float left,
|
const float left,
|
||||||
const float top,
|
const float top,
|
||||||
const float right,
|
const float right,
|
||||||
const float bottom)
|
const float bottom)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32
|
int32_t
|
||||||
VideoRenderMacCarbonImpl::SetTransparentBackground(const bool enable)
|
VideoRenderMacCarbonImpl::SetTransparentBackground(const bool enable)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderMacCarbonImpl::SetText(const WebRtc_UWord8 textId,
|
int32_t VideoRenderMacCarbonImpl::SetText(const uint8_t textId,
|
||||||
const WebRtc_UWord8* text,
|
const uint8_t* text,
|
||||||
const WebRtc_Word32 textLength,
|
const int32_t textLength,
|
||||||
const WebRtc_UWord32 textColorRef,
|
const uint32_t textColorRef,
|
||||||
const WebRtc_UWord32 backgroundColorRef,
|
const uint32_t backgroundColorRef,
|
||||||
const float left,
|
const float left,
|
||||||
const float top,
|
const float top,
|
||||||
const float right,
|
const float right,
|
||||||
const float bottom)
|
const float bottom)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderMacCarbonImpl::SetBitmap(const void* bitMap,
|
int32_t VideoRenderMacCarbonImpl::SetBitmap(const void* bitMap,
|
||||||
const WebRtc_UWord8 pictureId,
|
const uint8_t pictureId,
|
||||||
const void* colorKey,
|
const void* colorKey,
|
||||||
const float left,
|
const float left,
|
||||||
const float top,
|
const float top,
|
||||||
const float right,
|
const float right,
|
||||||
const float bottom)
|
const float bottom)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -29,39 +29,39 @@ public:
|
|||||||
* Constructor/destructor
|
* Constructor/destructor
|
||||||
*/
|
*/
|
||||||
|
|
||||||
VideoRenderMacCarbonImpl(const WebRtc_Word32 id,
|
VideoRenderMacCarbonImpl(const int32_t id,
|
||||||
const VideoRenderType videoRenderType,
|
const VideoRenderType videoRenderType,
|
||||||
void* window,
|
void* window,
|
||||||
const bool fullscreen);
|
const bool fullscreen);
|
||||||
|
|
||||||
virtual ~VideoRenderMacCarbonImpl();
|
virtual ~VideoRenderMacCarbonImpl();
|
||||||
|
|
||||||
virtual WebRtc_Word32 Init();
|
virtual int32_t Init();
|
||||||
|
|
||||||
virtual WebRtc_Word32 ChangeUniqueId(const WebRtc_Word32 id);
|
virtual int32_t ChangeUniqueId(const int32_t id);
|
||||||
|
|
||||||
virtual WebRtc_Word32 ChangeWindow(void* window);
|
virtual int32_t ChangeWindow(void* window);
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
* Incoming Streams
|
* Incoming Streams
|
||||||
*
|
*
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
virtual VideoRenderCallback* AddIncomingRenderStream(const WebRtc_UWord32 streamId,
|
virtual VideoRenderCallback* AddIncomingRenderStream(const uint32_t streamId,
|
||||||
const WebRtc_UWord32 zOrder,
|
const uint32_t zOrder,
|
||||||
const float left,
|
const float left,
|
||||||
const float top,
|
const float top,
|
||||||
const float right,
|
const float right,
|
||||||
const float bottom);
|
const float bottom);
|
||||||
|
|
||||||
virtual WebRtc_Word32 DeleteIncomingRenderStream(const WebRtc_UWord32 streamId);
|
virtual int32_t DeleteIncomingRenderStream(const uint32_t streamId);
|
||||||
|
|
||||||
virtual WebRtc_Word32 GetIncomingRenderStreamProperties(const WebRtc_UWord32 streamId,
|
virtual int32_t GetIncomingRenderStreamProperties(const uint32_t streamId,
|
||||||
WebRtc_UWord32& zOrder,
|
uint32_t& zOrder,
|
||||||
float& left,
|
float& left,
|
||||||
float& top,
|
float& top,
|
||||||
float& right,
|
float& right,
|
||||||
float& bottom) const;
|
float& bottom) const;
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
@ -69,9 +69,9 @@ public:
|
|||||||
*
|
*
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
virtual WebRtc_Word32 StartRender();
|
virtual int32_t StartRender();
|
||||||
|
|
||||||
virtual WebRtc_Word32 StopRender();
|
virtual int32_t StopRender();
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
@ -85,55 +85,55 @@ public:
|
|||||||
|
|
||||||
virtual bool FullScreen();
|
virtual bool FullScreen();
|
||||||
|
|
||||||
virtual WebRtc_Word32 GetGraphicsMemory(WebRtc_UWord64& totalGraphicsMemory,
|
virtual int32_t GetGraphicsMemory(uint64_t& totalGraphicsMemory,
|
||||||
WebRtc_UWord64& availableGraphicsMemory) const;
|
uint64_t& availableGraphicsMemory) const;
|
||||||
|
|
||||||
virtual WebRtc_Word32 GetScreenResolution(WebRtc_UWord32& screenWidth,
|
virtual int32_t GetScreenResolution(uint32_t& screenWidth,
|
||||||
WebRtc_UWord32& screenHeight) const;
|
uint32_t& screenHeight) const;
|
||||||
|
|
||||||
virtual WebRtc_UWord32 RenderFrameRate(const WebRtc_UWord32 streamId);
|
virtual uint32_t RenderFrameRate(const uint32_t streamId);
|
||||||
|
|
||||||
virtual WebRtc_Word32 SetStreamCropping(const WebRtc_UWord32 streamId,
|
virtual int32_t SetStreamCropping(const uint32_t streamId,
|
||||||
const float left,
|
const float left,
|
||||||
const float top,
|
const float top,
|
||||||
const float right,
|
const float right,
|
||||||
const float bottom);
|
const float bottom);
|
||||||
|
|
||||||
virtual WebRtc_Word32 ConfigureRenderer(const WebRtc_UWord32 streamId,
|
virtual int32_t ConfigureRenderer(const uint32_t streamId,
|
||||||
const unsigned int zOrder,
|
const unsigned int zOrder,
|
||||||
const float left,
|
const float left,
|
||||||
const float top,
|
const float top,
|
||||||
const float right,
|
const float right,
|
||||||
const float bottom);
|
const float bottom);
|
||||||
|
|
||||||
virtual WebRtc_Word32 SetTransparentBackground(const bool enable);
|
virtual int32_t SetTransparentBackground(const bool enable);
|
||||||
|
|
||||||
virtual WebRtc_Word32 SetText(const WebRtc_UWord8 textId,
|
virtual int32_t SetText(const uint8_t textId,
|
||||||
const WebRtc_UWord8* text,
|
const uint8_t* text,
|
||||||
const WebRtc_Word32 textLength,
|
const int32_t textLength,
|
||||||
const WebRtc_UWord32 textColorRef,
|
const uint32_t textColorRef,
|
||||||
const WebRtc_UWord32 backgroundColorRef,
|
const uint32_t backgroundColorRef,
|
||||||
const float left,
|
const float left,
|
||||||
const float top,
|
const float top,
|
||||||
const float right,
|
const float right,
|
||||||
const float bottom);
|
const float bottom);
|
||||||
|
|
||||||
virtual WebRtc_Word32 SetBitmap(const void* bitMap,
|
virtual int32_t SetBitmap(const void* bitMap,
|
||||||
const WebRtc_UWord8 pictureId,
|
const uint8_t pictureId,
|
||||||
const void* colorKey,
|
const void* colorKey,
|
||||||
const float left,
|
const float left,
|
||||||
const float top,
|
const float top,
|
||||||
const float right,
|
const float right,
|
||||||
const float bottom);
|
const float bottom);
|
||||||
|
|
||||||
virtual WebRtc_Word32 FullScreenRender(void* window, const bool enable)
|
virtual int32_t FullScreenRender(void* window, const bool enable)
|
||||||
{
|
{
|
||||||
// not supported in Carbon at this time
|
// not supported in Carbon at this time
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
WebRtc_Word32 _id;
|
int32_t _id;
|
||||||
CriticalSectionWrapper& _renderMacCarbonCritsect;
|
CriticalSectionWrapper& _renderMacCarbonCritsect;
|
||||||
bool _fullScreen;
|
bool _fullScreen;
|
||||||
void* _ptrWindow;
|
void* _ptrWindow;
|
||||||
|
@ -29,39 +29,39 @@ public:
|
|||||||
* Constructor/destructor
|
* Constructor/destructor
|
||||||
*/
|
*/
|
||||||
|
|
||||||
VideoRenderMacCocoaImpl(const WebRtc_Word32 id,
|
VideoRenderMacCocoaImpl(const int32_t id,
|
||||||
const VideoRenderType videoRenderType,
|
const VideoRenderType videoRenderType,
|
||||||
void* window,
|
void* window,
|
||||||
const bool fullscreen);
|
const bool fullscreen);
|
||||||
|
|
||||||
virtual ~VideoRenderMacCocoaImpl();
|
virtual ~VideoRenderMacCocoaImpl();
|
||||||
|
|
||||||
virtual WebRtc_Word32 Init();
|
virtual int32_t Init();
|
||||||
|
|
||||||
virtual WebRtc_Word32 ChangeUniqueId(const WebRtc_Word32 id);
|
virtual int32_t ChangeUniqueId(const int32_t id);
|
||||||
|
|
||||||
virtual WebRtc_Word32 ChangeWindow(void* window);
|
virtual int32_t ChangeWindow(void* window);
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
* Incoming Streams
|
* Incoming Streams
|
||||||
*
|
*
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
virtual VideoRenderCallback* AddIncomingRenderStream(const WebRtc_UWord32 streamId,
|
virtual VideoRenderCallback* AddIncomingRenderStream(const uint32_t streamId,
|
||||||
const WebRtc_UWord32 zOrder,
|
const uint32_t zOrder,
|
||||||
const float left,
|
const float left,
|
||||||
const float top,
|
const float top,
|
||||||
const float right,
|
const float right,
|
||||||
const float bottom);
|
const float bottom);
|
||||||
|
|
||||||
virtual WebRtc_Word32 DeleteIncomingRenderStream(const WebRtc_UWord32 streamId);
|
virtual int32_t DeleteIncomingRenderStream(const uint32_t streamId);
|
||||||
|
|
||||||
virtual WebRtc_Word32 GetIncomingRenderStreamProperties(const WebRtc_UWord32 streamId,
|
virtual int32_t GetIncomingRenderStreamProperties(const uint32_t streamId,
|
||||||
WebRtc_UWord32& zOrder,
|
uint32_t& zOrder,
|
||||||
float& left,
|
float& left,
|
||||||
float& top,
|
float& top,
|
||||||
float& right,
|
float& right,
|
||||||
float& bottom) const;
|
float& bottom) const;
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
@ -69,9 +69,9 @@ public:
|
|||||||
*
|
*
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
virtual WebRtc_Word32 StartRender();
|
virtual int32_t StartRender();
|
||||||
|
|
||||||
virtual WebRtc_Word32 StopRender();
|
virtual int32_t StopRender();
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
@ -85,51 +85,51 @@ public:
|
|||||||
|
|
||||||
virtual bool FullScreen();
|
virtual bool FullScreen();
|
||||||
|
|
||||||
virtual WebRtc_Word32 GetGraphicsMemory(WebRtc_UWord64& totalGraphicsMemory,
|
virtual int32_t GetGraphicsMemory(uint64_t& totalGraphicsMemory,
|
||||||
WebRtc_UWord64& availableGraphicsMemory) const;
|
uint64_t& availableGraphicsMemory) const;
|
||||||
|
|
||||||
virtual WebRtc_Word32 GetScreenResolution(WebRtc_UWord32& screenWidth,
|
virtual int32_t GetScreenResolution(uint32_t& screenWidth,
|
||||||
WebRtc_UWord32& screenHeight) const;
|
uint32_t& screenHeight) const;
|
||||||
|
|
||||||
virtual WebRtc_UWord32 RenderFrameRate(const WebRtc_UWord32 streamId);
|
virtual uint32_t RenderFrameRate(const uint32_t streamId);
|
||||||
|
|
||||||
virtual WebRtc_Word32 SetStreamCropping(const WebRtc_UWord32 streamId,
|
virtual int32_t SetStreamCropping(const uint32_t streamId,
|
||||||
const float left,
|
const float left,
|
||||||
const float top,
|
const float top,
|
||||||
const float right,
|
const float right,
|
||||||
const float bottom);
|
const float bottom);
|
||||||
|
|
||||||
virtual WebRtc_Word32 ConfigureRenderer(const WebRtc_UWord32 streamId,
|
virtual int32_t ConfigureRenderer(const uint32_t streamId,
|
||||||
const unsigned int zOrder,
|
const unsigned int zOrder,
|
||||||
const float left,
|
const float left,
|
||||||
const float top,
|
const float top,
|
||||||
const float right,
|
const float right,
|
||||||
const float bottom);
|
const float bottom);
|
||||||
|
|
||||||
virtual WebRtc_Word32 SetTransparentBackground(const bool enable);
|
virtual int32_t SetTransparentBackground(const bool enable);
|
||||||
|
|
||||||
virtual WebRtc_Word32 SetText(const WebRtc_UWord8 textId,
|
virtual int32_t SetText(const uint8_t textId,
|
||||||
const WebRtc_UWord8* text,
|
const uint8_t* text,
|
||||||
const WebRtc_Word32 textLength,
|
const int32_t textLength,
|
||||||
const WebRtc_UWord32 textColorRef,
|
const uint32_t textColorRef,
|
||||||
const WebRtc_UWord32 backgroundColorRef,
|
const uint32_t backgroundColorRef,
|
||||||
const float left,
|
const float left,
|
||||||
const float top,
|
const float top,
|
||||||
const float right,
|
const float right,
|
||||||
const float bottom);
|
const float bottom);
|
||||||
|
|
||||||
virtual WebRtc_Word32 SetBitmap(const void* bitMap,
|
virtual int32_t SetBitmap(const void* bitMap,
|
||||||
const WebRtc_UWord8 pictureId,
|
const uint8_t pictureId,
|
||||||
const void* colorKey,
|
const void* colorKey,
|
||||||
const float left,
|
const float left,
|
||||||
const float top,
|
const float top,
|
||||||
const float right,
|
const float right,
|
||||||
const float bottom);
|
const float bottom);
|
||||||
|
|
||||||
virtual WebRtc_Word32 FullScreenRender(void* window, const bool enable);
|
virtual int32_t FullScreenRender(void* window, const bool enable);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
WebRtc_Word32 _id;
|
int32_t _id;
|
||||||
CriticalSectionWrapper& _renderMacCocoaCritsect;
|
CriticalSectionWrapper& _renderMacCocoaCritsect;
|
||||||
bool _fullScreen;
|
bool _fullScreen;
|
||||||
void* _ptrWindow;
|
void* _ptrWindow;
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
|
|
||||||
VideoRenderMacCocoaImpl::VideoRenderMacCocoaImpl(const WebRtc_Word32 id,
|
VideoRenderMacCocoaImpl::VideoRenderMacCocoaImpl(const int32_t id,
|
||||||
const VideoRenderType videoRenderType,
|
const VideoRenderType videoRenderType,
|
||||||
void* window,
|
void* window,
|
||||||
const bool fullscreen) :
|
const bool fullscreen) :
|
||||||
@ -44,7 +44,7 @@ VideoRenderMacCocoaImpl::~VideoRenderMacCocoaImpl()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32
|
int32_t
|
||||||
VideoRenderMacCocoaImpl::Init()
|
VideoRenderMacCocoaImpl::Init()
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -68,8 +68,8 @@ VideoRenderMacCocoaImpl::Init()
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32
|
int32_t
|
||||||
VideoRenderMacCocoaImpl::ChangeUniqueId(const WebRtc_Word32 id)
|
VideoRenderMacCocoaImpl::ChangeUniqueId(const int32_t id)
|
||||||
{
|
{
|
||||||
CriticalSectionScoped cs(&_renderMacCocoaCritsect);
|
CriticalSectionScoped cs(&_renderMacCocoaCritsect);
|
||||||
WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, _id, "%s", __FUNCTION__);
|
WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, _id, "%s", __FUNCTION__);
|
||||||
@ -83,7 +83,7 @@ VideoRenderMacCocoaImpl::ChangeUniqueId(const WebRtc_Word32 id)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32
|
int32_t
|
||||||
VideoRenderMacCocoaImpl::ChangeWindow(void* window)
|
VideoRenderMacCocoaImpl::ChangeWindow(void* window)
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -104,8 +104,8 @@ VideoRenderMacCocoaImpl::ChangeWindow(void* window)
|
|||||||
}
|
}
|
||||||
|
|
||||||
VideoRenderCallback*
|
VideoRenderCallback*
|
||||||
VideoRenderMacCocoaImpl::AddIncomingRenderStream(const WebRtc_UWord32 streamId,
|
VideoRenderMacCocoaImpl::AddIncomingRenderStream(const uint32_t streamId,
|
||||||
const WebRtc_UWord32 zOrder,
|
const uint32_t zOrder,
|
||||||
const float left,
|
const float left,
|
||||||
const float top,
|
const float top,
|
||||||
const float right,
|
const float right,
|
||||||
@ -128,8 +128,8 @@ VideoRenderMacCocoaImpl::AddIncomingRenderStream(const WebRtc_UWord32 streamId,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32
|
int32_t
|
||||||
VideoRenderMacCocoaImpl::DeleteIncomingRenderStream(const WebRtc_UWord32 streamId)
|
VideoRenderMacCocoaImpl::DeleteIncomingRenderStream(const uint32_t streamId)
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceDebug, kTraceVideoRenderer, _id, "Constructor %s:%d", __FUNCTION__, __LINE__);
|
WEBRTC_TRACE(kTraceDebug, kTraceVideoRenderer, _id, "Constructor %s:%d", __FUNCTION__, __LINE__);
|
||||||
CriticalSectionScoped cs(&_renderMacCocoaCritsect);
|
CriticalSectionScoped cs(&_renderMacCocoaCritsect);
|
||||||
@ -138,9 +138,9 @@ VideoRenderMacCocoaImpl::DeleteIncomingRenderStream(const WebRtc_UWord32 streamI
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32
|
int32_t
|
||||||
VideoRenderMacCocoaImpl::GetIncomingRenderStreamProperties(const WebRtc_UWord32 streamId,
|
VideoRenderMacCocoaImpl::GetIncomingRenderStreamProperties(const uint32_t streamId,
|
||||||
WebRtc_UWord32& zOrder,
|
uint32_t& zOrder,
|
||||||
float& left,
|
float& left,
|
||||||
float& top,
|
float& top,
|
||||||
float& right,
|
float& right,
|
||||||
@ -149,13 +149,13 @@ VideoRenderMacCocoaImpl::GetIncomingRenderStreamProperties(const WebRtc_UWord32
|
|||||||
return _ptrCocoaRender->GetChannelProperties(streamId, zOrder, left, top, right, bottom);
|
return _ptrCocoaRender->GetChannelProperties(streamId, zOrder, left, top, right, bottom);
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32
|
int32_t
|
||||||
VideoRenderMacCocoaImpl::StartRender()
|
VideoRenderMacCocoaImpl::StartRender()
|
||||||
{
|
{
|
||||||
return _ptrCocoaRender->StartRender();
|
return _ptrCocoaRender->StartRender();
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32
|
int32_t
|
||||||
VideoRenderMacCocoaImpl::StopRender()
|
VideoRenderMacCocoaImpl::StopRender()
|
||||||
{
|
{
|
||||||
return _ptrCocoaRender->StopRender();
|
return _ptrCocoaRender->StopRender();
|
||||||
@ -179,18 +179,18 @@ VideoRenderMacCocoaImpl::FullScreen()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32
|
int32_t
|
||||||
VideoRenderMacCocoaImpl::GetGraphicsMemory(WebRtc_UWord64& totalGraphicsMemory,
|
VideoRenderMacCocoaImpl::GetGraphicsMemory(uint64_t& totalGraphicsMemory,
|
||||||
WebRtc_UWord64& availableGraphicsMemory) const
|
uint64_t& availableGraphicsMemory) const
|
||||||
{
|
{
|
||||||
totalGraphicsMemory = 0;
|
totalGraphicsMemory = 0;
|
||||||
availableGraphicsMemory = 0;
|
availableGraphicsMemory = 0;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32
|
int32_t
|
||||||
VideoRenderMacCocoaImpl::GetScreenResolution(WebRtc_UWord32& screenWidth,
|
VideoRenderMacCocoaImpl::GetScreenResolution(uint32_t& screenWidth,
|
||||||
WebRtc_UWord32& screenHeight) const
|
uint32_t& screenHeight) const
|
||||||
{
|
{
|
||||||
CriticalSectionScoped cs(&_renderMacCocoaCritsect);
|
CriticalSectionScoped cs(&_renderMacCocoaCritsect);
|
||||||
NSScreen* mainScreen = [NSScreen mainScreen];
|
NSScreen* mainScreen = [NSScreen mainScreen];
|
||||||
@ -202,15 +202,15 @@ VideoRenderMacCocoaImpl::GetScreenResolution(WebRtc_UWord32& screenWidth,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_UWord32
|
uint32_t
|
||||||
VideoRenderMacCocoaImpl::RenderFrameRate(const WebRtc_UWord32 streamId)
|
VideoRenderMacCocoaImpl::RenderFrameRate(const uint32_t streamId)
|
||||||
{
|
{
|
||||||
CriticalSectionScoped cs(&_renderMacCocoaCritsect);
|
CriticalSectionScoped cs(&_renderMacCocoaCritsect);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32
|
int32_t
|
||||||
VideoRenderMacCocoaImpl::SetStreamCropping(const WebRtc_UWord32 streamId,
|
VideoRenderMacCocoaImpl::SetStreamCropping(const uint32_t streamId,
|
||||||
const float left,
|
const float left,
|
||||||
const float top,
|
const float top,
|
||||||
const float right,
|
const float right,
|
||||||
@ -219,47 +219,47 @@ VideoRenderMacCocoaImpl::SetStreamCropping(const WebRtc_UWord32 streamId,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderMacCocoaImpl::ConfigureRenderer(const WebRtc_UWord32 streamId,
|
int32_t VideoRenderMacCocoaImpl::ConfigureRenderer(const uint32_t streamId,
|
||||||
const unsigned int zOrder,
|
const unsigned int zOrder,
|
||||||
const float left,
|
const float left,
|
||||||
const float top,
|
const float top,
|
||||||
const float right,
|
const float right,
|
||||||
const float bottom)
|
const float bottom)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32
|
int32_t
|
||||||
VideoRenderMacCocoaImpl::SetTransparentBackground(const bool enable)
|
VideoRenderMacCocoaImpl::SetTransparentBackground(const bool enable)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderMacCocoaImpl::SetText(const WebRtc_UWord8 textId,
|
int32_t VideoRenderMacCocoaImpl::SetText(const uint8_t textId,
|
||||||
const WebRtc_UWord8* text,
|
const uint8_t* text,
|
||||||
const WebRtc_Word32 textLength,
|
const int32_t textLength,
|
||||||
const WebRtc_UWord32 textColorRef,
|
const uint32_t textColorRef,
|
||||||
const WebRtc_UWord32 backgroundColorRef,
|
const uint32_t backgroundColorRef,
|
||||||
const float left,
|
const float left,
|
||||||
const float top,
|
const float top,
|
||||||
const float right,
|
const float right,
|
||||||
const float bottom)
|
const float bottom)
|
||||||
{
|
{
|
||||||
return _ptrCocoaRender->SetText(textId, text, textLength, textColorRef, backgroundColorRef, left, top, right, bottom);
|
return _ptrCocoaRender->SetText(textId, text, textLength, textColorRef, backgroundColorRef, left, top, right, bottom);
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderMacCocoaImpl::SetBitmap(const void* bitMap,
|
int32_t VideoRenderMacCocoaImpl::SetBitmap(const void* bitMap,
|
||||||
const WebRtc_UWord8 pictureId,
|
const uint8_t pictureId,
|
||||||
const void* colorKey,
|
const void* colorKey,
|
||||||
const float left,
|
const float left,
|
||||||
const float top,
|
const float top,
|
||||||
const float right,
|
const float right,
|
||||||
const float bottom)
|
const float bottom)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderMacCocoaImpl::FullScreenRender(void* window, const bool enable)
|
int32_t VideoRenderMacCocoaImpl::FullScreenRender(void* window, const bool enable)
|
||||||
{
|
{
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -63,23 +63,23 @@ public:
|
|||||||
virtual int UpdateStretchSize(int stretchHeight, int stretchWidth);
|
virtual int UpdateStretchSize(int stretchHeight, int stretchWidth);
|
||||||
|
|
||||||
// ********** new module functions ************ //
|
// ********** new module functions ************ //
|
||||||
virtual WebRtc_Word32 RenderFrame(const WebRtc_UWord32 streamId,
|
virtual int32_t RenderFrame(const uint32_t streamId,
|
||||||
I420VideoFrame& videoFrame);
|
I420VideoFrame& videoFrame);
|
||||||
|
|
||||||
// ********** new module helper functions ***** //
|
// ********** new module helper functions ***** //
|
||||||
int ChangeContext(NSOpenGLContext *nsglContext);
|
int ChangeContext(NSOpenGLContext *nsglContext);
|
||||||
WebRtc_Word32 GetChannelProperties(float& left,
|
int32_t GetChannelProperties(float& left,
|
||||||
float& top,
|
float& top,
|
||||||
float& right,
|
float& right,
|
||||||
float& bottom);
|
float& bottom);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
NSOpenGLContext* _nsglContext;
|
NSOpenGLContext* _nsglContext;
|
||||||
int _id;
|
int _id;
|
||||||
VideoRenderNSOpenGL* _owner;
|
VideoRenderNSOpenGL* _owner;
|
||||||
WebRtc_Word32 _width;
|
int32_t _width;
|
||||||
WebRtc_Word32 _height;
|
int32_t _height;
|
||||||
float _startWidth;
|
float _startWidth;
|
||||||
float _startHeight;
|
float _startHeight;
|
||||||
float _stopWidth;
|
float _stopWidth;
|
||||||
@ -123,26 +123,26 @@ public: // methods
|
|||||||
|
|
||||||
// ********** new module functions ************ //
|
// ********** new module functions ************ //
|
||||||
int ChangeWindow(CocoaRenderView* newWindowRef);
|
int ChangeWindow(CocoaRenderView* newWindowRef);
|
||||||
WebRtc_Word32 ChangeUniqueID(WebRtc_Word32 id);
|
int32_t ChangeUniqueID(int32_t id);
|
||||||
WebRtc_Word32 StartRender();
|
int32_t StartRender();
|
||||||
WebRtc_Word32 StopRender();
|
int32_t StopRender();
|
||||||
WebRtc_Word32 DeleteNSGLChannel(const WebRtc_UWord32 streamID);
|
int32_t DeleteNSGLChannel(const uint32_t streamID);
|
||||||
WebRtc_Word32 GetChannelProperties(const WebRtc_UWord16 streamId,
|
int32_t GetChannelProperties(const uint16_t streamId,
|
||||||
WebRtc_UWord32& zOrder,
|
uint32_t& zOrder,
|
||||||
float& left,
|
float& left,
|
||||||
float& top,
|
float& top,
|
||||||
float& right,
|
float& right,
|
||||||
float& bottom);
|
float& bottom);
|
||||||
|
|
||||||
WebRtc_Word32 SetText(const WebRtc_UWord8 textId,
|
int32_t SetText(const uint8_t textId,
|
||||||
const WebRtc_UWord8* text,
|
const uint8_t* text,
|
||||||
const WebRtc_Word32 textLength,
|
const int32_t textLength,
|
||||||
const WebRtc_UWord32 textColorRef,
|
const uint32_t textColorRef,
|
||||||
const WebRtc_UWord32 backgroundColorRef,
|
const uint32_t backgroundColorRef,
|
||||||
const float left,
|
const float left,
|
||||||
const float top,
|
const float top,
|
||||||
const float right,
|
const float right,
|
||||||
const float bottom);
|
const float bottom);
|
||||||
|
|
||||||
// ********** new module helper functions ***** //
|
// ********** new module helper functions ***** //
|
||||||
int configureNSOpenGLEngine();
|
int configureNSOpenGLEngine();
|
||||||
|
@ -74,10 +74,8 @@ int VideoChannelNSOpenGL::ChangeContext(NSOpenGLContext *nsglContext)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoChannelNSOpenGL::GetChannelProperties(float& left,
|
int32_t VideoChannelNSOpenGL::GetChannelProperties(float& left, float& top,
|
||||||
float& top,
|
float& right, float& bottom)
|
||||||
float& right,
|
|
||||||
float& bottom)
|
|
||||||
{
|
{
|
||||||
|
|
||||||
_owner->LockAGLCntx();
|
_owner->LockAGLCntx();
|
||||||
@ -91,8 +89,8 @@ WebRtc_Word32 VideoChannelNSOpenGL::GetChannelProperties(float& left,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoChannelNSOpenGL::RenderFrame(
|
int32_t VideoChannelNSOpenGL::RenderFrame(
|
||||||
const WebRtc_UWord32 /*streamId*/, I420VideoFrame& videoFrame) {
|
const uint32_t /*streamId*/, I420VideoFrame& videoFrame) {
|
||||||
|
|
||||||
_owner->LockAGLCntx();
|
_owner->LockAGLCntx();
|
||||||
|
|
||||||
@ -422,7 +420,7 @@ int VideoRenderNSOpenGL::ChangeWindow(CocoaRenderView* newWindowRef)
|
|||||||
* If so then they will simply be restarted
|
* If so then they will simply be restarted
|
||||||
* If not then create them and continue
|
* If not then create them and continue
|
||||||
*/
|
*/
|
||||||
WebRtc_Word32 VideoRenderNSOpenGL::StartRender()
|
int32_t VideoRenderNSOpenGL::StartRender()
|
||||||
{
|
{
|
||||||
|
|
||||||
LockAGLCntx();
|
LockAGLCntx();
|
||||||
@ -457,7 +455,7 @@ WebRtc_Word32 VideoRenderNSOpenGL::StartRender()
|
|||||||
UnlockAGLCntx();
|
UnlockAGLCntx();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
WebRtc_Word32 VideoRenderNSOpenGL::StopRender()
|
int32_t VideoRenderNSOpenGL::StopRender()
|
||||||
{
|
{
|
||||||
|
|
||||||
LockAGLCntx();
|
LockAGLCntx();
|
||||||
@ -792,7 +790,7 @@ int VideoRenderNSOpenGL::DeleteAllNSGLChannels()
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderNSOpenGL::DeleteNSGLChannel(const WebRtc_UWord32 channel)
|
int32_t VideoRenderNSOpenGL::DeleteNSGLChannel(const uint32_t channel)
|
||||||
{
|
{
|
||||||
|
|
||||||
CriticalSectionScoped cs(&_nsglContextCritSec);
|
CriticalSectionScoped cs(&_nsglContextCritSec);
|
||||||
@ -823,12 +821,12 @@ WebRtc_Word32 VideoRenderNSOpenGL::DeleteNSGLChannel(const WebRtc_UWord32 channe
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderNSOpenGL::GetChannelProperties(const WebRtc_UWord16 streamId,
|
int32_t VideoRenderNSOpenGL::GetChannelProperties(const uint16_t streamId,
|
||||||
WebRtc_UWord32& zOrder,
|
uint32_t& zOrder,
|
||||||
float& left,
|
float& left,
|
||||||
float& top,
|
float& top,
|
||||||
float& right,
|
float& right,
|
||||||
float& bottom)
|
float& bottom)
|
||||||
{
|
{
|
||||||
|
|
||||||
CriticalSectionScoped cs(&_nsglContextCritSec);
|
CriticalSectionScoped cs(&_nsglContextCritSec);
|
||||||
@ -1180,7 +1178,7 @@ int VideoRenderNSOpenGL::GetWindowRect(Rect& rect)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderNSOpenGL::ChangeUniqueID(WebRtc_Word32 id)
|
int32_t VideoRenderNSOpenGL::ChangeUniqueID(int32_t id)
|
||||||
{
|
{
|
||||||
|
|
||||||
CriticalSectionScoped cs(&_nsglContextCritSec);
|
CriticalSectionScoped cs(&_nsglContextCritSec);
|
||||||
@ -1188,15 +1186,15 @@ WebRtc_Word32 VideoRenderNSOpenGL::ChangeUniqueID(WebRtc_Word32 id)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderNSOpenGL::SetText(const WebRtc_UWord8 /*textId*/,
|
int32_t VideoRenderNSOpenGL::SetText(const uint8_t /*textId*/,
|
||||||
const WebRtc_UWord8* /*text*/,
|
const uint8_t* /*text*/,
|
||||||
const WebRtc_Word32 /*textLength*/,
|
const int32_t /*textLength*/,
|
||||||
const WebRtc_UWord32 /*textColorRef*/,
|
const uint32_t /*textColorRef*/,
|
||||||
const WebRtc_UWord32 /*backgroundColorRef*/,
|
const uint32_t /*backgroundColorRef*/,
|
||||||
const float /*left*/,
|
const float /*left*/,
|
||||||
const float /*top*/,
|
const float /*top*/,
|
||||||
const float /*right*/,
|
const float /*right*/,
|
||||||
const float /*bottom*/)
|
const float /*bottom*/)
|
||||||
{
|
{
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -43,7 +43,7 @@
|
|||||||
using namespace webrtc;
|
using namespace webrtc;
|
||||||
|
|
||||||
void GetTestVideoFrame(I420VideoFrame* frame,
|
void GetTestVideoFrame(I420VideoFrame* frame,
|
||||||
WebRtc_UWord8 startColor);
|
uint8_t startColor);
|
||||||
int TestSingleStream(VideoRender* renderModule);
|
int TestSingleStream(VideoRender* renderModule);
|
||||||
int TestFullscreenStream(VideoRender* &renderModule,
|
int TestFullscreenStream(VideoRender* &renderModule,
|
||||||
void* window,
|
void* window,
|
||||||
@ -261,8 +261,8 @@ public:
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
virtual WebRtc_Word32 RenderFrame(const WebRtc_UWord32 streamId,
|
virtual int32_t RenderFrame(const uint32_t streamId,
|
||||||
I420VideoFrame& videoFrame)
|
I420VideoFrame& videoFrame)
|
||||||
{
|
{
|
||||||
_cnt++;
|
_cnt++;
|
||||||
if (_cnt % 100 == 0)
|
if (_cnt % 100 == 0)
|
||||||
@ -271,13 +271,13 @@ public:
|
|||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
WebRtc_Word32 _cnt;
|
int32_t _cnt;
|
||||||
};
|
};
|
||||||
|
|
||||||
void GetTestVideoFrame(I420VideoFrame* frame,
|
void GetTestVideoFrame(I420VideoFrame* frame,
|
||||||
WebRtc_UWord8 startColor) {
|
uint8_t startColor) {
|
||||||
// changing color
|
// changing color
|
||||||
static WebRtc_UWord8 color = startColor;
|
static uint8_t color = startColor;
|
||||||
|
|
||||||
memset(frame->buffer(kYPlane), color, frame->allocated_size(kYPlane));
|
memset(frame->buffer(kYPlane), color, frame->allocated_size(kYPlane));
|
||||||
memset(frame->buffer(kUPlane), color, frame->allocated_size(kUPlane));
|
memset(frame->buffer(kUPlane), color, frame->allocated_size(kUPlane));
|
||||||
@ -316,7 +316,7 @@ int TestSingleStream(VideoRender* renderModule) {
|
|||||||
I420VideoFrame videoFrame0;
|
I420VideoFrame videoFrame0;
|
||||||
videoFrame0.CreateEmptyFrame(width, height, width, half_width, half_width);
|
videoFrame0.CreateEmptyFrame(width, height, width, half_width, half_width);
|
||||||
|
|
||||||
const WebRtc_UWord32 renderDelayMs = 500;
|
const uint32_t renderDelayMs = 500;
|
||||||
|
|
||||||
for (int i=0; i<TEST_FRAME_NUM; i++) {
|
for (int i=0; i<TEST_FRAME_NUM; i++) {
|
||||||
GetTestVideoFrame(&videoFrame0, TEST_STREAM0_START_COLOR);
|
GetTestVideoFrame(&videoFrame0, TEST_STREAM0_START_COLOR);
|
||||||
@ -374,7 +374,7 @@ int TestBitmapText(VideoRender* renderModule) {
|
|||||||
0.3f);
|
0.3f);
|
||||||
|
|
||||||
printf("Adding Text\n");
|
printf("Adding Text\n");
|
||||||
renderModule->SetText(1, (WebRtc_UWord8*) "WebRtc Render Demo App", 20,
|
renderModule->SetText(1, (uint8_t*) "WebRtc Render Demo App", 20,
|
||||||
RGB(255, 0, 0), RGB(0, 0, 0), 0.25f, 0.1f, 1.0f,
|
RGB(255, 0, 0), RGB(0, 0, 0), 0.25f, 0.1f, 1.0f,
|
||||||
1.0f);
|
1.0f);
|
||||||
|
|
||||||
@ -390,7 +390,7 @@ int TestBitmapText(VideoRender* renderModule) {
|
|||||||
I420VideoFrame videoFrame0;
|
I420VideoFrame videoFrame0;
|
||||||
videoFrame0.CreateEmptyFrame(width, height, width, half_width, half_width);
|
videoFrame0.CreateEmptyFrame(width, height, width, half_width, half_width);
|
||||||
|
|
||||||
const WebRtc_UWord32 renderDelayMs = 500;
|
const uint32_t renderDelayMs = 500;
|
||||||
|
|
||||||
for (int i=0; i<TEST_FRAME_NUM; i++) {
|
for (int i=0; i<TEST_FRAME_NUM; i++) {
|
||||||
GetTestVideoFrame(&videoFrame0, TEST_STREAM0_START_COLOR);
|
GetTestVideoFrame(&videoFrame0, TEST_STREAM0_START_COLOR);
|
||||||
@ -463,7 +463,7 @@ int TestMultipleStreams(VideoRender* renderModule) {
|
|||||||
I420VideoFrame videoFrame3;
|
I420VideoFrame videoFrame3;
|
||||||
videoFrame3.CreateEmptyFrame(width, height, width, half_width, half_width);
|
videoFrame3.CreateEmptyFrame(width, height, width, half_width, half_width);
|
||||||
|
|
||||||
const WebRtc_UWord32 renderDelayMs = 500;
|
const uint32_t renderDelayMs = 500;
|
||||||
|
|
||||||
// Render frames with the specified delay.
|
// Render frames with the specified delay.
|
||||||
for (int i=0; i<TEST_FRAME_NUM; i++) {
|
for (int i=0; i<TEST_FRAME_NUM; i++) {
|
||||||
@ -524,7 +524,7 @@ int TestExternalRender(VideoRender* renderModule) {
|
|||||||
I420VideoFrame videoFrame0;
|
I420VideoFrame videoFrame0;
|
||||||
videoFrame0.CreateEmptyFrame(width, height, width, half_width, half_width);
|
videoFrame0.CreateEmptyFrame(width, height, width, half_width, half_width);
|
||||||
|
|
||||||
const WebRtc_UWord32 renderDelayMs = 500;
|
const uint32_t renderDelayMs = 500;
|
||||||
int frameCount = TEST_FRAME_NUM;
|
int frameCount = TEST_FRAME_NUM;
|
||||||
for (int i=0; i<frameCount; i++) {
|
for (int i=0; i<frameCount; i++) {
|
||||||
videoFrame0.set_render_time_ms(TickTime::MillisecondTimestamp() +
|
videoFrame0.set_render_time_ms(TickTime::MillisecondTimestamp() +
|
||||||
|
@ -18,9 +18,9 @@
|
|||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
|
|
||||||
const WebRtc_Word32 KEventMaxWaitTimeMs = 200;
|
const int32_t KEventMaxWaitTimeMs = 200;
|
||||||
const WebRtc_UWord32 kMinRenderDelayMs = 10;
|
const uint32_t kMinRenderDelayMs = 10;
|
||||||
const WebRtc_UWord32 kMaxRenderDelayMs= 500;
|
const uint32_t kMaxRenderDelayMs= 500;
|
||||||
|
|
||||||
VideoRenderFrames::VideoRenderFrames()
|
VideoRenderFrames::VideoRenderFrames()
|
||||||
: incoming_frames_(),
|
: incoming_frames_(),
|
||||||
@ -31,8 +31,8 @@ VideoRenderFrames::~VideoRenderFrames() {
|
|||||||
ReleaseAllFrames();
|
ReleaseAllFrames();
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderFrames::AddFrame(I420VideoFrame* new_frame) {
|
int32_t VideoRenderFrames::AddFrame(I420VideoFrame* new_frame) {
|
||||||
const WebRtc_Word64 time_now = TickTime::MillisecondTimestamp();
|
const int64_t time_now = TickTime::MillisecondTimestamp();
|
||||||
|
|
||||||
if (new_frame->render_time_ms() + KOldRenderTimestampMS < time_now) {
|
if (new_frame->render_time_ms() + KOldRenderTimestampMS < time_now) {
|
||||||
WEBRTC_TRACE(kTraceWarning, kTraceVideoRenderer, -1,
|
WEBRTC_TRACE(kTraceWarning, kTraceVideoRenderer, -1,
|
||||||
@ -119,7 +119,7 @@ I420VideoFrame* VideoRenderFrames::FrameToRender() {
|
|||||||
return render_frame;
|
return render_frame;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderFrames::ReturnFrame(I420VideoFrame* old_frame) {
|
int32_t VideoRenderFrames::ReturnFrame(I420VideoFrame* old_frame) {
|
||||||
old_frame->ResetSize();
|
old_frame->ResetSize();
|
||||||
old_frame->set_timestamp(0);
|
old_frame->set_timestamp(0);
|
||||||
old_frame->set_render_time_ms(0);
|
old_frame->set_render_time_ms(0);
|
||||||
@ -127,7 +127,7 @@ WebRtc_Word32 VideoRenderFrames::ReturnFrame(I420VideoFrame* old_frame) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderFrames::ReleaseAllFrames() {
|
int32_t VideoRenderFrames::ReleaseAllFrames() {
|
||||||
while (!incoming_frames_.Empty()) {
|
while (!incoming_frames_.Empty()) {
|
||||||
ListItem* item = incoming_frames_.First();
|
ListItem* item = incoming_frames_.First();
|
||||||
if (item) {
|
if (item) {
|
||||||
@ -149,8 +149,8 @@ WebRtc_Word32 VideoRenderFrames::ReleaseAllFrames() {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_UWord32 VideoRenderFrames::TimeToNextFrameRelease() {
|
uint32_t VideoRenderFrames::TimeToNextFrameRelease() {
|
||||||
WebRtc_Word64 time_to_release = 0;
|
int64_t time_to_release = 0;
|
||||||
ListItem* item = incoming_frames_.First();
|
ListItem* item = incoming_frames_.First();
|
||||||
if (item) {
|
if (item) {
|
||||||
I420VideoFrame* oldest_frame =
|
I420VideoFrame* oldest_frame =
|
||||||
@ -163,11 +163,11 @@ WebRtc_UWord32 VideoRenderFrames::TimeToNextFrameRelease() {
|
|||||||
} else {
|
} else {
|
||||||
time_to_release = KEventMaxWaitTimeMs;
|
time_to_release = KEventMaxWaitTimeMs;
|
||||||
}
|
}
|
||||||
return static_cast<WebRtc_UWord32>(time_to_release);
|
return static_cast<uint32_t>(time_to_release);
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderFrames::SetRenderDelay(
|
int32_t VideoRenderFrames::SetRenderDelay(
|
||||||
const WebRtc_UWord32 render_delay) {
|
const uint32_t render_delay) {
|
||||||
if (render_delay < kMinRenderDelayMs ||
|
if (render_delay < kMinRenderDelayMs ||
|
||||||
render_delay > kMaxRenderDelayMs) {
|
render_delay > kMaxRenderDelayMs) {
|
||||||
WEBRTC_TRACE(kTraceWarning, kTraceVideoRenderer,
|
WEBRTC_TRACE(kTraceWarning, kTraceVideoRenderer,
|
||||||
|
@ -23,22 +23,22 @@ class VideoRenderFrames {
|
|||||||
~VideoRenderFrames();
|
~VideoRenderFrames();
|
||||||
|
|
||||||
// Add a frame to the render queue
|
// Add a frame to the render queue
|
||||||
WebRtc_Word32 AddFrame(I420VideoFrame* new_frame);
|
int32_t AddFrame(I420VideoFrame* new_frame);
|
||||||
|
|
||||||
// Get a frame for rendering, if it's time to render.
|
// Get a frame for rendering, if it's time to render.
|
||||||
I420VideoFrame* FrameToRender();
|
I420VideoFrame* FrameToRender();
|
||||||
|
|
||||||
// Return an old frame
|
// Return an old frame
|
||||||
WebRtc_Word32 ReturnFrame(I420VideoFrame* old_frame);
|
int32_t ReturnFrame(I420VideoFrame* old_frame);
|
||||||
|
|
||||||
// Releases all frames
|
// Releases all frames
|
||||||
WebRtc_Word32 ReleaseAllFrames();
|
int32_t ReleaseAllFrames();
|
||||||
|
|
||||||
// Returns the number of ms to next frame to render
|
// Returns the number of ms to next frame to render
|
||||||
WebRtc_UWord32 TimeToNextFrameRelease();
|
uint32_t TimeToNextFrameRelease();
|
||||||
|
|
||||||
// Sets estimates delay in renderer
|
// Sets estimates delay in renderer
|
||||||
WebRtc_Word32 SetRenderDelay(const WebRtc_UWord32 render_delay);
|
int32_t SetRenderDelay(const uint32_t render_delay);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// 10 seconds for 30 fps.
|
// 10 seconds for 30 fps.
|
||||||
@ -54,7 +54,7 @@ class VideoRenderFrames {
|
|||||||
ListWrapper empty_frames_;
|
ListWrapper empty_frames_;
|
||||||
|
|
||||||
// Estimated delay from a frame is released until it's rendered.
|
// Estimated delay from a frame is released until it's rendered.
|
||||||
WebRtc_UWord32 render_delay_ms_;
|
uint32_t render_delay_ms_;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace webrtc
|
} // namespace webrtc
|
||||||
|
@ -66,7 +66,7 @@
|
|||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
|
|
||||||
VideoRender*
|
VideoRender*
|
||||||
VideoRender::CreateVideoRender(const WebRtc_Word32 id,
|
VideoRender::CreateVideoRender(const int32_t id,
|
||||||
void* window,
|
void* window,
|
||||||
const bool fullscreen,
|
const bool fullscreen,
|
||||||
const VideoRenderType videoRenderType/*=kRenderDefault*/)
|
const VideoRenderType videoRenderType/*=kRenderDefault*/)
|
||||||
@ -90,7 +90,7 @@ void VideoRender::DestroyVideoRender(
|
|||||||
}
|
}
|
||||||
|
|
||||||
ModuleVideoRenderImpl::ModuleVideoRenderImpl(
|
ModuleVideoRenderImpl::ModuleVideoRenderImpl(
|
||||||
const WebRtc_Word32 id,
|
const int32_t id,
|
||||||
const VideoRenderType videoRenderType,
|
const VideoRenderType videoRenderType,
|
||||||
void* window,
|
void* window,
|
||||||
const bool fullscreen) :
|
const bool fullscreen) :
|
||||||
@ -310,7 +310,7 @@ ModuleVideoRenderImpl::~ModuleVideoRenderImpl()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 ModuleVideoRenderImpl::ChangeUniqueId(const WebRtc_Word32 id)
|
int32_t ModuleVideoRenderImpl::ChangeUniqueId(const int32_t id)
|
||||||
{
|
{
|
||||||
|
|
||||||
CriticalSectionScoped cs(&_moduleCrit);
|
CriticalSectionScoped cs(&_moduleCrit);
|
||||||
@ -325,12 +325,12 @@ WebRtc_Word32 ModuleVideoRenderImpl::ChangeUniqueId(const WebRtc_Word32 id)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 ModuleVideoRenderImpl::TimeUntilNextProcess()
|
int32_t ModuleVideoRenderImpl::TimeUntilNextProcess()
|
||||||
{
|
{
|
||||||
// Not used
|
// Not used
|
||||||
return 50;
|
return 50;
|
||||||
}
|
}
|
||||||
WebRtc_Word32 ModuleVideoRenderImpl::Process()
|
int32_t ModuleVideoRenderImpl::Process()
|
||||||
{
|
{
|
||||||
// Not used
|
// Not used
|
||||||
return 0;
|
return 0;
|
||||||
@ -343,7 +343,7 @@ ModuleVideoRenderImpl::Window()
|
|||||||
return _ptrWindow;
|
return _ptrWindow;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 ModuleVideoRenderImpl::ChangeWindow(void* window)
|
int32_t ModuleVideoRenderImpl::ChangeWindow(void* window)
|
||||||
{
|
{
|
||||||
|
|
||||||
CriticalSectionScoped cs(&_moduleCrit);
|
CriticalSectionScoped cs(&_moduleCrit);
|
||||||
@ -398,14 +398,14 @@ WebRtc_Word32 ModuleVideoRenderImpl::ChangeWindow(void* window)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 ModuleVideoRenderImpl::Id()
|
int32_t ModuleVideoRenderImpl::Id()
|
||||||
{
|
{
|
||||||
CriticalSectionScoped cs(&_moduleCrit);
|
CriticalSectionScoped cs(&_moduleCrit);
|
||||||
return _id;
|
return _id;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_UWord32 ModuleVideoRenderImpl::GetIncomingFrameRate(
|
uint32_t ModuleVideoRenderImpl::GetIncomingFrameRate(
|
||||||
const WebRtc_UWord32 streamId)
|
const uint32_t streamId)
|
||||||
{
|
{
|
||||||
CriticalSectionScoped cs(&_moduleCrit);
|
CriticalSectionScoped cs(&_moduleCrit);
|
||||||
|
|
||||||
@ -430,8 +430,8 @@ WebRtc_UWord32 ModuleVideoRenderImpl::GetIncomingFrameRate(
|
|||||||
}
|
}
|
||||||
|
|
||||||
VideoRenderCallback*
|
VideoRenderCallback*
|
||||||
ModuleVideoRenderImpl::AddIncomingRenderStream(const WebRtc_UWord32 streamId,
|
ModuleVideoRenderImpl::AddIncomingRenderStream(const uint32_t streamId,
|
||||||
const WebRtc_UWord32 zOrder,
|
const uint32_t zOrder,
|
||||||
const float left,
|
const float left,
|
||||||
const float top,
|
const float top,
|
||||||
const float right,
|
const float right,
|
||||||
@ -494,8 +494,8 @@ ModuleVideoRenderImpl::AddIncomingRenderStream(const WebRtc_UWord32 streamId,
|
|||||||
return moduleCallback;
|
return moduleCallback;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 ModuleVideoRenderImpl::DeleteIncomingRenderStream(
|
int32_t ModuleVideoRenderImpl::DeleteIncomingRenderStream(
|
||||||
const WebRtc_UWord32 streamId)
|
const uint32_t streamId)
|
||||||
{
|
{
|
||||||
CriticalSectionScoped cs(&_moduleCrit);
|
CriticalSectionScoped cs(&_moduleCrit);
|
||||||
|
|
||||||
@ -524,8 +524,8 @@ WebRtc_Word32 ModuleVideoRenderImpl::DeleteIncomingRenderStream(
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 ModuleVideoRenderImpl::AddExternalRenderCallback(
|
int32_t ModuleVideoRenderImpl::AddExternalRenderCallback(
|
||||||
const WebRtc_UWord32 streamId,
|
const uint32_t streamId,
|
||||||
VideoRenderCallback* renderObject)
|
VideoRenderCallback* renderObject)
|
||||||
{
|
{
|
||||||
CriticalSectionScoped cs(&_moduleCrit);
|
CriticalSectionScoped cs(&_moduleCrit);
|
||||||
@ -548,9 +548,9 @@ WebRtc_Word32 ModuleVideoRenderImpl::AddExternalRenderCallback(
|
|||||||
return ptrIncomingStream->SetExternalCallback(renderObject);
|
return ptrIncomingStream->SetExternalCallback(renderObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 ModuleVideoRenderImpl::GetIncomingRenderStreamProperties(
|
int32_t ModuleVideoRenderImpl::GetIncomingRenderStreamProperties(
|
||||||
const WebRtc_UWord32 streamId,
|
const uint32_t streamId,
|
||||||
WebRtc_UWord32& zOrder,
|
uint32_t& zOrder,
|
||||||
float& left,
|
float& left,
|
||||||
float& top,
|
float& top,
|
||||||
float& right,
|
float& right,
|
||||||
@ -570,15 +570,15 @@ WebRtc_Word32 ModuleVideoRenderImpl::GetIncomingRenderStreamProperties(
|
|||||||
bottom);
|
bottom);
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_UWord32 ModuleVideoRenderImpl::GetNumIncomingRenderStreams() const
|
uint32_t ModuleVideoRenderImpl::GetNumIncomingRenderStreams() const
|
||||||
{
|
{
|
||||||
CriticalSectionScoped cs(&_moduleCrit);
|
CriticalSectionScoped cs(&_moduleCrit);
|
||||||
|
|
||||||
return (WebRtc_UWord32) _streamRenderMap.Size();
|
return (uint32_t) _streamRenderMap.Size();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ModuleVideoRenderImpl::HasIncomingRenderStream(
|
bool ModuleVideoRenderImpl::HasIncomingRenderStream(
|
||||||
const WebRtc_UWord32 streamId) const
|
const uint32_t streamId) const
|
||||||
{
|
{
|
||||||
CriticalSectionScoped cs(&_moduleCrit);
|
CriticalSectionScoped cs(&_moduleCrit);
|
||||||
|
|
||||||
@ -590,14 +590,14 @@ bool ModuleVideoRenderImpl::HasIncomingRenderStream(
|
|||||||
return hasStream;
|
return hasStream;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 ModuleVideoRenderImpl::RegisterRawFrameCallback(
|
int32_t ModuleVideoRenderImpl::RegisterRawFrameCallback(
|
||||||
const WebRtc_UWord32 streamId,
|
const uint32_t streamId,
|
||||||
VideoRenderCallback* callbackObj)
|
VideoRenderCallback* callbackObj)
|
||||||
{
|
{
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 ModuleVideoRenderImpl::StartRender(const WebRtc_UWord32 streamId)
|
int32_t ModuleVideoRenderImpl::StartRender(const uint32_t streamId)
|
||||||
{
|
{
|
||||||
CriticalSectionScoped cs(&_moduleCrit);
|
CriticalSectionScoped cs(&_moduleCrit);
|
||||||
|
|
||||||
@ -630,7 +630,7 @@ WebRtc_Word32 ModuleVideoRenderImpl::StartRender(const WebRtc_UWord32 streamId)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 ModuleVideoRenderImpl::StopRender(const WebRtc_UWord32 streamId)
|
int32_t ModuleVideoRenderImpl::StopRender(const uint32_t streamId)
|
||||||
{
|
{
|
||||||
CriticalSectionScoped cs(&_moduleCrit);
|
CriticalSectionScoped cs(&_moduleCrit);
|
||||||
|
|
||||||
@ -658,11 +658,11 @@ WebRtc_Word32 ModuleVideoRenderImpl::StopRender(const WebRtc_UWord32 streamId)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 ModuleVideoRenderImpl::ResetRender()
|
int32_t ModuleVideoRenderImpl::ResetRender()
|
||||||
{
|
{
|
||||||
CriticalSectionScoped cs(&_moduleCrit);
|
CriticalSectionScoped cs(&_moduleCrit);
|
||||||
|
|
||||||
WebRtc_Word32 error = 0;
|
int32_t error = 0;
|
||||||
|
|
||||||
// Loop through all incoming streams and stop them
|
// Loop through all incoming streams and stop them
|
||||||
MapItem* item = _streamRenderMap.First();
|
MapItem* item = _streamRenderMap.First();
|
||||||
@ -704,9 +704,9 @@ bool ModuleVideoRenderImpl::IsFullScreen()
|
|||||||
return _ptrRenderer->FullScreen();
|
return _ptrRenderer->FullScreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 ModuleVideoRenderImpl::GetScreenResolution(
|
int32_t ModuleVideoRenderImpl::GetScreenResolution(
|
||||||
WebRtc_UWord32& screenWidth,
|
uint32_t& screenWidth,
|
||||||
WebRtc_UWord32& screenHeight) const
|
uint32_t& screenHeight) const
|
||||||
{
|
{
|
||||||
CriticalSectionScoped cs(&_moduleCrit);
|
CriticalSectionScoped cs(&_moduleCrit);
|
||||||
|
|
||||||
@ -719,8 +719,8 @@ WebRtc_Word32 ModuleVideoRenderImpl::GetScreenResolution(
|
|||||||
return _ptrRenderer->GetScreenResolution(screenWidth, screenHeight);
|
return _ptrRenderer->GetScreenResolution(screenWidth, screenHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_UWord32 ModuleVideoRenderImpl::RenderFrameRate(
|
uint32_t ModuleVideoRenderImpl::RenderFrameRate(
|
||||||
const WebRtc_UWord32 streamId)
|
const uint32_t streamId)
|
||||||
{
|
{
|
||||||
CriticalSectionScoped cs(&_moduleCrit);
|
CriticalSectionScoped cs(&_moduleCrit);
|
||||||
|
|
||||||
@ -733,8 +733,8 @@ WebRtc_UWord32 ModuleVideoRenderImpl::RenderFrameRate(
|
|||||||
return _ptrRenderer->RenderFrameRate(streamId);
|
return _ptrRenderer->RenderFrameRate(streamId);
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 ModuleVideoRenderImpl::SetStreamCropping(
|
int32_t ModuleVideoRenderImpl::SetStreamCropping(
|
||||||
const WebRtc_UWord32 streamId,
|
const uint32_t streamId,
|
||||||
const float left,
|
const float left,
|
||||||
const float top,
|
const float top,
|
||||||
const float right,
|
const float right,
|
||||||
@ -751,7 +751,7 @@ WebRtc_Word32 ModuleVideoRenderImpl::SetStreamCropping(
|
|||||||
return _ptrRenderer->SetStreamCropping(streamId, left, top, right, bottom);
|
return _ptrRenderer->SetStreamCropping(streamId, left, top, right, bottom);
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 ModuleVideoRenderImpl::SetTransparentBackground(const bool enable)
|
int32_t ModuleVideoRenderImpl::SetTransparentBackground(const bool enable)
|
||||||
{
|
{
|
||||||
CriticalSectionScoped cs(&_moduleCrit);
|
CriticalSectionScoped cs(&_moduleCrit);
|
||||||
|
|
||||||
@ -764,18 +764,17 @@ WebRtc_Word32 ModuleVideoRenderImpl::SetTransparentBackground(const bool enable)
|
|||||||
return _ptrRenderer->SetTransparentBackground(enable);
|
return _ptrRenderer->SetTransparentBackground(enable);
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 ModuleVideoRenderImpl::FullScreenRender(void* window,
|
int32_t ModuleVideoRenderImpl::FullScreenRender(void* window, const bool enable)
|
||||||
const bool enable)
|
|
||||||
{
|
{
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 ModuleVideoRenderImpl::SetText(
|
int32_t ModuleVideoRenderImpl::SetText(
|
||||||
const WebRtc_UWord8 textId,
|
const uint8_t textId,
|
||||||
const WebRtc_UWord8* text,
|
const uint8_t* text,
|
||||||
const WebRtc_Word32 textLength,
|
const int32_t textLength,
|
||||||
const WebRtc_UWord32 textColorRef,
|
const uint32_t textColorRef,
|
||||||
const WebRtc_UWord32 backgroundColorRef,
|
const uint32_t backgroundColorRef,
|
||||||
const float left, const float top,
|
const float left, const float top,
|
||||||
const float right,
|
const float right,
|
||||||
const float bottom)
|
const float bottom)
|
||||||
@ -792,13 +791,13 @@ WebRtc_Word32 ModuleVideoRenderImpl::SetText(
|
|||||||
backgroundColorRef, left, top, right, bottom);
|
backgroundColorRef, left, top, right, bottom);
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 ModuleVideoRenderImpl::SetBitmap(const void* bitMap,
|
int32_t ModuleVideoRenderImpl::SetBitmap(const void* bitMap,
|
||||||
const WebRtc_UWord8 pictureId,
|
const uint8_t pictureId,
|
||||||
const void* colorKey,
|
const void* colorKey,
|
||||||
const float left,
|
const float left,
|
||||||
const float top,
|
const float top,
|
||||||
const float right,
|
const float right,
|
||||||
const float bottom)
|
const float bottom)
|
||||||
{
|
{
|
||||||
CriticalSectionScoped cs(&_moduleCrit);
|
CriticalSectionScoped cs(&_moduleCrit);
|
||||||
|
|
||||||
@ -812,8 +811,8 @@ WebRtc_Word32 ModuleVideoRenderImpl::SetBitmap(const void* bitMap,
|
|||||||
right, bottom);
|
right, bottom);
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 ModuleVideoRenderImpl::GetLastRenderedFrame(
|
int32_t ModuleVideoRenderImpl::GetLastRenderedFrame(
|
||||||
const WebRtc_UWord32 streamId,
|
const uint32_t streamId,
|
||||||
I420VideoFrame &frame) const
|
I420VideoFrame &frame) const
|
||||||
{
|
{
|
||||||
CriticalSectionScoped cs(&_moduleCrit);
|
CriticalSectionScoped cs(&_moduleCrit);
|
||||||
@ -845,8 +844,8 @@ WebRtc_Word32 ModuleVideoRenderImpl::GetLastRenderedFrame(
|
|||||||
return incomingStream->GetLastRenderedFrame(frame);
|
return incomingStream->GetLastRenderedFrame(frame);
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 ModuleVideoRenderImpl::SetExpectedRenderDelay(
|
int32_t ModuleVideoRenderImpl::SetExpectedRenderDelay(
|
||||||
WebRtc_UWord32 stream_id, WebRtc_Word32 delay_ms) {
|
uint32_t stream_id, int32_t delay_ms) {
|
||||||
CriticalSectionScoped cs(&_moduleCrit);
|
CriticalSectionScoped cs(&_moduleCrit);
|
||||||
|
|
||||||
if (!_ptrRenderer) {
|
if (!_ptrRenderer) {
|
||||||
@ -876,8 +875,8 @@ WebRtc_Word32 ModuleVideoRenderImpl::SetExpectedRenderDelay(
|
|||||||
return incoming_stream->SetExpectedRenderDelay(delay_ms);
|
return incoming_stream->SetExpectedRenderDelay(delay_ms);
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 ModuleVideoRenderImpl::ConfigureRenderer(
|
int32_t ModuleVideoRenderImpl::ConfigureRenderer(
|
||||||
const WebRtc_UWord32 streamId,
|
const uint32_t streamId,
|
||||||
const unsigned int zOrder,
|
const unsigned int zOrder,
|
||||||
const float left,
|
const float left,
|
||||||
const float top,
|
const float top,
|
||||||
@ -896,8 +895,8 @@ WebRtc_Word32 ModuleVideoRenderImpl::ConfigureRenderer(
|
|||||||
bottom);
|
bottom);
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 ModuleVideoRenderImpl::SetStartImage(
|
int32_t ModuleVideoRenderImpl::SetStartImage(
|
||||||
const WebRtc_UWord32 streamId,
|
const uint32_t streamId,
|
||||||
const I420VideoFrame& videoFrame)
|
const I420VideoFrame& videoFrame)
|
||||||
{
|
{
|
||||||
CriticalSectionScoped cs(&_moduleCrit);
|
CriticalSectionScoped cs(&_moduleCrit);
|
||||||
@ -930,10 +929,10 @@ WebRtc_Word32 ModuleVideoRenderImpl::SetStartImage(
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 ModuleVideoRenderImpl::SetTimeoutImage(
|
int32_t ModuleVideoRenderImpl::SetTimeoutImage(
|
||||||
const WebRtc_UWord32 streamId,
|
const uint32_t streamId,
|
||||||
const I420VideoFrame& videoFrame,
|
const I420VideoFrame& videoFrame,
|
||||||
const WebRtc_UWord32 timeout)
|
const uint32_t timeout)
|
||||||
{
|
{
|
||||||
CriticalSectionScoped cs(&_moduleCrit);
|
CriticalSectionScoped cs(&_moduleCrit);
|
||||||
|
|
||||||
@ -964,10 +963,10 @@ WebRtc_Word32 ModuleVideoRenderImpl::SetTimeoutImage(
|
|||||||
return incomingStream->SetTimeoutImage(videoFrame, timeout);
|
return incomingStream->SetTimeoutImage(videoFrame, timeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 ModuleVideoRenderImpl::MirrorRenderStream(const int renderId,
|
int32_t ModuleVideoRenderImpl::MirrorRenderStream(const int renderId,
|
||||||
const bool enable,
|
const bool enable,
|
||||||
const bool mirrorXAxis,
|
const bool mirrorXAxis,
|
||||||
const bool mirrorYAxis)
|
const bool mirrorYAxis)
|
||||||
{
|
{
|
||||||
CriticalSectionScoped cs(&_moduleCrit);
|
CriticalSectionScoped cs(&_moduleCrit);
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ public:
|
|||||||
/*
|
/*
|
||||||
* VideoRenderer constructor/destructor
|
* VideoRenderer constructor/destructor
|
||||||
*/
|
*/
|
||||||
ModuleVideoRenderImpl(const WebRtc_Word32 id,
|
ModuleVideoRenderImpl(const int32_t id,
|
||||||
const VideoRenderType videoRenderType,
|
const VideoRenderType videoRenderType,
|
||||||
void* window, const bool fullscreen);
|
void* window, const bool fullscreen);
|
||||||
|
|
||||||
@ -37,10 +37,10 @@ public:
|
|||||||
/*
|
/*
|
||||||
* Change the unique identifier of this object
|
* Change the unique identifier of this object
|
||||||
*/
|
*/
|
||||||
virtual WebRtc_Word32 ChangeUniqueId(const WebRtc_Word32 id);
|
virtual int32_t ChangeUniqueId(const int32_t id);
|
||||||
|
|
||||||
virtual WebRtc_Word32 TimeUntilNextProcess();
|
virtual int32_t TimeUntilNextProcess();
|
||||||
virtual WebRtc_Word32 Process();
|
virtual int32_t Process();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Returns the render window
|
* Returns the render window
|
||||||
@ -50,12 +50,12 @@ public:
|
|||||||
/*
|
/*
|
||||||
* Change render window
|
* Change render window
|
||||||
*/
|
*/
|
||||||
virtual WebRtc_Word32 ChangeWindow(void* window);
|
virtual int32_t ChangeWindow(void* window);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Returns module id
|
* Returns module id
|
||||||
*/
|
*/
|
||||||
WebRtc_Word32 Id();
|
int32_t Id();
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
@ -67,58 +67,58 @@ public:
|
|||||||
* Add incoming render stream
|
* Add incoming render stream
|
||||||
*/
|
*/
|
||||||
virtual VideoRenderCallback
|
virtual VideoRenderCallback
|
||||||
* AddIncomingRenderStream(const WebRtc_UWord32 streamId,
|
* AddIncomingRenderStream(const uint32_t streamId,
|
||||||
const WebRtc_UWord32 zOrder,
|
const uint32_t zOrder,
|
||||||
const float left, const float top,
|
const float left, const float top,
|
||||||
const float right, const float bottom);
|
const float right, const float bottom);
|
||||||
/*
|
/*
|
||||||
* Delete incoming render stream
|
* Delete incoming render stream
|
||||||
*/
|
*/
|
||||||
virtual WebRtc_Word32
|
virtual int32_t
|
||||||
DeleteIncomingRenderStream(const WebRtc_UWord32 streamId);
|
DeleteIncomingRenderStream(const uint32_t streamId);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Add incoming render callback, used for external rendering
|
* Add incoming render callback, used for external rendering
|
||||||
*/
|
*/
|
||||||
virtual WebRtc_Word32
|
virtual int32_t
|
||||||
AddExternalRenderCallback(const WebRtc_UWord32 streamId,
|
AddExternalRenderCallback(const uint32_t streamId,
|
||||||
VideoRenderCallback* renderObject);
|
VideoRenderCallback* renderObject);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Get the porperties for an incoming render stream
|
* Get the porperties for an incoming render stream
|
||||||
*/
|
*/
|
||||||
virtual WebRtc_Word32
|
virtual int32_t
|
||||||
GetIncomingRenderStreamProperties(const WebRtc_UWord32 streamId,
|
GetIncomingRenderStreamProperties(const uint32_t streamId,
|
||||||
WebRtc_UWord32& zOrder,
|
uint32_t& zOrder,
|
||||||
float& left, float& top,
|
float& left, float& top,
|
||||||
float& right, float& bottom) const;
|
float& right, float& bottom) const;
|
||||||
/*
|
/*
|
||||||
* Incoming frame rate for the specified stream.
|
* Incoming frame rate for the specified stream.
|
||||||
*/
|
*/
|
||||||
virtual WebRtc_UWord32 GetIncomingFrameRate(const WebRtc_UWord32 streamId);
|
virtual uint32_t GetIncomingFrameRate(const uint32_t streamId);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Returns the number of incoming streams added to this render module
|
* Returns the number of incoming streams added to this render module
|
||||||
*/
|
*/
|
||||||
virtual WebRtc_UWord32 GetNumIncomingRenderStreams() const;
|
virtual uint32_t GetNumIncomingRenderStreams() const;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Returns true if this render module has the streamId added, false otherwise.
|
* Returns true if this render module has the streamId added, false otherwise.
|
||||||
*/
|
*/
|
||||||
virtual bool HasIncomingRenderStream(const WebRtc_UWord32 streamId) const;
|
virtual bool HasIncomingRenderStream(const uint32_t streamId) const;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
virtual WebRtc_Word32
|
virtual int32_t
|
||||||
RegisterRawFrameCallback(const WebRtc_UWord32 streamId,
|
RegisterRawFrameCallback(const uint32_t streamId,
|
||||||
VideoRenderCallback* callbackObj);
|
VideoRenderCallback* callbackObj);
|
||||||
|
|
||||||
virtual WebRtc_Word32 GetLastRenderedFrame(const WebRtc_UWord32 streamId,
|
virtual int32_t GetLastRenderedFrame(const uint32_t streamId,
|
||||||
I420VideoFrame &frame) const;
|
I420VideoFrame &frame) const;
|
||||||
|
|
||||||
virtual WebRtc_Word32 SetExpectedRenderDelay(WebRtc_UWord32 stream_id,
|
virtual int32_t SetExpectedRenderDelay(uint32_t stream_id,
|
||||||
WebRtc_Word32 delay_ms);
|
int32_t delay_ms);
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
@ -129,17 +129,17 @@ public:
|
|||||||
/*
|
/*
|
||||||
* Starts rendering the specified stream
|
* Starts rendering the specified stream
|
||||||
*/
|
*/
|
||||||
virtual WebRtc_Word32 StartRender(const WebRtc_UWord32 streamId);
|
virtual int32_t StartRender(const uint32_t streamId);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Stops the renderer
|
* Stops the renderer
|
||||||
*/
|
*/
|
||||||
virtual WebRtc_Word32 StopRender(const WebRtc_UWord32 streamId);
|
virtual int32_t StopRender(const uint32_t streamId);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Sets the renderer in start state, no streams removed.
|
* Sets the renderer in start state, no streams removed.
|
||||||
*/
|
*/
|
||||||
virtual WebRtc_Word32 ResetRender();
|
virtual int32_t ResetRender();
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
@ -160,62 +160,60 @@ public:
|
|||||||
/*
|
/*
|
||||||
* Gets screen resolution in pixels
|
* Gets screen resolution in pixels
|
||||||
*/
|
*/
|
||||||
virtual WebRtc_Word32
|
virtual int32_t
|
||||||
GetScreenResolution(WebRtc_UWord32& screenWidth,
|
GetScreenResolution(uint32_t& screenWidth,
|
||||||
WebRtc_UWord32& screenHeight) const;
|
uint32_t& screenHeight) const;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Get the actual render rate for this stream. I.e rendered frame rate,
|
* Get the actual render rate for this stream. I.e rendered frame rate,
|
||||||
* not frames delivered to the renderer.
|
* not frames delivered to the renderer.
|
||||||
*/
|
*/
|
||||||
virtual WebRtc_UWord32 RenderFrameRate(const WebRtc_UWord32 streamId);
|
virtual uint32_t RenderFrameRate(const uint32_t streamId);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Set cropping of incoming stream
|
* Set cropping of incoming stream
|
||||||
*/
|
*/
|
||||||
virtual WebRtc_Word32 SetStreamCropping(const WebRtc_UWord32 streamId,
|
virtual int32_t SetStreamCropping(const uint32_t streamId,
|
||||||
const float left, const float top,
|
const float left, const float top,
|
||||||
const float right,
|
const float right, const float bottom);
|
||||||
const float bottom);
|
|
||||||
|
|
||||||
virtual WebRtc_Word32 ConfigureRenderer(const WebRtc_UWord32 streamId,
|
virtual int32_t ConfigureRenderer(const uint32_t streamId,
|
||||||
const unsigned int zOrder,
|
const unsigned int zOrder,
|
||||||
const float left, const float top,
|
const float left, const float top,
|
||||||
const float right,
|
const float right, const float bottom);
|
||||||
const float bottom);
|
|
||||||
|
|
||||||
virtual WebRtc_Word32 SetTransparentBackground(const bool enable);
|
virtual int32_t SetTransparentBackground(const bool enable);
|
||||||
|
|
||||||
virtual WebRtc_Word32 FullScreenRender(void* window, const bool enable);
|
virtual int32_t FullScreenRender(void* window, const bool enable);
|
||||||
|
|
||||||
virtual WebRtc_Word32 SetBitmap(const void* bitMap,
|
virtual int32_t SetBitmap(const void* bitMap,
|
||||||
const WebRtc_UWord8 pictureId,
|
const uint8_t pictureId,
|
||||||
const void* colorKey, const float left,
|
const void* colorKey,
|
||||||
const float top, const float right,
|
const float left, const float top,
|
||||||
const float bottom);
|
const float right, const float bottom);
|
||||||
|
|
||||||
virtual WebRtc_Word32 SetText(const WebRtc_UWord8 textId,
|
virtual int32_t SetText(const uint8_t textId,
|
||||||
const WebRtc_UWord8* text,
|
const uint8_t* text,
|
||||||
const WebRtc_Word32 textLength,
|
const int32_t textLength,
|
||||||
const WebRtc_UWord32 textColorRef,
|
const uint32_t textColorRef,
|
||||||
const WebRtc_UWord32 backgroundColorRef,
|
const uint32_t backgroundColorRef,
|
||||||
const float left, const float top,
|
const float left, const float top,
|
||||||
const float right, const float bottom);
|
const float right, const float bottom);
|
||||||
|
|
||||||
virtual WebRtc_Word32 SetStartImage(const WebRtc_UWord32 streamId,
|
virtual int32_t SetStartImage(const uint32_t streamId,
|
||||||
const I420VideoFrame& videoFrame);
|
const I420VideoFrame& videoFrame);
|
||||||
|
|
||||||
virtual WebRtc_Word32 SetTimeoutImage(const WebRtc_UWord32 streamId,
|
virtual int32_t SetTimeoutImage(const uint32_t streamId,
|
||||||
const I420VideoFrame& videoFrame,
|
const I420VideoFrame& videoFrame,
|
||||||
const WebRtc_UWord32 timeout);
|
const uint32_t timeout);
|
||||||
|
|
||||||
virtual WebRtc_Word32 MirrorRenderStream(const int renderId,
|
virtual int32_t MirrorRenderStream(const int renderId,
|
||||||
const bool enable,
|
const bool enable,
|
||||||
const bool mirrorXAxis,
|
const bool mirrorXAxis,
|
||||||
const bool mirrorYAxis);
|
const bool mirrorYAxis);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
WebRtc_Word32 _id;
|
int32_t _id;
|
||||||
CriticalSectionWrapper& _moduleCrit;
|
CriticalSectionWrapper& _moduleCrit;
|
||||||
void* _ptrWindow;
|
void* _ptrWindow;
|
||||||
bool _fullScreen;
|
bool _fullScreen;
|
||||||
|
@ -28,7 +28,7 @@ public:
|
|||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
virtual WebRtc_Word32 Init() = 0;
|
virtual int32_t Init() = 0;
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
@ -37,22 +37,20 @@ public:
|
|||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
virtual VideoRenderCallback
|
virtual VideoRenderCallback
|
||||||
* CreateChannel(const WebRtc_UWord32 streamId,
|
* CreateChannel(const uint32_t streamId,
|
||||||
const WebRtc_UWord32 zOrder,
|
const uint32_t zOrder,
|
||||||
const float left,
|
const float left,
|
||||||
const float top,
|
const float top,
|
||||||
const float right,
|
const float right,
|
||||||
const float bottom) = 0;
|
const float bottom) = 0;
|
||||||
|
|
||||||
virtual WebRtc_Word32 DeleteChannel(const WebRtc_UWord32 streamId) = 0;
|
virtual int32_t DeleteChannel(const uint32_t streamId) = 0;
|
||||||
|
|
||||||
virtual WebRtc_Word32 GetStreamSettings(const WebRtc_UWord32 channel,
|
virtual int32_t GetStreamSettings(const uint32_t channel,
|
||||||
const WebRtc_UWord16 streamId,
|
const uint16_t streamId,
|
||||||
WebRtc_UWord32& zOrder,
|
uint32_t& zOrder,
|
||||||
float& left,
|
float& left, float& top,
|
||||||
float& top,
|
float& right, float& bottom) = 0;
|
||||||
float& right,
|
|
||||||
float& bottom) = 0;
|
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
@ -60,9 +58,9 @@ public:
|
|||||||
*
|
*
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
virtual WebRtc_Word32 StartRender() = 0;
|
virtual int32_t StartRender() = 0;
|
||||||
|
|
||||||
virtual WebRtc_Word32 StopRender() = 0;
|
virtual int32_t StopRender() = 0;
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
@ -72,45 +70,39 @@ public:
|
|||||||
|
|
||||||
virtual bool IsFullScreen() = 0;
|
virtual bool IsFullScreen() = 0;
|
||||||
|
|
||||||
virtual WebRtc_Word32 SetCropping(const WebRtc_UWord32 channel,
|
virtual int32_t SetCropping(const uint32_t channel,
|
||||||
const WebRtc_UWord16 streamId,
|
const uint16_t streamId,
|
||||||
|
const float left, const float top,
|
||||||
|
const float right, const float bottom) = 0;
|
||||||
|
|
||||||
|
virtual int32_t ConfigureRenderer(const uint32_t channel,
|
||||||
|
const uint16_t streamId,
|
||||||
|
const unsigned int zOrder,
|
||||||
const float left,
|
const float left,
|
||||||
const float top,
|
const float top,
|
||||||
const float right,
|
const float right,
|
||||||
const float bottom) = 0;
|
const float bottom) = 0;
|
||||||
|
|
||||||
virtual WebRtc_Word32 ConfigureRenderer(const WebRtc_UWord32 channel,
|
virtual int32_t SetTransparentBackground(const bool enable) = 0;
|
||||||
const WebRtc_UWord16 streamId,
|
|
||||||
const unsigned int zOrder,
|
|
||||||
const float left,
|
|
||||||
const float top,
|
|
||||||
const float right,
|
|
||||||
const float bottom) = 0;
|
|
||||||
|
|
||||||
virtual WebRtc_Word32 SetTransparentBackground(const bool enable) = 0;
|
virtual int32_t SetText(const uint8_t textId,
|
||||||
|
const uint8_t* text,
|
||||||
|
const int32_t textLength,
|
||||||
|
const uint32_t colorText,
|
||||||
|
const uint32_t colorBg,
|
||||||
|
const float left, const float top,
|
||||||
|
const float rigth, const float bottom) = 0;
|
||||||
|
|
||||||
virtual WebRtc_Word32 SetText(const WebRtc_UWord8 textId,
|
virtual int32_t SetBitmap(const void* bitMap,
|
||||||
const WebRtc_UWord8* text,
|
const uint8_t pictureId,
|
||||||
const WebRtc_Word32 textLength,
|
const void* colorKey,
|
||||||
const WebRtc_UWord32 colorText,
|
const float left, const float top,
|
||||||
const WebRtc_UWord32 colorBg,
|
const float right, const float bottom) = 0;
|
||||||
const float left,
|
|
||||||
const float top,
|
|
||||||
const float rigth,
|
|
||||||
const float bottom) = 0;
|
|
||||||
|
|
||||||
virtual WebRtc_Word32 SetBitmap(const void* bitMap,
|
virtual int32_t ChangeWindow(void* window) = 0;
|
||||||
const WebRtc_UWord8 pictureId,
|
|
||||||
const void* colorKey,
|
|
||||||
const float left,
|
|
||||||
const float top,
|
|
||||||
const float right,
|
|
||||||
const float bottom) = 0;
|
|
||||||
|
|
||||||
virtual WebRtc_Word32 ChangeWindow(void* window) = 0;
|
virtual int32_t GetGraphicsMemory(uint64_t& totalMemory,
|
||||||
|
uint64_t& availableMemory) = 0;
|
||||||
virtual WebRtc_Word32 GetGraphicsMemory(WebRtc_UWord64& totalMemory,
|
|
||||||
WebRtc_UWord64& availableMemory) = 0;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -68,8 +68,8 @@ D3D9Channel::~D3D9Channel()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void D3D9Channel::SetStreamSettings(WebRtc_UWord16 streamId,
|
void D3D9Channel::SetStreamSettings(uint16_t streamId,
|
||||||
WebRtc_UWord32 zOrder,
|
uint32_t zOrder,
|
||||||
float startWidth,
|
float startWidth,
|
||||||
float startHeight,
|
float startHeight,
|
||||||
float stopWidth,
|
float stopWidth,
|
||||||
@ -83,8 +83,8 @@ void D3D9Channel::SetStreamSettings(WebRtc_UWord16 streamId,
|
|||||||
_stopHeight = stopHeight;
|
_stopHeight = stopHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
int D3D9Channel::GetStreamSettings(WebRtc_UWord16 streamId,
|
int D3D9Channel::GetStreamSettings(uint16_t streamId,
|
||||||
WebRtc_UWord32& zOrder,
|
uint32_t& zOrder,
|
||||||
float& startWidth,
|
float& startWidth,
|
||||||
float& startHeight,
|
float& startHeight,
|
||||||
float& stopWidth,
|
float& stopWidth,
|
||||||
@ -142,8 +142,8 @@ int D3D9Channel::FrameSizeChange(int width, int height, int numberOfStreams)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 D3D9Channel::RenderFrame(const WebRtc_UWord32 streamId,
|
int32_t D3D9Channel::RenderFrame(const uint32_t streamId,
|
||||||
I420VideoFrame& videoFrame)
|
I420VideoFrame& videoFrame)
|
||||||
{
|
{
|
||||||
CriticalSectionScoped cs(_critSect);
|
CriticalSectionScoped cs(_critSect);
|
||||||
if (_width != videoFrame.width() || _height != videoFrame.height())
|
if (_width != videoFrame.width() || _height != videoFrame.height())
|
||||||
@ -539,7 +539,7 @@ int VideoRenderDirect3D9::InitDevice()
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderDirect3D9::Init()
|
int32_t VideoRenderDirect3D9::Init()
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceInfo, kTraceVideo, -1,
|
WEBRTC_TRACE(kTraceInfo, kTraceVideo, -1,
|
||||||
"VideoRenderDirect3D9::Init");
|
"VideoRenderDirect3D9::Init");
|
||||||
@ -570,7 +570,7 @@ WebRtc_Word32 VideoRenderDirect3D9::Init()
|
|||||||
return InitDevice();
|
return InitDevice();
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderDirect3D9::ChangeWindow(void* window)
|
int32_t VideoRenderDirect3D9::ChangeWindow(void* window)
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceError, kTraceVideo, -1, "Not supported.");
|
WEBRTC_TRACE(kTraceError, kTraceVideo, -1, "Not supported.");
|
||||||
return -1;
|
return -1;
|
||||||
@ -636,7 +636,7 @@ int VideoRenderDirect3D9::UpdateRenderSurface()
|
|||||||
textureWidth = channelObj->GetTextureWidth();
|
textureWidth = channelObj->GetTextureWidth();
|
||||||
textureHeight = channelObj->GetTextureHeight();
|
textureHeight = channelObj->GetTextureHeight();
|
||||||
|
|
||||||
WebRtc_UWord32 zOrder;
|
uint32_t zOrder;
|
||||||
float startWidth, startHeight, stopWidth, stopHeight;
|
float startWidth, startHeight, stopWidth, stopHeight;
|
||||||
channelObj->GetStreamSettings(0, zOrder, startWidth,
|
channelObj->GetStreamSettings(0, zOrder, startWidth,
|
||||||
startHeight, stopWidth,
|
startHeight, stopWidth,
|
||||||
@ -815,7 +815,7 @@ D3D9Channel* VideoRenderDirect3D9::GetD3DChannel(int channel)
|
|||||||
return ddobj;
|
return ddobj;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderDirect3D9::DeleteChannel(const WebRtc_UWord32 streamId)
|
int32_t VideoRenderDirect3D9::DeleteChannel(const uint32_t streamId)
|
||||||
{
|
{
|
||||||
CriticalSectionScoped cs(&_refD3DCritsect);
|
CriticalSectionScoped cs(&_refD3DCritsect);
|
||||||
|
|
||||||
@ -843,8 +843,8 @@ WebRtc_Word32 VideoRenderDirect3D9::DeleteChannel(const WebRtc_UWord32 streamId)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
VideoRenderCallback* VideoRenderDirect3D9::CreateChannel(const WebRtc_UWord32 channel,
|
VideoRenderCallback* VideoRenderDirect3D9::CreateChannel(const uint32_t channel,
|
||||||
const WebRtc_UWord32 zOrder,
|
const uint32_t zOrder,
|
||||||
const float left,
|
const float left,
|
||||||
const float top,
|
const float top,
|
||||||
const float right,
|
const float right,
|
||||||
@ -871,13 +871,11 @@ VideoRenderCallback* VideoRenderDirect3D9::CreateChannel(const WebRtc_UWord32 ch
|
|||||||
return d3dChannel;
|
return d3dChannel;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderDirect3D9::GetStreamSettings(const WebRtc_UWord32 channel,
|
int32_t VideoRenderDirect3D9::GetStreamSettings(const uint32_t channel,
|
||||||
const WebRtc_UWord16 streamId,
|
const uint16_t streamId,
|
||||||
WebRtc_UWord32& zOrder,
|
uint32_t& zOrder,
|
||||||
float& left,
|
float& left, float& top,
|
||||||
float& top,
|
float& right, float& bottom)
|
||||||
float& right,
|
|
||||||
float& bottom)
|
|
||||||
{
|
{
|
||||||
std::map<int, D3D9Channel*>::iterator ddIt;
|
std::map<int, D3D9Channel*>::iterator ddIt;
|
||||||
ddIt = _d3dChannels.find(channel & 0x0000ffff);
|
ddIt = _d3dChannels.find(channel & 0x0000ffff);
|
||||||
@ -939,13 +937,13 @@ int VideoRenderDirect3D9::UpdateVerticeBuffer(LPDIRECT3DVERTEXBUFFER9 pVB,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderDirect3D9::StartRender()
|
int32_t VideoRenderDirect3D9::StartRender()
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceError, kTraceVideo, -1, "Not supported.");
|
WEBRTC_TRACE(kTraceError, kTraceVideo, -1, "Not supported.");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderDirect3D9::StopRender()
|
int32_t VideoRenderDirect3D9::StopRender()
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceError, kTraceVideo, -1, "Not supported.");
|
WEBRTC_TRACE(kTraceError, kTraceVideo, -1, "Not supported.");
|
||||||
return 0;
|
return 0;
|
||||||
@ -956,45 +954,39 @@ bool VideoRenderDirect3D9::IsFullScreen()
|
|||||||
return _fullScreen;
|
return _fullScreen;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderDirect3D9::SetCropping(const WebRtc_UWord32 channel,
|
int32_t VideoRenderDirect3D9::SetCropping(const uint32_t channel,
|
||||||
const WebRtc_UWord16 streamId,
|
const uint16_t streamId,
|
||||||
const float left,
|
const float left, const float top,
|
||||||
const float top,
|
const float right, const float bottom)
|
||||||
const float right,
|
|
||||||
const float bottom)
|
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceError, kTraceVideo, -1, "Not supported.");
|
WEBRTC_TRACE(kTraceError, kTraceVideo, -1, "Not supported.");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderDirect3D9::SetTransparentBackground(
|
int32_t VideoRenderDirect3D9::SetTransparentBackground(
|
||||||
const bool enable)
|
const bool enable)
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceError, kTraceVideo, -1, "Not supported.");
|
WEBRTC_TRACE(kTraceError, kTraceVideo, -1, "Not supported.");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderDirect3D9::SetText(const WebRtc_UWord8 textId,
|
int32_t VideoRenderDirect3D9::SetText(const uint8_t textId,
|
||||||
const WebRtc_UWord8* text,
|
const uint8_t* text,
|
||||||
const WebRtc_Word32 textLength,
|
const int32_t textLength,
|
||||||
const WebRtc_UWord32 colorText,
|
const uint32_t colorText,
|
||||||
const WebRtc_UWord32 colorBg,
|
const uint32_t colorBg,
|
||||||
const float left,
|
const float left, const float top,
|
||||||
const float top,
|
const float rigth, const float bottom)
|
||||||
const float rigth,
|
|
||||||
const float bottom)
|
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceError, kTraceVideo, -1, "Not supported.");
|
WEBRTC_TRACE(kTraceError, kTraceVideo, -1, "Not supported.");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderDirect3D9::SetBitmap(const void* bitMap,
|
int32_t VideoRenderDirect3D9::SetBitmap(const void* bitMap,
|
||||||
const WebRtc_UWord8 pictureId,
|
const uint8_t pictureId,
|
||||||
const void* colorKey,
|
const void* colorKey,
|
||||||
const float left,
|
const float left, const float top,
|
||||||
const float top,
|
const float right, const float bottom)
|
||||||
const float right,
|
|
||||||
const float bottom)
|
|
||||||
{
|
{
|
||||||
if (!bitMap)
|
if (!bitMap)
|
||||||
{
|
{
|
||||||
@ -1141,8 +1133,8 @@ WebRtc_Word32 VideoRenderDirect3D9::SetBitmap(const void* bitMap,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderDirect3D9::GetGraphicsMemory(WebRtc_UWord64& totalMemory,
|
int32_t VideoRenderDirect3D9::GetGraphicsMemory(uint64_t& totalMemory,
|
||||||
WebRtc_UWord64& availableMemory)
|
uint64_t& availableMemory)
|
||||||
{
|
{
|
||||||
if (_totalMemory == -1 || _availableMemory == -1)
|
if (_totalMemory == -1 || _availableMemory == -1)
|
||||||
{
|
{
|
||||||
@ -1155,13 +1147,13 @@ WebRtc_Word32 VideoRenderDirect3D9::GetGraphicsMemory(WebRtc_UWord64& totalMemor
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderDirect3D9::ConfigureRenderer(const WebRtc_UWord32 channel,
|
int32_t VideoRenderDirect3D9::ConfigureRenderer(const uint32_t channel,
|
||||||
const WebRtc_UWord16 streamId,
|
const uint16_t streamId,
|
||||||
const unsigned int zOrder,
|
const unsigned int zOrder,
|
||||||
const float left,
|
const float left,
|
||||||
const float top,
|
const float top,
|
||||||
const float right,
|
const float right,
|
||||||
const float bottom)
|
const float bottom)
|
||||||
{
|
{
|
||||||
std::map<int, D3D9Channel*>::iterator ddIt;
|
std::map<int, D3D9Channel*>::iterator ddIt;
|
||||||
ddIt = _d3dChannels.find(channel & 0x0000ffff);
|
ddIt = _d3dChannels.find(channel & 0x0000ffff);
|
||||||
|
@ -45,8 +45,8 @@ public:
|
|||||||
|
|
||||||
// A new frame is delivered.
|
// A new frame is delivered.
|
||||||
virtual int DeliverFrame(const I420VideoFrame& videoFrame);
|
virtual int DeliverFrame(const I420VideoFrame& videoFrame);
|
||||||
virtual WebRtc_Word32 RenderFrame(const WebRtc_UWord32 streamId,
|
virtual int32_t RenderFrame(const uint32_t streamId,
|
||||||
I420VideoFrame& videoFrame);
|
I420VideoFrame& videoFrame);
|
||||||
|
|
||||||
// Called to check if the video frame is updated.
|
// Called to check if the video frame is updated.
|
||||||
int IsUpdated(bool& isUpdated);
|
int IsUpdated(bool& isUpdated);
|
||||||
@ -58,14 +58,14 @@ public:
|
|||||||
int GetTextureWidth();
|
int GetTextureWidth();
|
||||||
int GetTextureHeight();
|
int GetTextureHeight();
|
||||||
//
|
//
|
||||||
void SetStreamSettings(WebRtc_UWord16 streamId,
|
void SetStreamSettings(uint16_t streamId,
|
||||||
WebRtc_UWord32 zOrder,
|
uint32_t zOrder,
|
||||||
float startWidth,
|
float startWidth,
|
||||||
float startHeight,
|
float startHeight,
|
||||||
float stopWidth,
|
float stopWidth,
|
||||||
float stopHeight);
|
float stopHeight);
|
||||||
int GetStreamSettings(WebRtc_UWord16 streamId,
|
int GetStreamSettings(uint16_t streamId,
|
||||||
WebRtc_UWord32& zOrder,
|
uint32_t& zOrder,
|
||||||
float& startWidth,
|
float& startWidth,
|
||||||
float& startHeight,
|
float& startHeight,
|
||||||
float& stopWidth,
|
float& stopWidth,
|
||||||
@ -88,8 +88,8 @@ private:
|
|||||||
int _height;
|
int _height;
|
||||||
//sream settings
|
//sream settings
|
||||||
//TODO support multiple streams in one channel
|
//TODO support multiple streams in one channel
|
||||||
WebRtc_UWord16 _streamId;
|
uint16_t _streamId;
|
||||||
WebRtc_UWord32 _zOrder;
|
uint32_t _zOrder;
|
||||||
float _startWidth;
|
float _startWidth;
|
||||||
float _startHeight;
|
float _startHeight;
|
||||||
float _stopWidth;
|
float _stopWidth;
|
||||||
@ -110,7 +110,7 @@ public:
|
|||||||
* Init
|
* Init
|
||||||
*
|
*
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
virtual WebRtc_Word32 Init();
|
virtual int32_t Init();
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
@ -118,22 +118,20 @@ public:
|
|||||||
*
|
*
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
virtual VideoRenderCallback
|
virtual VideoRenderCallback
|
||||||
* CreateChannel(const WebRtc_UWord32 streamId,
|
* CreateChannel(const uint32_t streamId,
|
||||||
const WebRtc_UWord32 zOrder,
|
const uint32_t zOrder,
|
||||||
const float left,
|
const float left,
|
||||||
const float top,
|
const float top,
|
||||||
const float right,
|
const float right,
|
||||||
const float bottom);
|
const float bottom);
|
||||||
|
|
||||||
virtual WebRtc_Word32 DeleteChannel(const WebRtc_UWord32 streamId);
|
virtual int32_t DeleteChannel(const uint32_t streamId);
|
||||||
|
|
||||||
virtual WebRtc_Word32 GetStreamSettings(const WebRtc_UWord32 channel,
|
virtual int32_t GetStreamSettings(const uint32_t channel,
|
||||||
const WebRtc_UWord16 streamId,
|
const uint16_t streamId,
|
||||||
WebRtc_UWord32& zOrder,
|
uint32_t& zOrder,
|
||||||
float& left,
|
float& left, float& top,
|
||||||
float& top,
|
float& right, float& bottom);
|
||||||
float& right,
|
|
||||||
float& bottom);
|
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
@ -141,8 +139,8 @@ public:
|
|||||||
*
|
*
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
virtual WebRtc_Word32 StartRender();
|
virtual int32_t StartRender();
|
||||||
virtual WebRtc_Word32 StopRender();
|
virtual int32_t StopRender();
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
@ -152,45 +150,37 @@ public:
|
|||||||
|
|
||||||
virtual bool IsFullScreen();
|
virtual bool IsFullScreen();
|
||||||
|
|
||||||
virtual WebRtc_Word32 SetCropping(const WebRtc_UWord32 channel,
|
virtual int32_t SetCropping(const uint32_t channel,
|
||||||
const WebRtc_UWord16 streamId,
|
const uint16_t streamId,
|
||||||
const float left,
|
const float left, const float top,
|
||||||
const float top,
|
const float right, const float bottom);
|
||||||
const float right,
|
|
||||||
const float bottom);
|
|
||||||
|
|
||||||
virtual WebRtc_Word32 ConfigureRenderer(const WebRtc_UWord32 channel,
|
virtual int32_t ConfigureRenderer(const uint32_t channel,
|
||||||
const WebRtc_UWord16 streamId,
|
const uint16_t streamId,
|
||||||
const unsigned int zOrder,
|
const unsigned int zOrder,
|
||||||
const float left,
|
const float left, const float top,
|
||||||
const float top,
|
const float right, const float bottom);
|
||||||
const float right,
|
|
||||||
const float bottom);
|
|
||||||
|
|
||||||
virtual WebRtc_Word32 SetTransparentBackground(const bool enable);
|
virtual int32_t SetTransparentBackground(const bool enable);
|
||||||
|
|
||||||
virtual WebRtc_Word32 ChangeWindow(void* window);
|
virtual int32_t ChangeWindow(void* window);
|
||||||
|
|
||||||
virtual WebRtc_Word32 GetGraphicsMemory(WebRtc_UWord64& totalMemory,
|
virtual int32_t GetGraphicsMemory(uint64_t& totalMemory,
|
||||||
WebRtc_UWord64& availableMemory);
|
uint64_t& availableMemory);
|
||||||
|
|
||||||
virtual WebRtc_Word32 SetText(const WebRtc_UWord8 textId,
|
virtual int32_t SetText(const uint8_t textId,
|
||||||
const WebRtc_UWord8* text,
|
const uint8_t* text,
|
||||||
const WebRtc_Word32 textLength,
|
const int32_t textLength,
|
||||||
const WebRtc_UWord32 colorText,
|
const uint32_t colorText,
|
||||||
const WebRtc_UWord32 colorBg,
|
const uint32_t colorBg,
|
||||||
const float left,
|
const float left, const float top,
|
||||||
const float top,
|
const float rigth, const float bottom);
|
||||||
const float rigth,
|
|
||||||
const float bottom);
|
|
||||||
|
|
||||||
virtual WebRtc_Word32 SetBitmap(const void* bitMap,
|
virtual int32_t SetBitmap(const void* bitMap,
|
||||||
const WebRtc_UWord8 pictureId,
|
const uint8_t pictureId,
|
||||||
const void* colorKey,
|
const void* colorKey,
|
||||||
const float left,
|
const float left, const float top,
|
||||||
const float top,
|
const float right, const float bottom);
|
||||||
const float right,
|
|
||||||
const float bottom);
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// Get a channel by channel id
|
// Get a channel by channel id
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
|
|
||||||
VideoRenderWindowsImpl::VideoRenderWindowsImpl(const WebRtc_Word32 id,
|
VideoRenderWindowsImpl::VideoRenderWindowsImpl(const int32_t id,
|
||||||
const VideoRenderType videoRenderType, void* window, const bool fullscreen)
|
const VideoRenderType videoRenderType, void* window, const bool fullscreen)
|
||||||
: _id(id),
|
: _id(id),
|
||||||
_renderWindowsCritsect(*CriticalSectionWrapper::CreateCriticalSection()),
|
_renderWindowsCritsect(*CriticalSectionWrapper::CreateCriticalSection()),
|
||||||
@ -41,7 +41,7 @@ VideoRenderWindowsImpl::~VideoRenderWindowsImpl()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderWindowsImpl::Init()
|
int32_t VideoRenderWindowsImpl::Init()
|
||||||
{
|
{
|
||||||
// Create the win renderer
|
// Create the win renderer
|
||||||
switch (_renderMethod)
|
switch (_renderMethod)
|
||||||
@ -72,14 +72,14 @@ WebRtc_Word32 VideoRenderWindowsImpl::Init()
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderWindowsImpl::ChangeUniqueId(const WebRtc_Word32 id)
|
int32_t VideoRenderWindowsImpl::ChangeUniqueId(const int32_t id)
|
||||||
{
|
{
|
||||||
CriticalSectionScoped cs(&_renderWindowsCritsect);
|
CriticalSectionScoped cs(&_renderWindowsCritsect);
|
||||||
_id = id;
|
_id = id;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderWindowsImpl::ChangeWindow(void* window)
|
int32_t VideoRenderWindowsImpl::ChangeWindow(void* window)
|
||||||
{
|
{
|
||||||
CriticalSectionScoped cs(&_renderWindowsCritsect);
|
CriticalSectionScoped cs(&_renderWindowsCritsect);
|
||||||
if (!_ptrRendererWin)
|
if (!_ptrRendererWin)
|
||||||
@ -93,8 +93,8 @@ WebRtc_Word32 VideoRenderWindowsImpl::ChangeWindow(void* window)
|
|||||||
}
|
}
|
||||||
|
|
||||||
VideoRenderCallback*
|
VideoRenderCallback*
|
||||||
VideoRenderWindowsImpl::AddIncomingRenderStream(const WebRtc_UWord32 streamId,
|
VideoRenderWindowsImpl::AddIncomingRenderStream(const uint32_t streamId,
|
||||||
const WebRtc_UWord32 zOrder,
|
const uint32_t zOrder,
|
||||||
const float left,
|
const float left,
|
||||||
const float top,
|
const float top,
|
||||||
const float right,
|
const float right,
|
||||||
@ -115,11 +115,11 @@ VideoRenderWindowsImpl::AddIncomingRenderStream(const WebRtc_UWord32 streamId,
|
|||||||
return renderCallback;
|
return renderCallback;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderWindowsImpl::DeleteIncomingRenderStream(
|
int32_t VideoRenderWindowsImpl::DeleteIncomingRenderStream(
|
||||||
const WebRtc_UWord32 streamId)
|
const uint32_t streamId)
|
||||||
{
|
{
|
||||||
CriticalSectionScoped cs(&_renderWindowsCritsect);
|
CriticalSectionScoped cs(&_renderWindowsCritsect);
|
||||||
WebRtc_Word32 error = -1;
|
int32_t error = -1;
|
||||||
if (!_ptrRendererWin)
|
if (!_ptrRendererWin)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@ -130,9 +130,9 @@ WebRtc_Word32 VideoRenderWindowsImpl::DeleteIncomingRenderStream(
|
|||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderWindowsImpl::GetIncomingRenderStreamProperties(
|
int32_t VideoRenderWindowsImpl::GetIncomingRenderStreamProperties(
|
||||||
const WebRtc_UWord32 streamId,
|
const uint32_t streamId,
|
||||||
WebRtc_UWord32& zOrder,
|
uint32_t& zOrder,
|
||||||
float& left,
|
float& left,
|
||||||
float& top,
|
float& top,
|
||||||
float& right,
|
float& right,
|
||||||
@ -145,7 +145,7 @@ WebRtc_Word32 VideoRenderWindowsImpl::GetIncomingRenderStreamProperties(
|
|||||||
right = 0;
|
right = 0;
|
||||||
bottom = 0;
|
bottom = 0;
|
||||||
|
|
||||||
WebRtc_Word32 error = -1;
|
int32_t error = -1;
|
||||||
if (!_ptrRendererWin)
|
if (!_ptrRendererWin)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@ -157,10 +157,10 @@ WebRtc_Word32 VideoRenderWindowsImpl::GetIncomingRenderStreamProperties(
|
|||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderWindowsImpl::StartRender()
|
int32_t VideoRenderWindowsImpl::StartRender()
|
||||||
{
|
{
|
||||||
CriticalSectionScoped cs(&_renderWindowsCritsect);
|
CriticalSectionScoped cs(&_renderWindowsCritsect);
|
||||||
WebRtc_Word32 error = -1;
|
int32_t error = -1;
|
||||||
if (!_ptrRendererWin)
|
if (!_ptrRendererWin)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@ -171,10 +171,10 @@ WebRtc_Word32 VideoRenderWindowsImpl::StartRender()
|
|||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderWindowsImpl::StopRender()
|
int32_t VideoRenderWindowsImpl::StopRender()
|
||||||
{
|
{
|
||||||
CriticalSectionScoped cs(&_renderWindowsCritsect);
|
CriticalSectionScoped cs(&_renderWindowsCritsect);
|
||||||
WebRtc_Word32 error = -1;
|
int32_t error = -1;
|
||||||
if (!_ptrRendererWin)
|
if (!_ptrRendererWin)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@ -209,9 +209,9 @@ bool VideoRenderWindowsImpl::FullScreen()
|
|||||||
return fullscreen;
|
return fullscreen;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderWindowsImpl::GetGraphicsMemory(
|
int32_t VideoRenderWindowsImpl::GetGraphicsMemory(
|
||||||
WebRtc_UWord64& totalGraphicsMemory,
|
uint64_t& totalGraphicsMemory,
|
||||||
WebRtc_UWord64& availableGraphicsMemory) const
|
uint64_t& availableGraphicsMemory) const
|
||||||
{
|
{
|
||||||
if (_ptrRendererWin)
|
if (_ptrRendererWin)
|
||||||
{
|
{
|
||||||
@ -224,9 +224,9 @@ WebRtc_Word32 VideoRenderWindowsImpl::GetGraphicsMemory(
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderWindowsImpl::GetScreenResolution(
|
int32_t VideoRenderWindowsImpl::GetScreenResolution(
|
||||||
WebRtc_UWord32& screenWidth,
|
uint32_t& screenWidth,
|
||||||
WebRtc_UWord32& screenHeight) const
|
uint32_t& screenHeight) const
|
||||||
{
|
{
|
||||||
CriticalSectionScoped cs(&_renderWindowsCritsect);
|
CriticalSectionScoped cs(&_renderWindowsCritsect);
|
||||||
screenWidth = 0;
|
screenWidth = 0;
|
||||||
@ -234,22 +234,22 @@ WebRtc_Word32 VideoRenderWindowsImpl::GetScreenResolution(
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_UWord32 VideoRenderWindowsImpl::RenderFrameRate(
|
uint32_t VideoRenderWindowsImpl::RenderFrameRate(
|
||||||
const WebRtc_UWord32 streamId)
|
const uint32_t streamId)
|
||||||
{
|
{
|
||||||
CriticalSectionScoped cs(&_renderWindowsCritsect);
|
CriticalSectionScoped cs(&_renderWindowsCritsect);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderWindowsImpl::SetStreamCropping(
|
int32_t VideoRenderWindowsImpl::SetStreamCropping(
|
||||||
const WebRtc_UWord32 streamId,
|
const uint32_t streamId,
|
||||||
const float left,
|
const float left,
|
||||||
const float top,
|
const float top,
|
||||||
const float right,
|
const float right,
|
||||||
const float bottom)
|
const float bottom)
|
||||||
{
|
{
|
||||||
CriticalSectionScoped cs(&_renderWindowsCritsect);
|
CriticalSectionScoped cs(&_renderWindowsCritsect);
|
||||||
WebRtc_Word32 error = -1;
|
int32_t error = -1;
|
||||||
if (!_ptrRendererWin)
|
if (!_ptrRendererWin)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@ -261,8 +261,8 @@ WebRtc_Word32 VideoRenderWindowsImpl::SetStreamCropping(
|
|||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderWindowsImpl::ConfigureRenderer(
|
int32_t VideoRenderWindowsImpl::ConfigureRenderer(
|
||||||
const WebRtc_UWord32 streamId,
|
const uint32_t streamId,
|
||||||
const unsigned int zOrder,
|
const unsigned int zOrder,
|
||||||
const float left,
|
const float left,
|
||||||
const float top,
|
const float top,
|
||||||
@ -270,7 +270,7 @@ WebRtc_Word32 VideoRenderWindowsImpl::ConfigureRenderer(
|
|||||||
const float bottom)
|
const float bottom)
|
||||||
{
|
{
|
||||||
CriticalSectionScoped cs(&_renderWindowsCritsect);
|
CriticalSectionScoped cs(&_renderWindowsCritsect);
|
||||||
WebRtc_Word32 error = -1;
|
int32_t error = -1;
|
||||||
if (!_ptrRendererWin)
|
if (!_ptrRendererWin)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@ -283,11 +283,11 @@ WebRtc_Word32 VideoRenderWindowsImpl::ConfigureRenderer(
|
|||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderWindowsImpl::SetTransparentBackground(
|
int32_t VideoRenderWindowsImpl::SetTransparentBackground(
|
||||||
const bool enable)
|
const bool enable)
|
||||||
{
|
{
|
||||||
CriticalSectionScoped cs(&_renderWindowsCritsect);
|
CriticalSectionScoped cs(&_renderWindowsCritsect);
|
||||||
WebRtc_Word32 error = -1;
|
int32_t error = -1;
|
||||||
if (!_ptrRendererWin)
|
if (!_ptrRendererWin)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@ -298,19 +298,19 @@ WebRtc_Word32 VideoRenderWindowsImpl::SetTransparentBackground(
|
|||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderWindowsImpl::SetText(
|
int32_t VideoRenderWindowsImpl::SetText(
|
||||||
const WebRtc_UWord8 textId,
|
const uint8_t textId,
|
||||||
const WebRtc_UWord8* text,
|
const uint8_t* text,
|
||||||
const WebRtc_Word32 textLength,
|
const int32_t textLength,
|
||||||
const WebRtc_UWord32 textColorRef,
|
const uint32_t textColorRef,
|
||||||
const WebRtc_UWord32 backgroundColorRef,
|
const uint32_t backgroundColorRef,
|
||||||
const float left,
|
const float left,
|
||||||
const float top,
|
const float top,
|
||||||
const float right,
|
const float right,
|
||||||
const float bottom)
|
const float bottom)
|
||||||
{
|
{
|
||||||
CriticalSectionScoped cs(&_renderWindowsCritsect);
|
CriticalSectionScoped cs(&_renderWindowsCritsect);
|
||||||
WebRtc_Word32 error = -1;
|
int32_t error = -1;
|
||||||
if (!_ptrRendererWin)
|
if (!_ptrRendererWin)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@ -323,16 +323,14 @@ WebRtc_Word32 VideoRenderWindowsImpl::SetText(
|
|||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoRenderWindowsImpl::SetBitmap(const void* bitMap,
|
int32_t VideoRenderWindowsImpl::SetBitmap(const void* bitMap,
|
||||||
const WebRtc_UWord8 pictureId,
|
const uint8_t pictureId,
|
||||||
const void* colorKey,
|
const void* colorKey,
|
||||||
const float left,
|
const float left, const float top,
|
||||||
const float top,
|
const float right, const float bottom)
|
||||||
const float right,
|
|
||||||
const float bottom)
|
|
||||||
{
|
{
|
||||||
CriticalSectionScoped cs(&_renderWindowsCritsect);
|
CriticalSectionScoped cs(&_renderWindowsCritsect);
|
||||||
WebRtc_Word32 error = -1;
|
int32_t error = -1;
|
||||||
if (!_ptrRendererWin)
|
if (!_ptrRendererWin)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -34,17 +34,17 @@ public:
|
|||||||
* Constructor/destructor
|
* Constructor/destructor
|
||||||
*/
|
*/
|
||||||
|
|
||||||
VideoRenderWindowsImpl(const WebRtc_Word32 id,
|
VideoRenderWindowsImpl(const int32_t id,
|
||||||
const VideoRenderType videoRenderType,
|
const VideoRenderType videoRenderType,
|
||||||
void* window, const bool fullscreen);
|
void* window, const bool fullscreen);
|
||||||
|
|
||||||
virtual ~VideoRenderWindowsImpl();
|
virtual ~VideoRenderWindowsImpl();
|
||||||
|
|
||||||
virtual WebRtc_Word32 Init();
|
virtual int32_t Init();
|
||||||
|
|
||||||
virtual WebRtc_Word32 ChangeUniqueId(const WebRtc_Word32 id);
|
virtual int32_t ChangeUniqueId(const int32_t id);
|
||||||
|
|
||||||
virtual WebRtc_Word32 ChangeWindow(void* window);
|
virtual int32_t ChangeWindow(void* window);
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
@ -53,17 +53,17 @@ public:
|
|||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
virtual VideoRenderCallback
|
virtual VideoRenderCallback
|
||||||
* AddIncomingRenderStream(const WebRtc_UWord32 streamId,
|
* AddIncomingRenderStream(const uint32_t streamId,
|
||||||
const WebRtc_UWord32 zOrder,
|
const uint32_t zOrder,
|
||||||
const float left, const float top,
|
const float left, const float top,
|
||||||
const float right, const float bottom);
|
const float right, const float bottom);
|
||||||
|
|
||||||
virtual WebRtc_Word32
|
virtual int32_t
|
||||||
DeleteIncomingRenderStream(const WebRtc_UWord32 streamId);
|
DeleteIncomingRenderStream(const uint32_t streamId);
|
||||||
|
|
||||||
virtual WebRtc_Word32
|
virtual int32_t
|
||||||
GetIncomingRenderStreamProperties(const WebRtc_UWord32 streamId,
|
GetIncomingRenderStreamProperties(const uint32_t streamId,
|
||||||
WebRtc_UWord32& zOrder,
|
uint32_t& zOrder,
|
||||||
float& left, float& top,
|
float& left, float& top,
|
||||||
float& right, float& bottom) const;
|
float& right, float& bottom) const;
|
||||||
|
|
||||||
@ -73,9 +73,9 @@ public:
|
|||||||
*
|
*
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
virtual WebRtc_Word32 StartRender();
|
virtual int32_t StartRender();
|
||||||
|
|
||||||
virtual WebRtc_Word32 StopRender();
|
virtual int32_t StopRender();
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
@ -89,45 +89,43 @@ public:
|
|||||||
|
|
||||||
virtual bool FullScreen();
|
virtual bool FullScreen();
|
||||||
|
|
||||||
virtual WebRtc_Word32
|
virtual int32_t
|
||||||
GetGraphicsMemory(WebRtc_UWord64& totalGraphicsMemory,
|
GetGraphicsMemory(uint64_t& totalGraphicsMemory,
|
||||||
WebRtc_UWord64& availableGraphicsMemory) const;
|
uint64_t& availableGraphicsMemory) const;
|
||||||
|
|
||||||
virtual WebRtc_Word32
|
virtual int32_t
|
||||||
GetScreenResolution(WebRtc_UWord32& screenWidth,
|
GetScreenResolution(uint32_t& screenWidth,
|
||||||
WebRtc_UWord32& screenHeight) const;
|
uint32_t& screenHeight) const;
|
||||||
|
|
||||||
virtual WebRtc_UWord32 RenderFrameRate(const WebRtc_UWord32 streamId);
|
virtual uint32_t RenderFrameRate(const uint32_t streamId);
|
||||||
|
|
||||||
virtual WebRtc_Word32 SetStreamCropping(const WebRtc_UWord32 streamId,
|
virtual int32_t SetStreamCropping(const uint32_t streamId,
|
||||||
const float left, const float top,
|
const float left, const float top,
|
||||||
const float right,
|
const float right, const float bottom);
|
||||||
const float bottom);
|
|
||||||
|
|
||||||
virtual WebRtc_Word32 ConfigureRenderer(const WebRtc_UWord32 streamId,
|
virtual int32_t ConfigureRenderer(const uint32_t streamId,
|
||||||
const unsigned int zOrder,
|
const unsigned int zOrder,
|
||||||
const float left, const float top,
|
const float left, const float top,
|
||||||
const float right,
|
const float right, const float bottom);
|
||||||
const float bottom);
|
|
||||||
|
|
||||||
virtual WebRtc_Word32 SetTransparentBackground(const bool enable);
|
virtual int32_t SetTransparentBackground(const bool enable);
|
||||||
|
|
||||||
virtual WebRtc_Word32 SetText(const WebRtc_UWord8 textId,
|
virtual int32_t SetText(const uint8_t textId,
|
||||||
const WebRtc_UWord8* text,
|
const uint8_t* text,
|
||||||
const WebRtc_Word32 textLength,
|
const int32_t textLength,
|
||||||
const WebRtc_UWord32 textColorRef,
|
const uint32_t textColorRef,
|
||||||
const WebRtc_UWord32 backgroundColorRef,
|
const uint32_t backgroundColorRef,
|
||||||
const float left, const float top,
|
const float left, const float top,
|
||||||
const float right, const float bottom);
|
const float right, const float bottom);
|
||||||
|
|
||||||
virtual WebRtc_Word32 SetBitmap(const void* bitMap,
|
virtual int32_t SetBitmap(const void* bitMap,
|
||||||
const WebRtc_UWord8 pictureId,
|
const uint8_t pictureId,
|
||||||
const void* colorKey, const float left,
|
const void* colorKey,
|
||||||
const float top, const float right,
|
const float left, const float top,
|
||||||
const float bottom);
|
const float right, const float bottom);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
WebRtc_Word32 _id;
|
int32_t _id;
|
||||||
CriticalSectionWrapper& _renderWindowsCritsect;
|
CriticalSectionWrapper& _renderWindowsCritsect;
|
||||||
|
|
||||||
void* _prtWindow;
|
void* _prtWindow;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user