diff --git a/webrtc/modules/video_render/android/video_render_android_impl.cc b/webrtc/modules/video_render/android/video_render_android_impl.cc index d6f7c5ab59..7060589ae1 100644 --- a/webrtc/modules/video_render/android/video_render_android_impl.cc +++ b/webrtc/modules/video_render/android/video_render_android_impl.cc @@ -30,7 +30,7 @@ namespace webrtc { JavaVM* VideoRenderAndroid::g_jvm = NULL; #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__); VideoRenderAndroid::g_jvm = (JavaVM*)javaVM; return 0; @@ -38,7 +38,7 @@ WebRtc_Word32 SetRenderAndroidVM(void* javaVM) { #endif VideoRenderAndroid::VideoRenderAndroid( - const WebRtc_Word32 id, + const int32_t id, const VideoRenderType videoRenderType, void* window, const bool /*fullscreen*/): @@ -71,20 +71,20 @@ VideoRenderAndroid::~VideoRenderAndroid() { delete &_critSect; } -WebRtc_Word32 VideoRenderAndroid::ChangeUniqueId(const WebRtc_Word32 id) { +int32_t VideoRenderAndroid::ChangeUniqueId(const int32_t id) { CriticalSectionScoped cs(&_critSect); _id = id; return 0; } -WebRtc_Word32 VideoRenderAndroid::ChangeWindow(void* /*window*/) { +int32_t VideoRenderAndroid::ChangeWindow(void* /*window*/) { return -1; } VideoRenderCallback* -VideoRenderAndroid::AddIncomingRenderStream(const WebRtc_UWord32 streamId, - const WebRtc_UWord32 zOrder, +VideoRenderAndroid::AddIncomingRenderStream(const uint32_t streamId, + const uint32_t zOrder, const float left, const float top, const float right, const float bottom) { @@ -114,8 +114,8 @@ VideoRenderAndroid::AddIncomingRenderStream(const WebRtc_UWord32 streamId, return renderStream; } -WebRtc_Word32 VideoRenderAndroid::DeleteIncomingRenderStream( - const WebRtc_UWord32 streamId) { +int32_t VideoRenderAndroid::DeleteIncomingRenderStream( + const uint32_t streamId) { CriticalSectionScoped cs(&_critSect); MapItem* item = _streamsMap.Find(streamId); @@ -131,9 +131,9 @@ WebRtc_Word32 VideoRenderAndroid::DeleteIncomingRenderStream( return 0; } -WebRtc_Word32 VideoRenderAndroid::GetIncomingRenderStreamProperties( - const WebRtc_UWord32 streamId, - WebRtc_UWord32& zOrder, +int32_t VideoRenderAndroid::GetIncomingRenderStreamProperties( + const uint32_t streamId, + uint32_t& zOrder, float& left, float& top, float& right, @@ -141,7 +141,7 @@ WebRtc_Word32 VideoRenderAndroid::GetIncomingRenderStreamProperties( return -1; } -WebRtc_Word32 VideoRenderAndroid::StartRender() { +int32_t VideoRenderAndroid::StartRender() { CriticalSectionScoped cs(&_critSect); if (_javaRenderThread) { @@ -174,7 +174,7 @@ WebRtc_Word32 VideoRenderAndroid::StartRender() { return 0; } -WebRtc_Word32 VideoRenderAndroid::StopRender() { +int32_t VideoRenderAndroid::StopRender() { WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, _id, "%s:", __FUNCTION__); { CriticalSectionScoped cs(&_critSect); @@ -268,31 +268,31 @@ bool VideoRenderAndroid::FullScreen() { return false; } -WebRtc_Word32 VideoRenderAndroid::GetGraphicsMemory( - WebRtc_UWord64& /*totalGraphicsMemory*/, - WebRtc_UWord64& /*availableGraphicsMemory*/) const { +int32_t VideoRenderAndroid::GetGraphicsMemory( + uint64_t& /*totalGraphicsMemory*/, + uint64_t& /*availableGraphicsMemory*/) const { WEBRTC_TRACE(kTraceError, kTraceVideoRenderer, _id, "%s - not supported on Android", __FUNCTION__); return -1; } -WebRtc_Word32 VideoRenderAndroid::GetScreenResolution( - WebRtc_UWord32& /*screenWidth*/, - WebRtc_UWord32& /*screenHeight*/) const { +int32_t VideoRenderAndroid::GetScreenResolution( + uint32_t& /*screenWidth*/, + uint32_t& /*screenHeight*/) const { WEBRTC_TRACE(kTraceError, kTraceVideoRenderer, _id, "%s - not supported on Android", __FUNCTION__); return -1; } -WebRtc_UWord32 VideoRenderAndroid::RenderFrameRate( - const WebRtc_UWord32 /*streamId*/) { +uint32_t VideoRenderAndroid::RenderFrameRate( + const uint32_t /*streamId*/) { WEBRTC_TRACE(kTraceError, kTraceVideoRenderer, _id, "%s - not supported on Android", __FUNCTION__); return -1; } -WebRtc_Word32 VideoRenderAndroid::SetStreamCropping( - const WebRtc_UWord32 /*streamId*/, +int32_t VideoRenderAndroid::SetStreamCropping( + const uint32_t /*streamId*/, const float /*left*/, const float /*top*/, const float /*right*/, @@ -302,14 +302,14 @@ WebRtc_Word32 VideoRenderAndroid::SetStreamCropping( return -1; } -WebRtc_Word32 VideoRenderAndroid::SetTransparentBackground(const bool enable) { +int32_t VideoRenderAndroid::SetTransparentBackground(const bool enable) { WEBRTC_TRACE(kTraceError, kTraceVideoRenderer, _id, "%s - not supported on Android", __FUNCTION__); return -1; } -WebRtc_Word32 VideoRenderAndroid::ConfigureRenderer( - const WebRtc_UWord32 streamId, +int32_t VideoRenderAndroid::ConfigureRenderer( + const uint32_t streamId, const unsigned int zOrder, const float left, const float top, @@ -320,12 +320,12 @@ WebRtc_Word32 VideoRenderAndroid::ConfigureRenderer( return -1; } -WebRtc_Word32 VideoRenderAndroid::SetText( - const WebRtc_UWord8 textId, - const WebRtc_UWord8* text, - const WebRtc_Word32 textLength, - const WebRtc_UWord32 textColorRef, - const WebRtc_UWord32 backgroundColorRef, +int32_t VideoRenderAndroid::SetText( + const uint8_t textId, + const uint8_t* text, + const int32_t textLength, + const uint32_t textColorRef, + const uint32_t backgroundColorRef, const float left, const float top, const float rigth, const float bottom) { WEBRTC_TRACE(kTraceError, kTraceVideoRenderer, _id, @@ -333,12 +333,12 @@ WebRtc_Word32 VideoRenderAndroid::SetText( return -1; } -WebRtc_Word32 VideoRenderAndroid::SetBitmap(const void* bitMap, - const WebRtc_UWord8 pictureId, - const void* colorKey, - const float left, const float top, - const float right, - const float bottom) { +int32_t VideoRenderAndroid::SetBitmap(const void* bitMap, + const uint8_t pictureId, + const void* colorKey, + const float left, const float top, + const float right, + const float bottom) { WEBRTC_TRACE(kTraceError, kTraceVideoRenderer, _id, "%s - not supported on Android", __FUNCTION__); return -1; diff --git a/webrtc/modules/video_render/android/video_render_android_impl.h b/webrtc/modules/video_render/android/video_render_android_impl.h index 3613f1aa4c..d8c8fe7173 100644 --- a/webrtc/modules/video_render/android/video_render_android_impl.h +++ b/webrtc/modules/video_render/android/video_render_android_impl.h @@ -38,37 +38,37 @@ class AndroidStream : public VideoRenderCallback { class VideoRenderAndroid: IVideoRender { public: - VideoRenderAndroid(const WebRtc_Word32 id, + VideoRenderAndroid(const int32_t id, const VideoRenderType videoRenderType, void* window, const bool fullscreen); 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( - const WebRtc_UWord32 streamId, - const WebRtc_UWord32 zOrder, + const uint32_t streamId, + const uint32_t zOrder, const float left, const float top, const float right, 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, - WebRtc_UWord32& zOrder, + virtual int32_t GetIncomingRenderStreamProperties( + const uint32_t streamId, + uint32_t& zOrder, float& left, float& top, float& right, float& bottom) const; - virtual WebRtc_Word32 StartRender(); + virtual int32_t StartRender(); - virtual WebRtc_Word32 StopRender(); + virtual int32_t StopRender(); virtual void ReDraw(); @@ -80,55 +80,53 @@ class VideoRenderAndroid: IVideoRender { virtual bool FullScreen(); - virtual WebRtc_Word32 GetGraphicsMemory( - WebRtc_UWord64& totalGraphicsMemory, - WebRtc_UWord64& availableGraphicsMemory) const; + virtual int32_t GetGraphicsMemory( + uint64_t& totalGraphicsMemory, + uint64_t& availableGraphicsMemory) const; - virtual WebRtc_Word32 GetScreenResolution( - WebRtc_UWord32& screenWidth, - WebRtc_UWord32& screenHeight) const; + virtual int32_t GetScreenResolution( + uint32_t& screenWidth, + 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, - const float left, const float top, - const float right, - const float bottom); + virtual int32_t SetStreamCropping(const uint32_t streamId, + const float left, const float top, + const float right, 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, - const unsigned int zOrder, - const float left, const float top, - const float right, - const float bottom); + virtual int32_t ConfigureRenderer(const uint32_t streamId, + const unsigned int zOrder, + const float left, const float top, + const float right, const float bottom); - virtual WebRtc_Word32 SetText(const WebRtc_UWord8 textId, - const WebRtc_UWord8* text, - const WebRtc_Word32 textLength, - const WebRtc_UWord32 textColorRef, - const WebRtc_UWord32 backgroundColorRef, - const float left, const float top, - const float rigth, const float bottom); + virtual int32_t SetText(const uint8_t textId, + const uint8_t* text, + const int32_t textLength, + const uint32_t textColorRef, + const uint32_t backgroundColorRef, + const float left, const float top, + const float rigth, const float bottom); - virtual WebRtc_Word32 SetBitmap(const void* bitMap, - const WebRtc_UWord8 pictureId, - const void* colorKey, const float left, - const float top, const float right, - const float bottom); + virtual int32_t SetBitmap(const void* bitMap, + const uint8_t pictureId, + const void* colorKey, const float left, + const float top, const float right, + const float bottom); static JavaVM* g_jvm; protected: virtual AndroidStream* CreateAndroidRenderChannel( - WebRtc_Word32 streamId, - WebRtc_Word32 zOrder, + int32_t streamId, + int32_t zOrder, const float left, const float top, const float right, const float bottom, VideoRenderAndroid& renderer) = 0; - WebRtc_Word32 _id; + int32_t _id; CriticalSectionWrapper& _critSect; VideoRenderType _renderType; jobject _ptrWindow; @@ -143,7 +141,7 @@ class VideoRenderAndroid: IVideoRender { bool _javaShutDownFlag; EventWrapper& _javaShutdownEvent; EventWrapper& _javaRenderEvent; - WebRtc_Word64 _lastJavaRenderEvent; + int64_t _lastJavaRenderEvent; JNIEnv* _javaRenderJniEnv; // JNIEnv for the java render thread. ThreadWrapper* _javaRenderThread; }; diff --git a/webrtc/modules/video_render/android/video_render_android_native_opengl2.cc b/webrtc/modules/video_render/android/video_render_android_native_opengl2.cc index bfea5e0c2b..088b0b3fd6 100644 --- a/webrtc/modules/video_render/android/video_render_android_native_opengl2.cc +++ b/webrtc/modules/video_render/android/video_render_android_native_opengl2.cc @@ -25,7 +25,7 @@ namespace webrtc { AndroidNativeOpenGl2Renderer::AndroidNativeOpenGl2Renderer( - const WebRtc_Word32 id, + const int32_t id, const VideoRenderType videoRenderType, void* window, const bool fullscreen) : @@ -129,7 +129,7 @@ AndroidNativeOpenGl2Renderer::~AndroidNativeOpenGl2Renderer() { } } -WebRtc_Word32 AndroidNativeOpenGl2Renderer::Init() { +int32_t AndroidNativeOpenGl2Renderer::Init() { WEBRTC_TRACE(kTraceDebug, kTraceVideoRenderer, _id, "%s", __FUNCTION__); if (!g_jvm) { WEBRTC_TRACE(kTraceError, kTraceVideoRenderer, _id, @@ -211,8 +211,8 @@ WebRtc_Word32 AndroidNativeOpenGl2Renderer::Init() { } AndroidStream* AndroidNativeOpenGl2Renderer::CreateAndroidRenderChannel( - WebRtc_Word32 streamId, - WebRtc_Word32 zOrder, + int32_t streamId, + int32_t zOrder, const float left, const float top, const float right, @@ -232,7 +232,7 @@ AndroidNativeOpenGl2Renderer::CreateAndroidRenderChannel( } AndroidNativeOpenGl2Channel::AndroidNativeOpenGl2Channel( - WebRtc_UWord32 streamId, + uint32_t streamId, JavaVM* jvm, VideoRenderAndroid& renderer,jobject javaRenderObj): _id(streamId), @@ -279,11 +279,11 @@ AndroidNativeOpenGl2Channel::~AndroidNativeOpenGl2Channel() { } } -WebRtc_Word32 AndroidNativeOpenGl2Channel::Init(WebRtc_Word32 zOrder, - const float left, - const float top, - const float right, - const float bottom) +int32_t AndroidNativeOpenGl2Channel::Init(int32_t zOrder, + const float left, + const float top, + const float right, + const float bottom) { WEBRTC_TRACE(kTraceDebug, kTraceVideoRenderer, _id, "%s: AndroidNativeOpenGl2Channel", __FUNCTION__); @@ -380,8 +380,8 @@ WebRtc_Word32 AndroidNativeOpenGl2Channel::Init(WebRtc_Word32 zOrder, return 0; } -WebRtc_Word32 AndroidNativeOpenGl2Channel::RenderFrame( - const WebRtc_UWord32 /*streamId*/, +int32_t AndroidNativeOpenGl2Channel::RenderFrame( + const uint32_t /*streamId*/, I420VideoFrame& videoFrame) { // WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer,_id, "%s:" ,__FUNCTION__); _renderCritSect.Enter(); diff --git a/webrtc/modules/video_render/android/video_render_android_native_opengl2.h b/webrtc/modules/video_render/android/video_render_android_native_opengl2.h index b8fd3370a0..16a5c62f71 100644 --- a/webrtc/modules/video_render/android/video_render_android_native_opengl2.h +++ b/webrtc/modules/video_render/android/video_render_android_native_opengl2.h @@ -24,20 +24,17 @@ class CriticalSectionWrapper; class AndroidNativeOpenGl2Channel: public AndroidStream { public: AndroidNativeOpenGl2Channel( - WebRtc_UWord32 streamId, + uint32_t streamId, JavaVM* jvm, VideoRenderAndroid& renderer,jobject javaRenderObj); ~AndroidNativeOpenGl2Channel(); - WebRtc_Word32 Init(WebRtc_Word32 zOrder, - const float left, - const float top, - const float right, - const float bottom); + int32_t Init(int32_t zOrder, const float left, const float top, + const float right, const float bottom); //Implement VideoRenderCallback - virtual WebRtc_Word32 RenderFrame( - const WebRtc_UWord32 streamId, + virtual int32_t RenderFrame( + const uint32_t streamId, I420VideoFrame& videoFrame); //Implements AndroidStream @@ -54,7 +51,7 @@ class AndroidNativeOpenGl2Channel: public AndroidStream { static void DrawNativeStatic(JNIEnv * env,jobject, jlong context); void DrawNative(); - WebRtc_UWord32 _id; + uint32_t _id; CriticalSectionWrapper& _renderCritSect; I420VideoFrame _bufferToRender; @@ -71,7 +68,7 @@ class AndroidNativeOpenGl2Channel: public AndroidStream { class AndroidNativeOpenGl2Renderer: private VideoRenderAndroid { public: - AndroidNativeOpenGl2Renderer(const WebRtc_Word32 id, + AndroidNativeOpenGl2Renderer(const int32_t id, const VideoRenderType videoRenderType, void* window, const bool fullscreen); @@ -79,10 +76,10 @@ class AndroidNativeOpenGl2Renderer: private VideoRenderAndroid { ~AndroidNativeOpenGl2Renderer(); static bool UseOpenGL2(void* window); - WebRtc_Word32 Init(); + int32_t Init(); virtual AndroidStream* CreateAndroidRenderChannel( - WebRtc_Word32 streamId, - WebRtc_Word32 zOrder, + int32_t streamId, + int32_t zOrder, const float left, const float top, const float right, diff --git a/webrtc/modules/video_render/android/video_render_android_surface_view.cc b/webrtc/modules/video_render/android/video_render_android_surface_view.cc index 15533497bc..b33fd88af9 100644 --- a/webrtc/modules/video_render/android/video_render_android_surface_view.cc +++ b/webrtc/modules/video_render/android/video_render_android_surface_view.cc @@ -26,7 +26,7 @@ namespace webrtc { AndroidSurfaceViewRenderer::AndroidSurfaceViewRenderer( - const WebRtc_Word32 id, + const int32_t id, const VideoRenderType videoRenderType, void* window, const bool fullscreen) : @@ -77,7 +77,7 @@ AndroidSurfaceViewRenderer::~AndroidSurfaceViewRenderer() { } } -WebRtc_Word32 AndroidSurfaceViewRenderer::Init() { +int32_t AndroidSurfaceViewRenderer::Init() { WEBRTC_TRACE(kTraceDebug, kTraceVideoRenderer, _id, "%s", __FUNCTION__); if (!g_jvm) { WEBRTC_TRACE(kTraceError, @@ -200,8 +200,8 @@ WebRtc_Word32 AndroidSurfaceViewRenderer::Init() { AndroidStream* AndroidSurfaceViewRenderer::CreateAndroidRenderChannel( - WebRtc_Word32 streamId, - WebRtc_Word32 zOrder, + int32_t streamId, + int32_t zOrder, const float left, const float top, const float right, @@ -223,7 +223,7 @@ AndroidSurfaceViewRenderer::CreateAndroidRenderChannel( } AndroidSurfaceViewChannel::AndroidSurfaceViewChannel( - WebRtc_UWord32 streamId, + uint32_t streamId, JavaVM* jvm, VideoRenderAndroid& renderer, jobject javaRenderObj) : @@ -284,8 +284,8 @@ AndroidSurfaceViewChannel::~AndroidSurfaceViewChannel() { } } -WebRtc_Word32 AndroidSurfaceViewChannel::Init( - WebRtc_Word32 /*zOrder*/, +int32_t AndroidSurfaceViewChannel::Init( + int32_t /*zOrder*/, const float left, const float top, const float right, @@ -410,8 +410,8 @@ WebRtc_Word32 AndroidSurfaceViewChannel::Init( } -WebRtc_Word32 AndroidSurfaceViewChannel::RenderFrame( - const WebRtc_UWord32 /*streamId*/, +int32_t AndroidSurfaceViewChannel::RenderFrame( + const uint32_t /*streamId*/, I420VideoFrame& videoFrame) { // WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer,_id, "%s:" ,__FUNCTION__); _renderCritSect.Enter(); diff --git a/webrtc/modules/video_render/android/video_render_android_surface_view.h b/webrtc/modules/video_render/android/video_render_android_surface_view.h index 8283794dcf..898abc84b9 100644 --- a/webrtc/modules/video_render/android/video_render_android_surface_view.h +++ b/webrtc/modules/video_render/android/video_render_android_surface_view.h @@ -22,27 +22,24 @@ class CriticalSectionWrapper; class AndroidSurfaceViewChannel : public AndroidStream { public: - AndroidSurfaceViewChannel(WebRtc_UWord32 streamId, + AndroidSurfaceViewChannel(uint32_t streamId, JavaVM* jvm, VideoRenderAndroid& renderer, jobject javaRenderObj); ~AndroidSurfaceViewChannel(); - WebRtc_Word32 Init(WebRtc_Word32 zOrder, - const float left, - const float top, - const float right, - const float bottom); + int32_t Init(int32_t zOrder, const float left, const float top, + const float right, const float bottom); //Implement VideoRenderCallback - virtual WebRtc_Word32 RenderFrame(const WebRtc_UWord32 streamId, - I420VideoFrame& videoFrame); + virtual int32_t RenderFrame(const uint32_t streamId, + I420VideoFrame& videoFrame); //Implements AndroidStream virtual void DeliverFrame(JNIEnv* jniEnv); private: - WebRtc_UWord32 _id; + uint32_t _id; CriticalSectionWrapper& _renderCritSect; I420VideoFrame _bufferToRender; @@ -62,15 +59,15 @@ class AndroidSurfaceViewChannel : public AndroidStream { class AndroidSurfaceViewRenderer : private VideoRenderAndroid { public: - AndroidSurfaceViewRenderer(const WebRtc_Word32 id, + AndroidSurfaceViewRenderer(const int32_t id, const VideoRenderType videoRenderType, void* window, const bool fullscreen); ~AndroidSurfaceViewRenderer(); - WebRtc_Word32 Init(); + int32_t Init(); virtual AndroidStream* CreateAndroidRenderChannel( - WebRtc_Word32 streamId, - WebRtc_Word32 zOrder, + int32_t streamId, + int32_t zOrder, const float left, const float top, const float right, diff --git a/webrtc/modules/video_render/android/video_render_opengles20.cc b/webrtc/modules/video_render/android/video_render_opengles20.cc index 3f16030c4c..2255005620 100644 --- a/webrtc/modules/video_render/android/video_render_opengles20.cc +++ b/webrtc/modules/video_render/android/video_render_opengles20.cc @@ -68,7 +68,7 @@ const char VideoRenderOpenGles20::g_fragmentShader[] = { " gl_FragColor=vec4(r,g,b,1.0);\n" "}\n" }; -VideoRenderOpenGles20::VideoRenderOpenGles20(WebRtc_Word32 id) : +VideoRenderOpenGles20::VideoRenderOpenGles20(int32_t id) : _id(id), _textureWidth(-1), _textureHeight(-1) { @@ -88,8 +88,7 @@ VideoRenderOpenGles20::VideoRenderOpenGles20(WebRtc_Word32 id) : VideoRenderOpenGles20::~VideoRenderOpenGles20() { } -WebRtc_Word32 VideoRenderOpenGles20::Setup(WebRtc_Word32 width, - WebRtc_Word32 height) { +int32_t VideoRenderOpenGles20::Setup(int32_t width, int32_t height) { WEBRTC_TRACE(kTraceDebug, kTraceVideoRenderer, _id, "%s: width %d, height %d", __FUNCTION__, (int) width, (int) height); @@ -174,11 +173,11 @@ WebRtc_Word32 VideoRenderOpenGles20::Setup(WebRtc_Word32 width, // SetCoordinates // Sets the coordinates where the stream shall be rendered. // Values must be between 0 and 1. -WebRtc_Word32 VideoRenderOpenGles20::SetCoordinates(WebRtc_Word32 zOrder, - const float left, - const float top, - const float right, - const float bottom) { +int32_t VideoRenderOpenGles20::SetCoordinates(int32_t zOrder, + const float left, + const float top, + const float right, + const float bottom) { if ((top > 1 || top < 0) || (right > 1 || right < 0) || (bottom > 1 || bottom < 0) || (left > 1 || left < 0)) { WEBRTC_TRACE(kTraceError, kTraceVideoRenderer, _id, @@ -215,8 +214,7 @@ WebRtc_Word32 VideoRenderOpenGles20::SetCoordinates(WebRtc_Word32 zOrder, return 0; } -WebRtc_Word32 VideoRenderOpenGles20::Render(const I420VideoFrame& - frameToRender) { +int32_t VideoRenderOpenGles20::Render(const I420VideoFrame& frameToRender) { if (frameToRender.IsZeroSize()) { 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_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, 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_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, GL_LUMINANCE, GL_UNSIGNED_BYTE, (const GLvoid*) vComponent); checkGlError("SetupTextures"); diff --git a/webrtc/modules/video_render/android/video_render_opengles20.h b/webrtc/modules/video_render/android/video_render_opengles20.h index bf9deb013c..9553d4dfa1 100644 --- a/webrtc/modules/video_render/android/video_render_opengles20.h +++ b/webrtc/modules/video_render/android/video_render_opengles20.h @@ -21,16 +21,13 @@ namespace webrtc class VideoRenderOpenGles20 { public: - VideoRenderOpenGles20(WebRtc_Word32 id); + VideoRenderOpenGles20(int32_t id); ~VideoRenderOpenGles20(); - WebRtc_Word32 Setup(WebRtc_Word32 widht, WebRtc_Word32 height); - WebRtc_Word32 Render(const I420VideoFrame& frameToRender); - WebRtc_Word32 SetCoordinates(WebRtc_Word32 zOrder, - const float left, - const float top, - const float right, - const float bottom); + int32_t Setup(int32_t widht, int32_t height); + int32_t Render(const I420VideoFrame& frameToRender); + int32_t SetCoordinates(int32_t zOrder, const float left, const float top, + const float right, const float bottom); private: void printGLString(const char *name, GLenum s); @@ -41,7 +38,7 @@ class VideoRenderOpenGles20 { void SetupTextures(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 _program; GLuint _vPositionHandle; diff --git a/webrtc/modules/video_render/external/video_render_external_impl.cc b/webrtc/modules/video_render/external/video_render_external_impl.cc index 59eb065d18..a0ef3f4bae 100644 --- a/webrtc/modules/video_render/external/video_render_external_impl.cc +++ b/webrtc/modules/video_render/external/video_render_external_impl.cc @@ -13,7 +13,7 @@ namespace webrtc { VideoRenderExternalImpl::VideoRenderExternalImpl( - const WebRtc_Word32 id, + const int32_t id, const VideoRenderType videoRenderType, void* window, const bool fullscreen) : @@ -27,27 +27,27 @@ VideoRenderExternalImpl::~VideoRenderExternalImpl() delete &_critSect; } -WebRtc_Word32 VideoRenderExternalImpl::Init() +int32_t VideoRenderExternalImpl::Init() { return 0; } -WebRtc_Word32 VideoRenderExternalImpl::ChangeUniqueId(const WebRtc_Word32 id) +int32_t VideoRenderExternalImpl::ChangeUniqueId(const int32_t id) { CriticalSectionScoped cs(&_critSect); _id = id; return 0; } -WebRtc_Word32 VideoRenderExternalImpl::ChangeWindow(void* window) +int32_t VideoRenderExternalImpl::ChangeWindow(void* window) { CriticalSectionScoped cs(&_critSect); return 0; } VideoRenderCallback* -VideoRenderExternalImpl::AddIncomingRenderStream(const WebRtc_UWord32 streamId, - const WebRtc_UWord32 zOrder, +VideoRenderExternalImpl::AddIncomingRenderStream(const uint32_t streamId, + const uint32_t zOrder, const float left, const float top, const float right, @@ -57,16 +57,16 @@ VideoRenderExternalImpl::AddIncomingRenderStream(const WebRtc_UWord32 streamId, return this; } -WebRtc_Word32 VideoRenderExternalImpl::DeleteIncomingRenderStream( - const WebRtc_UWord32 streamId) +int32_t VideoRenderExternalImpl::DeleteIncomingRenderStream( + const uint32_t streamId) { CriticalSectionScoped cs(&_critSect); return 0; } -WebRtc_Word32 VideoRenderExternalImpl::GetIncomingRenderStreamProperties( - const WebRtc_UWord32 streamId, - WebRtc_UWord32& zOrder, +int32_t VideoRenderExternalImpl::GetIncomingRenderStreamProperties( + const uint32_t streamId, + uint32_t& zOrder, float& left, float& top, float& right, @@ -83,13 +83,13 @@ WebRtc_Word32 VideoRenderExternalImpl::GetIncomingRenderStreamProperties( return 0; } -WebRtc_Word32 VideoRenderExternalImpl::StartRender() +int32_t VideoRenderExternalImpl::StartRender() { CriticalSectionScoped cs(&_critSect); return 0; } -WebRtc_Word32 VideoRenderExternalImpl::StopRender() +int32_t VideoRenderExternalImpl::StopRender() { CriticalSectionScoped cs(&_critSect); return 0; @@ -111,18 +111,18 @@ bool VideoRenderExternalImpl::FullScreen() return _fullscreen; } -WebRtc_Word32 VideoRenderExternalImpl::GetGraphicsMemory( - WebRtc_UWord64& totalGraphicsMemory, - WebRtc_UWord64& availableGraphicsMemory) const +int32_t VideoRenderExternalImpl::GetGraphicsMemory( + uint64_t& totalGraphicsMemory, + uint64_t& availableGraphicsMemory) const { totalGraphicsMemory = 0; availableGraphicsMemory = 0; return -1; } -WebRtc_Word32 VideoRenderExternalImpl::GetScreenResolution( - WebRtc_UWord32& screenWidth, - WebRtc_UWord32& screenHeight) const +int32_t VideoRenderExternalImpl::GetScreenResolution( + uint32_t& screenWidth, + uint32_t& screenHeight) const { CriticalSectionScoped cs(&_critSect); screenWidth = 0; @@ -130,15 +130,15 @@ WebRtc_Word32 VideoRenderExternalImpl::GetScreenResolution( return 0; } -WebRtc_UWord32 VideoRenderExternalImpl::RenderFrameRate( - const WebRtc_UWord32 streamId) +uint32_t VideoRenderExternalImpl::RenderFrameRate( + const uint32_t streamId) { CriticalSectionScoped cs(&_critSect); return 0; } -WebRtc_Word32 VideoRenderExternalImpl::SetStreamCropping( - const WebRtc_UWord32 streamId, +int32_t VideoRenderExternalImpl::SetStreamCropping( + const uint32_t streamId, const float left, const float top, const float right, @@ -148,8 +148,8 @@ WebRtc_Word32 VideoRenderExternalImpl::SetStreamCropping( return 0; } -WebRtc_Word32 VideoRenderExternalImpl::ConfigureRenderer( - const WebRtc_UWord32 streamId, +int32_t VideoRenderExternalImpl::ConfigureRenderer( + const uint32_t streamId, const unsigned int zOrder, const float left, const float top, @@ -160,19 +160,19 @@ WebRtc_Word32 VideoRenderExternalImpl::ConfigureRenderer( return 0; } -WebRtc_Word32 VideoRenderExternalImpl::SetTransparentBackground( +int32_t VideoRenderExternalImpl::SetTransparentBackground( const bool enable) { CriticalSectionScoped cs(&_critSect); return 0; } -WebRtc_Word32 VideoRenderExternalImpl::SetText( - const WebRtc_UWord8 textId, - const WebRtc_UWord8* text, - const WebRtc_Word32 textLength, - const WebRtc_UWord32 textColorRef, - const WebRtc_UWord32 backgroundColorRef, +int32_t VideoRenderExternalImpl::SetText( + const uint8_t textId, + const uint8_t* text, + const int32_t textLength, + const uint32_t textColorRef, + const uint32_t backgroundColorRef, const float left, const float top, const float right, @@ -182,21 +182,21 @@ WebRtc_Word32 VideoRenderExternalImpl::SetText( return 0; } -WebRtc_Word32 VideoRenderExternalImpl::SetBitmap(const void* bitMap, - const WebRtc_UWord8 pictureId, - const void* colorKey, - const float left, - const float top, - const float right, - const float bottom) +int32_t VideoRenderExternalImpl::SetBitmap(const void* bitMap, + const uint8_t pictureId, + const void* colorKey, + const float left, + const float top, + const float right, + const float bottom) { CriticalSectionScoped cs(&_critSect); return 0; } // VideoRenderCallback -WebRtc_Word32 VideoRenderExternalImpl::RenderFrame( - const WebRtc_UWord32 streamId, +int32_t VideoRenderExternalImpl::RenderFrame( + const uint32_t streamId, I420VideoFrame& videoFrame) { return 0; diff --git a/webrtc/modules/video_render/external/video_render_external_impl.h b/webrtc/modules/video_render/external/video_render_external_impl.h index 747f9de4a3..3a5472b7be 100644 --- a/webrtc/modules/video_render/external/video_render_external_impl.h +++ b/webrtc/modules/video_render/external/video_render_external_impl.h @@ -25,17 +25,17 @@ public: * Constructor/destructor */ - VideoRenderExternalImpl(const WebRtc_Word32 id, + VideoRenderExternalImpl(const int32_t id, const VideoRenderType videoRenderType, void* window, const bool fullscreen); 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 - * AddIncomingRenderStream(const WebRtc_UWord32 streamId, - const WebRtc_UWord32 zOrder, + * AddIncomingRenderStream(const uint32_t streamId, + const uint32_t zOrder, const float left, const float top, const float right, 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, - WebRtc_UWord32& zOrder, + virtual int32_t + GetIncomingRenderStreamProperties(const uint32_t streamId, + uint32_t& zOrder, float& left, float& top, 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 WebRtc_Word32 - GetGraphicsMemory(WebRtc_UWord64& totalGraphicsMemory, - WebRtc_UWord64& availableGraphicsMemory) const; + virtual int32_t + GetGraphicsMemory(uint64_t& totalGraphicsMemory, + uint64_t& availableGraphicsMemory) const; - virtual WebRtc_Word32 - GetScreenResolution(WebRtc_UWord32& screenWidth, - WebRtc_UWord32& screenHeight) const; + virtual int32_t + GetScreenResolution(uint32_t& screenWidth, + 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, - const float left, const float top, - const float right, - const float bottom); + virtual int32_t SetStreamCropping(const uint32_t streamId, + const float left, const float top, + const float right, const float bottom); - virtual WebRtc_Word32 ConfigureRenderer(const WebRtc_UWord32 streamId, - const unsigned int zOrder, - const float left, const float top, - const float right, - const float bottom); + virtual int32_t ConfigureRenderer(const uint32_t streamId, + const unsigned int zOrder, + const float left, const float top, + const float right, 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, - const WebRtc_UWord8* text, - const WebRtc_Word32 textLength, - const WebRtc_UWord32 textColorRef, - const WebRtc_UWord32 backgroundColorRef, - const float left, const float top, - const float right, const float bottom); + virtual int32_t SetText(const uint8_t textId, + const uint8_t* text, + const int32_t textLength, + const uint32_t textColorRef, + const uint32_t backgroundColorRef, + const float left, const float top, + const float right, const float bottom); - virtual WebRtc_Word32 SetBitmap(const void* bitMap, - const WebRtc_UWord8 pictureId, - const void* colorKey, const float left, - const float top, const float right, - const float bottom); + virtual int32_t SetBitmap(const void* bitMap, + const uint8_t pictureId, + const void* colorKey, const float left, + const float top, const float right, + const float bottom); // VideoRenderCallback - virtual WebRtc_Word32 RenderFrame(const WebRtc_UWord32 streamId, - I420VideoFrame& videoFrame); + virtual int32_t RenderFrame(const uint32_t streamId, + I420VideoFrame& videoFrame); private: - WebRtc_Word32 _id; + int32_t _id; CriticalSectionWrapper& _critSect; bool _fullscreen; }; diff --git a/webrtc/modules/video_render/i_video_render.h b/webrtc/modules/video_render/i_video_render.h index 2799a79e37..da3ade5a15 100644 --- a/webrtc/modules/video_render/i_video_render.h +++ b/webrtc/modules/video_render/i_video_render.h @@ -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 - * AddIncomingRenderStream(const WebRtc_UWord32 streamId, - const WebRtc_UWord32 zOrder, + * AddIncomingRenderStream(const uint32_t streamId, + const uint32_t zOrder, const float left, const float top, const float right, const float bottom) = 0; - virtual WebRtc_Word32 - DeleteIncomingRenderStream(const WebRtc_UWord32 streamId) = 0; + virtual int32_t + DeleteIncomingRenderStream(const uint32_t streamId) = 0; - virtual WebRtc_Word32 - GetIncomingRenderStreamProperties(const WebRtc_UWord32 streamId, - WebRtc_UWord32& zOrder, + virtual int32_t + GetIncomingRenderStreamProperties(const uint32_t streamId, + uint32_t& zOrder, float& left, float& top, float& right, float& bottom) const = 0; // Implemented in common code? - //virtual WebRtc_UWord32 GetNumIncomingRenderStreams() const = 0; - //virtual bool HasIncomingRenderStream(const WebRtc_UWord16 stramId) const = 0; + //virtual uint32_t GetNumIncomingRenderStreams() 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; // TODO: This should be treated in platform specific code only - virtual WebRtc_Word32 - GetGraphicsMemory(WebRtc_UWord64& totalGraphicsMemory, - WebRtc_UWord64& availableGraphicsMemory) const = 0; + virtual int32_t + GetGraphicsMemory(uint64_t& totalGraphicsMemory, + uint64_t& availableGraphicsMemory) const = 0; - virtual WebRtc_Word32 - GetScreenResolution(WebRtc_UWord32& screenWidth, - WebRtc_UWord32& screenHeight) const = 0; + virtual int32_t + GetScreenResolution(uint32_t& screenWidth, + 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, - const float left, - const float top, - const float right, - const float bottom) = 0; + virtual int32_t SetStreamCropping(const uint32_t streamId, + const float left, + const float top, + const float right, + const float bottom) = 0; - virtual WebRtc_Word32 ConfigureRenderer(const WebRtc_UWord32 streamId, - const unsigned int zOrder, - const float left, - const float top, - const float right, - const float bottom) = 0; + virtual int32_t ConfigureRenderer(const uint32_t 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 SetTransparentBackground(const bool enable) = 0; - virtual WebRtc_Word32 SetText(const WebRtc_UWord8 textId, - const WebRtc_UWord8* text, - const WebRtc_Word32 textLength, - const WebRtc_UWord32 textColorRef, - const WebRtc_UWord32 backgroundColorRef, - const float left, - const float top, - const float rigth, - const float bottom) = 0; + virtual int32_t SetText(const uint8_t textId, + const uint8_t* text, + const int32_t textLength, + const uint32_t textColorRef, + const uint32_t backgroundColorRef, + const float left, + const float top, + const float rigth, + const float bottom) = 0; - virtual WebRtc_Word32 SetBitmap(const void* bitMap, - const WebRtc_UWord8 pictureId, - const void* colorKey, - const float left, - const float top, - const float right, - const float bottom) = 0; + virtual int32_t SetBitmap(const void* bitMap, + const uint8_t pictureId, + const void* colorKey, + const float left, + const float top, + const float right, + const float bottom) = 0; }; } //namespace webrtc diff --git a/webrtc/modules/video_render/include/video_render.h b/webrtc/modules/video_render/include/video_render.h index e4b609638f..725cbba093 100644 --- a/webrtc/modules/video_render/include/video_render.h +++ b/webrtc/modules/video_render/include/video_render.h @@ -26,7 +26,7 @@ namespace webrtc { #if defined(WEBRTC_ANDROID) && !defined(WEBRTC_CHROMIUM_BUILD) -WebRtc_Word32 SetRenderAndroidVM(void* javaVM); +int32_t SetRenderAndroidVM(void* javaVM); #endif // Class definitions @@ -43,7 +43,7 @@ public: */ static VideoRender * CreateVideoRender( - const WebRtc_Word32 id, + const int32_t id, void* window, const bool fullscreen, const VideoRenderType videoRenderType = @@ -61,10 +61,10 @@ public: * * 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 WebRtc_Word32 Process() = 0; + virtual int32_t TimeUntilNextProcess() = 0; + virtual int32_t Process() = 0; /************************************************************************** * @@ -82,7 +82,7 @@ public: * * 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. */ virtual VideoRenderCallback - * AddIncomingRenderStream(const WebRtc_UWord32 streamId, - const WebRtc_UWord32 zOrder, + * AddIncomingRenderStream(const uint32_t streamId, + const uint32_t zOrder, const float left, const float top, const float right, const float bottom) = 0; /* @@ -112,8 +112,8 @@ public: * * streamID - id of the stream to add */ - virtual WebRtc_Word32 - DeleteIncomingRenderStream(const WebRtc_UWord32 streamId) = 0; + virtual int32_t + DeleteIncomingRenderStream(const uint32_t streamId) = 0; /* * Add incoming render callback, used for external rendering @@ -123,8 +123,8 @@ public: * * Return - callback class to use for delivering new frames to render. */ - virtual WebRtc_Word32 - AddExternalRenderCallback(const WebRtc_UWord32 streamId, + virtual int32_t + AddExternalRenderCallback(const uint32_t streamId, VideoRenderCallback* renderObject) = 0; /* @@ -137,41 +137,41 @@ public: * 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] */ - virtual WebRtc_Word32 - GetIncomingRenderStreamProperties(const WebRtc_UWord32 streamId, - WebRtc_UWord32& zOrder, + virtual int32_t + GetIncomingRenderStreamProperties(const uint32_t streamId, + uint32_t& zOrder, float& left, float& top, float& right, float& bottom) const = 0; /* * The incoming frame rate to the module, not the rate rendered in the window. */ - virtual WebRtc_UWord32 - GetIncomingFrameRate(const WebRtc_UWord32 streamId) = 0; + virtual uint32_t + GetIncomingFrameRate(const uint32_t streamId) = 0; /* * 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. */ 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 * to the renderer. To be used for external rendering. */ - virtual WebRtc_Word32 - RegisterRawFrameCallback(const WebRtc_UWord32 streamId, + virtual int32_t + RegisterRawFrameCallback(const uint32_t streamId, VideoRenderCallback* callbackObj) = 0; /* * This method is usefull to get last rendered frame for the stream specified */ - virtual WebRtc_Word32 - GetLastRenderedFrame(const WebRtc_UWord32 streamId, + virtual int32_t + GetLastRenderedFrame(const uint32_t streamId, I420VideoFrame &frame) const = 0; /************************************************************************** @@ -183,18 +183,18 @@ public: /* * 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 */ - virtual WebRtc_Word32 StopRender(const WebRtc_UWord32 streamId) = 0; + virtual int32_t StopRender(const uint32_t streamId) = 0; /* * Resets the renderer * 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 */ - virtual WebRtc_Word32 - GetScreenResolution(WebRtc_UWord32& screenWidth, - WebRtc_UWord32& screenHeight) const = 0; + virtual int32_t + GetScreenResolution(uint32_t& screenWidth, + uint32_t& screenHeight) const = 0; /* * Get the actual render rate for this stream. I.e rendered frame rate, * 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 */ - virtual WebRtc_Word32 SetStreamCropping(const WebRtc_UWord32 streamId, - const float left, const float top, - const float right, - const float bottom) = 0; + virtual int32_t SetStreamCropping(const uint32_t streamId, + const float left, + const float top, + const float right, + const float bottom) = 0; /* * re-configure renderer @@ -240,51 +241,52 @@ public: // 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 // time in the video frame. - virtual WebRtc_Word32 SetExpectedRenderDelay(WebRtc_UWord32 stream_id, - WebRtc_Word32 delay_ms) = 0; + virtual int32_t SetExpectedRenderDelay(uint32_t stream_id, + int32_t delay_ms) = 0; - virtual WebRtc_Word32 ConfigureRenderer(const WebRtc_UWord32 streamId, - const unsigned int zOrder, - const float left, const float top, - const float right, - const float bottom) = 0; + virtual int32_t ConfigureRenderer(const uint32_t 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 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, - const WebRtc_UWord8 pictureId, - const void* colorKey, const float left, - const float top, const float right, - const float bottom) = 0; + virtual int32_t SetBitmap(const void* bitMap, + const uint8_t pictureId, + const void* colorKey, + const float left, const float top, + const float right, const float bottom) = 0; - virtual WebRtc_Word32 SetText(const WebRtc_UWord8 textId, - const WebRtc_UWord8* text, - const WebRtc_Word32 textLength, - const WebRtc_UWord32 textColorRef, - const WebRtc_UWord32 backgroundColorRef, - const float left, const float top, - const float right, const float bottom) = 0; + virtual int32_t SetText(const uint8_t textId, + const uint8_t* text, + const int32_t textLength, + const uint32_t textColorRef, + const uint32_t backgroundColorRef, + const float left, const float top, + const float right, const float bottom) = 0; /* * Set a start image. The image is rendered before the first image has been delivered */ - virtual WebRtc_Word32 - SetStartImage(const WebRtc_UWord32 streamId, + virtual int32_t + SetStartImage(const uint32_t streamId, const I420VideoFrame& videoFrame) = 0; /* * Set a timout image. The image is rendered if no videoframe has been delivered */ - virtual WebRtc_Word32 SetTimeoutImage(const WebRtc_UWord32 streamId, - const I420VideoFrame& videoFrame, - const WebRtc_UWord32 timeout)= 0; + virtual int32_t SetTimeoutImage(const uint32_t streamId, + const I420VideoFrame& videoFrame, + const uint32_t timeout)= 0; - virtual WebRtc_Word32 MirrorRenderStream(const int renderId, - const bool enable, - const bool mirrorXAxis, - const bool mirrorYAxis) = 0; + virtual int32_t MirrorRenderStream(const int renderId, + const bool enable, + const bool mirrorXAxis, + const bool mirrorYAxis) = 0; }; } //namespace webrtc #endif // WEBRTC_MODULES_VIDEO_RENDER_MAIN_INTERFACE_VIDEO_RENDER_H_ diff --git a/webrtc/modules/video_render/include/video_render_defines.h b/webrtc/modules/video_render/include/video_render_defines.h index dbfd88e407..992b821f24 100644 --- a/webrtc/modules/video_render/include/video_render_defines.h +++ b/webrtc/modules/video_render/include/video_render_defines.h @@ -48,8 +48,8 @@ enum VideoRenderError class VideoRenderCallback { public: - virtual WebRtc_Word32 RenderFrame(const WebRtc_UWord32 streamId, - I420VideoFrame& videoFrame) = 0; + virtual int32_t RenderFrame(const uint32_t streamId, + I420VideoFrame& videoFrame) = 0; protected: virtual ~VideoRenderCallback() @@ -61,7 +61,7 @@ protected: class VideoRenderFeedback { public: - virtual void OnRenderError(const WebRtc_Word32 streamId, + virtual void OnRenderError(const int32_t streamId, const VideoRenderError error) = 0; protected: diff --git a/webrtc/modules/video_render/incoming_video_stream.cc b/webrtc/modules/video_render/incoming_video_stream.cc index ffeb9e8c1c..6d2d2c2bc3 100644 --- a/webrtc/modules/video_render/incoming_video_stream.cc +++ b/webrtc/modules/video_render/incoming_video_stream.cc @@ -32,8 +32,8 @@ namespace webrtc { -IncomingVideoStream::IncomingVideoStream(const WebRtc_Word32 module_id, - const WebRtc_UWord32 stream_id) +IncomingVideoStream::IncomingVideoStream(const int32_t module_id, + const uint32_t stream_id) : module_id_(module_id), stream_id_(stream_id), stream_critsect_(*CriticalSectionWrapper::CreateCriticalSection()), @@ -77,7 +77,7 @@ IncomingVideoStream::~IncomingVideoStream() { delete &deliver_buffer_event_; } -WebRtc_Word32 IncomingVideoStream::ChangeModuleId(const WebRtc_Word32 id) { +int32_t IncomingVideoStream::ChangeModuleId(const int32_t id) { CriticalSectionScoped cs(&stream_critsect_); module_id_ = id; return 0; @@ -88,8 +88,8 @@ VideoRenderCallback* IncomingVideoStream::ModuleCallback() { return this; } -WebRtc_Word32 IncomingVideoStream::RenderFrame(const WebRtc_UWord32 stream_id, - I420VideoFrame& video_frame) { +int32_t IncomingVideoStream::RenderFrame(const uint32_t stream_id, + I420VideoFrame& video_frame) { CriticalSectionScoped csS(&stream_critsect_); WEBRTC_TRACE(kTraceStream, kTraceVideoRenderer, module_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. 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) { incoming_rate_ = - static_cast(1000 * num_frames_since_last_calculation_ / - (now_ms - last_rate_calculation_time_ms_)); + static_cast(1000 * num_frames_since_last_calculation_ / + (now_ms - last_rate_calculation_time_ms_)); num_frames_since_last_calculation_ = 0; last_rate_calculation_time_ms_ = now_ms; } @@ -138,20 +138,20 @@ WebRtc_Word32 IncomingVideoStream::RenderFrame(const WebRtc_UWord32 stream_id, return 0; } -WebRtc_Word32 IncomingVideoStream::SetStartImage( +int32_t IncomingVideoStream::SetStartImage( const I420VideoFrame& video_frame) { CriticalSectionScoped csS(&thread_critsect_); return start_image_.CopyFrame(video_frame); } -WebRtc_Word32 IncomingVideoStream::SetTimeoutImage( - const I420VideoFrame& video_frame, const WebRtc_UWord32 timeout) { +int32_t IncomingVideoStream::SetTimeoutImage( + const I420VideoFrame& video_frame, const uint32_t timeout) { CriticalSectionScoped csS(&thread_critsect_); timeout_time_ = timeout; return timeout_image_.CopyFrame(video_frame); } -WebRtc_Word32 IncomingVideoStream::SetRenderCallback( +int32_t IncomingVideoStream::SetRenderCallback( VideoRenderCallback* render_callback) { CriticalSectionScoped cs(&stream_critsect_); @@ -162,9 +162,9 @@ WebRtc_Word32 IncomingVideoStream::SetRenderCallback( return 0; } -WebRtc_Word32 IncomingVideoStream::EnableMirroring(const bool enable, - const bool mirror_x_axis, - const bool mirror_y_axis) { +int32_t IncomingVideoStream::EnableMirroring(const bool enable, + const bool mirror_x_axis, + const bool mirror_y_axis) { CriticalSectionScoped cs(&stream_critsect_); mirror_frames_enabled_ = enable; mirroring_.mirror_x_axis = mirror_x_axis; @@ -173,8 +173,8 @@ WebRtc_Word32 IncomingVideoStream::EnableMirroring(const bool enable, return 0; } -WebRtc_Word32 IncomingVideoStream::SetExpectedRenderDelay( - WebRtc_Word32 delay_ms) { +int32_t IncomingVideoStream::SetExpectedRenderDelay( + int32_t delay_ms) { CriticalSectionScoped csS(&stream_critsect_); if (running_) { WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, module_id_, @@ -185,7 +185,7 @@ WebRtc_Word32 IncomingVideoStream::SetExpectedRenderDelay( return render_buffers_.SetRenderDelay(delay_ms); } -WebRtc_Word32 IncomingVideoStream::SetExternalCallback( +int32_t IncomingVideoStream::SetExternalCallback( VideoRenderCallback* external_callback) { CriticalSectionScoped cs(&stream_critsect_); WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, module_id_, @@ -198,7 +198,7 @@ WebRtc_Word32 IncomingVideoStream::SetExternalCallback( return 0; } -WebRtc_Word32 IncomingVideoStream::Start() { +int32_t IncomingVideoStream::Start() { CriticalSectionScoped csS(&stream_critsect_); WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, module_id_, "%s for stream %d", __FUNCTION__, stream_id_); @@ -235,7 +235,7 @@ WebRtc_Word32 IncomingVideoStream::Start() { return 0; } -WebRtc_Word32 IncomingVideoStream::Stop() { +int32_t IncomingVideoStream::Stop() { CriticalSectionScoped cs_stream(&stream_critsect_); WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, module_id_, "%s for stream %d", __FUNCTION__, stream_id_); @@ -269,19 +269,19 @@ WebRtc_Word32 IncomingVideoStream::Stop() { return 0; } -WebRtc_Word32 IncomingVideoStream::Reset() { +int32_t IncomingVideoStream::Reset() { CriticalSectionScoped cs_stream(&stream_critsect_); CriticalSectionScoped cs_buffer(&buffer_critsect_); render_buffers_.ReleaseAllFrames(); return 0; } -WebRtc_UWord32 IncomingVideoStream::StreamId() const { +uint32_t IncomingVideoStream::StreamId() const { CriticalSectionScoped cs_stream(&stream_critsect_); return stream_id_; } -WebRtc_UWord32 IncomingVideoStream::IncomingRate() const { +uint32_t IncomingVideoStream::IncomingRate() const { CriticalSectionScoped cs(&stream_critsect_); 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. buffer_critsect_.Enter(); frame_to_render = render_buffers_.FrameToRender(); - WebRtc_UWord32 wait_time = render_buffers_.TimeToNextFrameRelease(); + uint32_t wait_time = render_buffers_.TimeToNextFrameRelease(); buffer_critsect_.Leave(); // Set timer for next frame to render. @@ -362,7 +362,7 @@ bool IncomingVideoStream::IncomingVideoStreamProcess() { return true; } -WebRtc_Word32 IncomingVideoStream::GetLastRenderedFrame( +int32_t IncomingVideoStream::GetLastRenderedFrame( I420VideoFrame& video_frame) const { CriticalSectionScoped cs(&buffer_critsect_); return video_frame.CopyFrame(last_rendered_frame_); diff --git a/webrtc/modules/video_render/incoming_video_stream.h b/webrtc/modules/video_render/incoming_video_stream.h index 097a1672ad..6a63432084 100644 --- a/webrtc/modules/video_render/incoming_video_stream.h +++ b/webrtc/modules/video_render/incoming_video_stream.h @@ -29,46 +29,46 @@ struct VideoMirroring { class IncomingVideoStream : public VideoRenderCallback { public: - IncomingVideoStream(const WebRtc_Word32 module_id, - const WebRtc_UWord32 stream_id); + IncomingVideoStream(const int32_t module_id, + const uint32_t stream_id); ~IncomingVideoStream(); - WebRtc_Word32 ChangeModuleId(const WebRtc_Word32 id); + int32_t ChangeModuleId(const int32_t id); // Get callback to deliver frames to the module. VideoRenderCallback* ModuleCallback(); - virtual WebRtc_Word32 RenderFrame(const WebRtc_UWord32 stream_id, - I420VideoFrame& video_frame); + virtual int32_t RenderFrame(const uint32_t stream_id, + I420VideoFrame& video_frame); // Set callback to the platform dependent code. - WebRtc_Word32 SetRenderCallback(VideoRenderCallback* render_callback); + int32_t SetRenderCallback(VideoRenderCallback* render_callback); // Callback for file recording, snapshot, ... - WebRtc_Word32 SetExternalCallback(VideoRenderCallback* render_object); + int32_t SetExternalCallback(VideoRenderCallback* render_object); // Start/Stop. - WebRtc_Word32 Start(); - WebRtc_Word32 Stop(); + int32_t Start(); + int32_t Stop(); // Clear all buffers. - WebRtc_Word32 Reset(); + int32_t Reset(); // Properties. - WebRtc_UWord32 StreamId() const; - WebRtc_UWord32 IncomingRate() const; + uint32_t StreamId() 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, - const WebRtc_UWord32 timeout); + int32_t SetTimeoutImage(const I420VideoFrame& video_frame, + const uint32_t timeout); - WebRtc_Word32 EnableMirroring(const bool enable, - const bool mirror_xaxis, - const bool mirror_yaxis); + int32_t EnableMirroring(const bool enable, + const bool mirror_xaxis, + const bool mirror_yaxis); - WebRtc_Word32 SetExpectedRenderDelay(WebRtc_Word32 delay_ms); + int32_t SetExpectedRenderDelay(int32_t delay_ms); protected: static bool IncomingVideoStreamThreadFun(void* obj); @@ -79,8 +79,8 @@ class IncomingVideoStream : public VideoRenderCallback { enum { KEventMaxWaitTimeMs = 100 }; enum { KFrameRatePeriodMs = 1000 }; - WebRtc_Word32 module_id_; - WebRtc_UWord32 stream_id_; + int32_t module_id_; + uint32_t stream_id_; // Critsects in allowed to enter order. CriticalSectionWrapper& stream_critsect_; CriticalSectionWrapper& thread_critsect_; @@ -94,17 +94,17 @@ class IncomingVideoStream : public VideoRenderCallback { VideoRenderFrames& render_buffers_; RawVideoType callbackVideoType_; - WebRtc_UWord32 callbackWidth_; - WebRtc_UWord32 callbackHeight_; + uint32_t callbackWidth_; + uint32_t callbackHeight_; - WebRtc_UWord32 incoming_rate_; - WebRtc_Word64 last_rate_calculation_time_ms_; - WebRtc_UWord16 num_frames_since_last_calculation_; + uint32_t incoming_rate_; + int64_t last_rate_calculation_time_ms_; + uint16_t num_frames_since_last_calculation_; I420VideoFrame last_rendered_frame_; I420VideoFrame temp_frame_; I420VideoFrame start_image_; I420VideoFrame timeout_image_; - WebRtc_UWord32 timeout_time_; + uint32_t timeout_time_; bool mirror_frames_enabled_; VideoMirroring mirroring_; diff --git a/webrtc/modules/video_render/linux/video_render_linux_impl.cc b/webrtc/modules/video_render/linux/video_render_linux_impl.cc index a9e0fe5411..b50c1bd31f 100644 --- a/webrtc/modules/video_render/linux/video_render_linux_impl.cc +++ b/webrtc/modules/video_render/linux/video_render_linux_impl.cc @@ -19,7 +19,7 @@ namespace webrtc { VideoRenderLinuxImpl::VideoRenderLinuxImpl( - const WebRtc_Word32 id, + const int32_t id, const VideoRenderType videoRenderType, void* window, const bool fullscreen) : _id(id), @@ -37,7 +37,7 @@ VideoRenderLinuxImpl::~VideoRenderLinuxImpl() delete &_renderLinuxCritsect; } -WebRtc_Word32 VideoRenderLinuxImpl::Init() +int32_t VideoRenderLinuxImpl::Init() { WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, _id, "%s", __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); @@ -69,7 +69,7 @@ WebRtc_Word32 VideoRenderLinuxImpl::ChangeUniqueId(const WebRtc_Word32 id) return 0; } -WebRtc_Word32 VideoRenderLinuxImpl::ChangeWindow(void* window) +int32_t VideoRenderLinuxImpl::ChangeWindow(void* window) { WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, _id, "%s", __FUNCTION__); @@ -86,8 +86,8 @@ WebRtc_Word32 VideoRenderLinuxImpl::ChangeWindow(void* window) } VideoRenderCallback* VideoRenderLinuxImpl::AddIncomingRenderStream( - const WebRtc_UWord32 streamId, - const WebRtc_UWord32 zOrder, + const uint32_t streamId, + const uint32_t zOrder, const float left, const float top, const float right, @@ -121,8 +121,8 @@ VideoRenderCallback* VideoRenderLinuxImpl::AddIncomingRenderStream( return renderCallback; } -WebRtc_Word32 VideoRenderLinuxImpl::DeleteIncomingRenderStream( - const WebRtc_UWord32 streamId) +int32_t VideoRenderLinuxImpl::DeleteIncomingRenderStream( + const uint32_t streamId) { WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, _id, "%s", __FUNCTION__); @@ -135,9 +135,9 @@ WebRtc_Word32 VideoRenderLinuxImpl::DeleteIncomingRenderStream( return -1; } -WebRtc_Word32 VideoRenderLinuxImpl::GetIncomingRenderStreamProperties( - const WebRtc_UWord32 streamId, - WebRtc_UWord32& zOrder, +int32_t VideoRenderLinuxImpl::GetIncomingRenderStreamProperties( + const uint32_t streamId, + uint32_t& zOrder, float& left, float& top, float& right, @@ -156,14 +156,14 @@ WebRtc_Word32 VideoRenderLinuxImpl::GetIncomingRenderStreamProperties( return -1; } -WebRtc_Word32 VideoRenderLinuxImpl::StartRender() +int32_t VideoRenderLinuxImpl::StartRender() { WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, _id, "%s", __FUNCTION__); return 0; } -WebRtc_Word32 VideoRenderLinuxImpl::StopRender() +int32_t VideoRenderLinuxImpl::StopRender() { WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, _id, "%s", __FUNCTION__); @@ -185,29 +185,29 @@ bool VideoRenderLinuxImpl::FullScreen() return false; } -WebRtc_Word32 VideoRenderLinuxImpl::GetGraphicsMemory( - WebRtc_UWord64& /*totalGraphicsMemory*/, - WebRtc_UWord64& /*availableGraphicsMemory*/) const +int32_t VideoRenderLinuxImpl::GetGraphicsMemory( + uint64_t& /*totalGraphicsMemory*/, + uint64_t& /*availableGraphicsMemory*/) const { WEBRTC_TRACE(kTraceError, kTraceVideoRenderer, _id, "%s - not supported on Linux", __FUNCTION__); return -1; } -WebRtc_Word32 VideoRenderLinuxImpl::GetScreenResolution( - WebRtc_UWord32& /*screenWidth*/, - WebRtc_UWord32& /*screenHeight*/) const +int32_t VideoRenderLinuxImpl::GetScreenResolution( + uint32_t& /*screenWidth*/, + uint32_t& /*screenHeight*/) const { return -1; } -WebRtc_UWord32 VideoRenderLinuxImpl::RenderFrameRate(const WebRtc_UWord32 /*streamId*/) +uint32_t VideoRenderLinuxImpl::RenderFrameRate(const uint32_t /*streamId*/) { return -1; } -WebRtc_Word32 VideoRenderLinuxImpl::SetStreamCropping( - const WebRtc_UWord32 /*streamId*/, +int32_t VideoRenderLinuxImpl::SetStreamCropping( + const uint32_t /*streamId*/, const float /*left*/, const float /*top*/, const float /*right*/, @@ -218,15 +218,15 @@ WebRtc_Word32 VideoRenderLinuxImpl::SetStreamCropping( return -1; } -WebRtc_Word32 VideoRenderLinuxImpl::SetTransparentBackground(const bool /*enable*/) +int32_t VideoRenderLinuxImpl::SetTransparentBackground(const bool /*enable*/) { WEBRTC_TRACE(kTraceError, kTraceVideoRenderer, _id, "%s - not supported on Linux", __FUNCTION__); return -1; } -WebRtc_Word32 VideoRenderLinuxImpl::ConfigureRenderer( - const WebRtc_UWord32 streamId, +int32_t VideoRenderLinuxImpl::ConfigureRenderer( + const uint32_t streamId, const unsigned int zOrder, const float left, const float top, @@ -238,12 +238,12 @@ WebRtc_Word32 VideoRenderLinuxImpl::ConfigureRenderer( return -1; } -WebRtc_Word32 VideoRenderLinuxImpl::SetText( - const WebRtc_UWord8 textId, - const WebRtc_UWord8* text, - const WebRtc_Word32 textLength, - const WebRtc_UWord32 textColorRef, - const WebRtc_UWord32 backgroundColorRef, +int32_t VideoRenderLinuxImpl::SetText( + const uint8_t textId, + const uint8_t* text, + const int32_t textLength, + const uint32_t textColorRef, + const uint32_t backgroundColorRef, const float left, const float top, const float rigth, const float bottom) @@ -253,13 +253,13 @@ WebRtc_Word32 VideoRenderLinuxImpl::SetText( return -1; } -WebRtc_Word32 VideoRenderLinuxImpl::SetBitmap(const void* bitMap, - const WebRtc_UWord8 pictureId, - const void* colorKey, - const float left, - const float top, - const float right, - const float bottom) +int32_t VideoRenderLinuxImpl::SetBitmap(const void* bitMap, + const uint8_t pictureId, + const void* colorKey, + const float left, + const float top, + const float right, + const float bottom) { WEBRTC_TRACE(kTraceError, kTraceVideoRenderer, _id, "%s - not supported on Linux", __FUNCTION__); diff --git a/webrtc/modules/video_render/linux/video_render_linux_impl.h b/webrtc/modules/video_render/linux/video_render_linux_impl.h index 35880563a8..3318ddfe66 100644 --- a/webrtc/modules/video_render/linux/video_render_linux_impl.h +++ b/webrtc/modules/video_render/linux/video_render_linux_impl.h @@ -26,17 +26,17 @@ public: * Constructor/destructor */ - VideoRenderLinuxImpl(const WebRtc_Word32 id, + VideoRenderLinuxImpl(const int32_t id, const VideoRenderType videoRenderType, void* window, const bool fullscreen); 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 - * AddIncomingRenderStream(const WebRtc_UWord32 streamId, - const WebRtc_UWord32 zOrder, + * AddIncomingRenderStream(const uint32_t streamId, + const uint32_t zOrder, const float left, const float top, const float right, 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, - WebRtc_UWord32& zOrder, + virtual int32_t + GetIncomingRenderStreamProperties(const uint32_t streamId, + uint32_t& zOrder, float& left, float& top, 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 WebRtc_Word32 - GetGraphicsMemory(WebRtc_UWord64& totalGraphicsMemory, - WebRtc_UWord64& availableGraphicsMemory) const; + virtual int32_t + GetGraphicsMemory(uint64_t& totalGraphicsMemory, + uint64_t& availableGraphicsMemory) const; - virtual WebRtc_Word32 - GetScreenResolution(WebRtc_UWord32& screenWidth, - WebRtc_UWord32& screenHeight) const; + virtual int32_t + GetScreenResolution(uint32_t& screenWidth, + 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, - const float left, const float top, - const float right, - const float bottom); + virtual int32_t SetStreamCropping(const uint32_t streamId, + const float left, const float top, + const float right, 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, - const unsigned int zOrder, - const float left, const float top, - const float right, - const float bottom); + virtual int32_t ConfigureRenderer(const uint32_t streamId, + const unsigned int zOrder, + const float left, const float top, + const float right, const float bottom); - virtual WebRtc_Word32 SetText(const WebRtc_UWord8 textId, - const WebRtc_UWord8* text, - const WebRtc_Word32 textLength, - const WebRtc_UWord32 textColorRef, - const WebRtc_UWord32 backgroundColorRef, - const float left, const float top, - const float rigth, const float bottom); + virtual int32_t SetText(const uint8_t textId, + const uint8_t* text, + const int32_t textLength, + const uint32_t textColorRef, + const uint32_t backgroundColorRef, + const float left, const float top, + const float rigth, const float bottom); - virtual WebRtc_Word32 SetBitmap(const void* bitMap, - const WebRtc_UWord8 pictureId, - const void* colorKey, const float left, - const float top, const float right, - const float bottom); + virtual int32_t SetBitmap(const void* bitMap, + const uint8_t pictureId, + const void* colorKey, + const float left, const float top, + const float right, const float bottom); private: - WebRtc_Word32 _id; + int32_t _id; CriticalSectionWrapper& _renderLinuxCritsect; void* _ptrWindow; diff --git a/webrtc/modules/video_render/linux/video_x11_channel.cc b/webrtc/modules/video_render/linux/video_x11_channel.cc index 547a813df0..da10a97ff5 100644 --- a/webrtc/modules/video_render/linux/video_x11_channel.cc +++ b/webrtc/modules/video_render/linux/video_x11_channel.cc @@ -21,7 +21,7 @@ static Display *dispArray[DISP_MAX]; static int dispCount = 0; -VideoX11Channel::VideoX11Channel(WebRtc_Word32 id) : +VideoX11Channel::VideoX11Channel(int32_t id) : _crit(*CriticalSectionWrapper::CreateCriticalSection()), _display(NULL), _shminfo(), _image(NULL), _window(0L), _gc(NULL), _width(DEFAULT_RENDER_FRAME_WIDTH), @@ -43,8 +43,8 @@ VideoX11Channel::~VideoX11Channel() delete &_crit; } -WebRtc_Word32 VideoX11Channel::RenderFrame(const WebRtc_UWord32 streamId, - I420VideoFrame& videoFrame) { +int32_t VideoX11Channel::RenderFrame(const uint32_t streamId, + I420VideoFrame& videoFrame) { CriticalSectionScoped cs(&_crit); if (_width != videoFrame.width() || _height != videoFrame.height()) { @@ -55,9 +55,9 @@ WebRtc_Word32 VideoX11Channel::RenderFrame(const WebRtc_UWord32 streamId, return DeliverFrame(videoFrame); } -WebRtc_Word32 VideoX11Channel::FrameSizeChange(WebRtc_Word32 width, - WebRtc_Word32 height, - WebRtc_Word32 /*numberOfStreams */) +int32_t VideoX11Channel::FrameSizeChange(int32_t width, + int32_t height, + int32_t /*numberOfStreams */) { CriticalSectionScoped cs(&_crit); if (_prepared) @@ -72,7 +72,7 @@ WebRtc_Word32 VideoX11Channel::FrameSizeChange(WebRtc_Word32 width, return 0; } -WebRtc_Word32 VideoX11Channel::DeliverFrame(const I420VideoFrame& videoFrame) { +int32_t VideoX11Channel::DeliverFrame(const I420VideoFrame& videoFrame) { CriticalSectionScoped cs(&_crit); if (!_prepared) { return 0; @@ -93,8 +93,7 @@ WebRtc_Word32 VideoX11Channel::DeliverFrame(const I420VideoFrame& videoFrame) { return 0; } -WebRtc_Word32 VideoX11Channel::GetFrameSize(WebRtc_Word32& width, - WebRtc_Word32& height) +int32_t VideoX11Channel::GetFrameSize(int32_t& width, int32_t& height) { width = _width; height = _height; @@ -102,8 +101,8 @@ WebRtc_Word32 VideoX11Channel::GetFrameSize(WebRtc_Word32& width, return 0; } -WebRtc_Word32 VideoX11Channel::Init(Window window, float left, float top, - float right, float bottom) +int32_t VideoX11Channel::Init(Window window, float left, float top, + float right, float bottom) { WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, _Id, "%s", __FUNCTION__); @@ -148,10 +147,10 @@ WebRtc_Word32 VideoX11Channel::Init(Window window, float left, float top, return -1; } - _xPos = (WebRtc_Word32) (winWidth * left); - _yPos = (WebRtc_Word32) (winHeight * top); - _outWidth = (WebRtc_Word32) (winWidth * (right - left)); - _outHeight = (WebRtc_Word32) (winHeight * (bottom - top)); + _xPos = (int32_t) (winWidth * left); + _yPos = (int32_t) (winHeight * top); + _outWidth = (int32_t) (winWidth * (right - left)); + _outHeight = (int32_t) (winHeight * (bottom - top)); if (_outWidth % 2) _outWidth++; // the renderer want's sizes that are multiples of two 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", __FUNCTION__); @@ -208,7 +207,7 @@ WebRtc_Word32 VideoX11Channel::ChangeWindow(Window window) return 0; } -WebRtc_Word32 VideoX11Channel::ReleaseWindow() +int32_t VideoX11Channel::ReleaseWindow() { WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, _Id, "%s", __FUNCTION__); @@ -227,8 +226,7 @@ WebRtc_Word32 VideoX11Channel::ReleaseWindow() return 0; } -WebRtc_Word32 VideoX11Channel::CreateLocalRenderer(WebRtc_Word32 width, - WebRtc_Word32 height) +int32_t VideoX11Channel::CreateLocalRenderer(int32_t width, int32_t height) { WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, _Id, "%s", __FUNCTION__); @@ -274,7 +272,7 @@ WebRtc_Word32 VideoX11Channel::CreateLocalRenderer(WebRtc_Word32 width, return 0; } -WebRtc_Word32 VideoX11Channel::RemoveRenderer() +int32_t VideoX11Channel::RemoveRenderer() { WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, _Id, "%s", __FUNCTION__); @@ -297,10 +295,9 @@ WebRtc_Word32 VideoX11Channel::RemoveRenderer() return 0; } -WebRtc_Word32 VideoX11Channel::GetStreamProperties(WebRtc_UWord32& zOrder, - float& left, float& top, - float& right, - float& bottom) const +int32_t VideoX11Channel::GetStreamProperties(uint32_t& zOrder, + float& left, float& top, + float& right, float& bottom) const { WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, _Id, "%s", __FUNCTION__); diff --git a/webrtc/modules/video_render/linux/video_x11_channel.h b/webrtc/modules/video_render/linux/video_x11_channel.h index d22b0fe507..30d27e89a4 100644 --- a/webrtc/modules/video_render/linux/video_x11_channel.h +++ b/webrtc/modules/video_render/linux/video_x11_channel.h @@ -29,24 +29,24 @@ class CriticalSectionWrapper; class VideoX11Channel: public VideoRenderCallback { public: - VideoX11Channel(WebRtc_Word32 id); + VideoX11Channel(int32_t id); virtual ~VideoX11Channel(); - virtual WebRtc_Word32 RenderFrame(const WebRtc_UWord32 streamId, - I420VideoFrame& videoFrame); + virtual int32_t RenderFrame(const uint32_t streamId, + I420VideoFrame& videoFrame); - WebRtc_Word32 FrameSizeChange(WebRtc_Word32 width, WebRtc_Word32 height, - WebRtc_Word32 numberOfStreams); - WebRtc_Word32 DeliverFrame(const I420VideoFrame& videoFrame); - WebRtc_Word32 GetFrameSize(WebRtc_Word32& width, WebRtc_Word32& height); - WebRtc_Word32 Init(Window window, float left, float top, float right, - float bottom); - WebRtc_Word32 ChangeWindow(Window window); - WebRtc_Word32 - GetStreamProperties(WebRtc_UWord32& zOrder, float& left, + int32_t FrameSizeChange(int32_t width, int32_t height, + int32_t numberOfStreams); + int32_t DeliverFrame(const I420VideoFrame& videoFrame); + int32_t GetFrameSize(int32_t& width, int32_t& height); + int32_t Init(Window window, float left, float top, float right, + float bottom); + int32_t ChangeWindow(Window window); + int32_t + GetStreamProperties(uint32_t& zOrder, float& left, float& top, float& right, float& bottom) const; - WebRtc_Word32 ReleaseWindow(); + int32_t ReleaseWindow(); bool IsPrepared() { @@ -55,9 +55,9 @@ public: private: - WebRtc_Word32 - CreateLocalRenderer(WebRtc_Word32 width, WebRtc_Word32 height); - WebRtc_Word32 RemoveRenderer(); + int32_t + CreateLocalRenderer(int32_t width, int32_t height); + int32_t RemoveRenderer(); //FIXME a better place for this method? the GetWidthHeight no longer // supported by common_video. @@ -71,14 +71,14 @@ private: XImage* _image; Window _window; GC _gc; - WebRtc_Word32 _width; // incoming frame width - WebRtc_Word32 _height; // incoming frame height - WebRtc_Word32 _outWidth; // render frame width - WebRtc_Word32 _outHeight; // render frame height - WebRtc_Word32 _xPos; // position within window - WebRtc_Word32 _yPos; + int32_t _width; // incoming frame width + int32_t _height; // incoming frame height + int32_t _outWidth; // render frame width + int32_t _outHeight; // render frame height + int32_t _xPos; // position within window + int32_t _yPos; bool _prepared; // true if ready to use - WebRtc_Word32 _dispCount; + int32_t _dispCount; unsigned char* _buffer; float _top; @@ -86,7 +86,7 @@ private: float _right; float _bottom; - WebRtc_Word32 _Id; + int32_t _Id; }; diff --git a/webrtc/modules/video_render/linux/video_x11_render.cc b/webrtc/modules/video_render/linux/video_x11_render.cc index 9e29fe3827..570883ccbe 100644 --- a/webrtc/modules/video_render/linux/video_x11_render.cc +++ b/webrtc/modules/video_render/linux/video_x11_render.cc @@ -27,7 +27,7 @@ VideoX11Render::~VideoX11Render() delete &_critSect; } -WebRtc_Word32 VideoX11Render::Init() +int32_t VideoX11Render::Init() { CriticalSectionScoped cs(&_critSect); @@ -36,7 +36,7 @@ WebRtc_Word32 VideoX11Render::Init() return 0; } -WebRtc_Word32 VideoX11Render::ChangeWindow(Window window) +int32_t VideoX11Render::ChangeWindow(Window window) { CriticalSectionScoped cs(&_critSect); VideoX11Channel* renderChannel = NULL; @@ -60,8 +60,8 @@ WebRtc_Word32 VideoX11Render::ChangeWindow(Window window) } VideoX11Channel* VideoX11Render::CreateX11RenderChannel( - WebRtc_Word32 streamId, - WebRtc_Word32 zOrder, + int32_t streamId, + int32_t zOrder, const float left, const float top, const float right, @@ -99,7 +99,7 @@ VideoX11Channel* VideoX11Render::CreateX11RenderChannel( return renderChannel; } -WebRtc_Word32 VideoX11Render::DeleteX11RenderChannel(WebRtc_Word32 streamId) +int32_t VideoX11Render::DeleteX11RenderChannel(int32_t streamId) { CriticalSectionScoped cs(&_critSect); @@ -123,9 +123,9 @@ WebRtc_Word32 VideoX11Render::DeleteX11RenderChannel(WebRtc_Word32 streamId) return -1; } -WebRtc_Word32 VideoX11Render::GetIncomingStreamProperties( - WebRtc_Word32 streamId, - WebRtc_UWord32& zOrder, +int32_t VideoX11Render::GetIncomingStreamProperties( + int32_t streamId, + uint32_t& zOrder, float& left, float& top, float& right, diff --git a/webrtc/modules/video_render/linux/video_x11_render.h b/webrtc/modules/video_render/linux/video_x11_render.h index 9b140effa6..5c15a0d038 100644 --- a/webrtc/modules/video_render/linux/video_x11_render.h +++ b/webrtc/modules/video_render/linux/video_x11_render.h @@ -28,22 +28,22 @@ public: VideoX11Render(Window window); ~VideoX11Render(); - WebRtc_Word32 Init(); - WebRtc_Word32 ChangeWindow(Window window); + int32_t Init(); + int32_t ChangeWindow(Window window); - VideoX11Channel* CreateX11RenderChannel(WebRtc_Word32 streamId, - WebRtc_Word32 zOrder, - const float left, - const float top, - const float right, - const float bottom); + VideoX11Channel* CreateX11RenderChannel(int32_t streamId, + int32_t zOrder, + const float left, + const float top, + const float right, + const float bottom); - WebRtc_Word32 DeleteX11RenderChannel(WebRtc_Word32 streamId); + int32_t DeleteX11RenderChannel(int32_t streamId); - WebRtc_Word32 GetIncomingStreamProperties(WebRtc_Word32 streamId, - WebRtc_UWord32& zOrder, - float& left, float& top, - float& right, float& bottom); + int32_t GetIncomingStreamProperties(int32_t streamId, + uint32_t& zOrder, + float& left, float& top, + float& right, float& bottom); private: Window _window; diff --git a/webrtc/modules/video_render/mac/video_render_agl.cc b/webrtc/modules/video_render/mac/video_render_agl.cc index 261b76be1c..e9b5f386b7 100644 --- a/webrtc/modules/video_render/mac/video_render_agl.cc +++ b/webrtc/modules/video_render/mac/video_render_agl.cc @@ -80,8 +80,8 @@ VideoChannelAGL::~VideoChannelAGL() } } -WebRtc_Word32 VideoChannelAGL::RenderFrame(const WebRtc_UWord32 streamId, - I420VideoFrame& videoFrame) { +int32_t VideoChannelAGL::RenderFrame(const uint32_t streamId, + I420VideoFrame& videoFrame) { _owner->LockAGLCntx(); if (_width != videoFrame.width() || _height != videoFrame.height()) { @@ -1872,7 +1872,7 @@ int VideoRenderAGL::ChangeWindow(void* newWindowRef) UnlockAGLCntx(); return -1; } -WebRtc_Word32 VideoRenderAGL::ChangeUniqueID(WebRtc_Word32 id) +int32_t VideoRenderAGL::ChangeUniqueID(int32_t id) { LockAGLCntx(); @@ -1880,7 +1880,7 @@ WebRtc_Word32 VideoRenderAGL::ChangeUniqueID(WebRtc_Word32 id) return -1; } -WebRtc_Word32 VideoRenderAGL::StartRender() +int32_t VideoRenderAGL::StartRender() { LockAGLCntx(); @@ -1926,7 +1926,7 @@ WebRtc_Word32 VideoRenderAGL::StartRender() } -WebRtc_Word32 VideoRenderAGL::StopRender() +int32_t VideoRenderAGL::StopRender() { LockAGLCntx(); @@ -1952,7 +1952,7 @@ WebRtc_Word32 VideoRenderAGL::StopRender() return 0; } -WebRtc_Word32 VideoRenderAGL::DeleteAGLChannel(const WebRtc_UWord32 streamID) +int32_t VideoRenderAGL::DeleteAGLChannel(const uint32_t streamID) { LockAGLCntx(); @@ -1973,12 +1973,12 @@ WebRtc_Word32 VideoRenderAGL::DeleteAGLChannel(const WebRtc_UWord32 streamID) return 0; } -WebRtc_Word32 VideoRenderAGL::GetChannelProperties(const WebRtc_UWord16 streamId, -WebRtc_UWord32& zOrder, -float& left, -float& top, -float& right, -float& bottom) +int32_t VideoRenderAGL::GetChannelProperties(const uint16_t streamId, + uint32_t& zOrder, + float& left, + float& top, + float& right, + float& bottom) { LockAGLCntx(); diff --git a/webrtc/modules/video_render/mac/video_render_agl.h b/webrtc/modules/video_render/mac/video_render_agl.h index 05bf0b668d..e446fb173f 100644 --- a/webrtc/modules/video_render/mac/video_render_agl.h +++ b/webrtc/modules/video_render/mac/video_render_agl.h @@ -15,12 +15,10 @@ #ifndef 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" - #define NEW_HIVIEW_PARENT_EVENT_HANDLER 1 -#define NEW_HIVIEW_EVENT_HANDLER 1 +#define NEW_HIVIEW_EVENT_HANDLER 1 #define USE_STRUCT_RGN #include @@ -38,149 +36,145 @@ class CriticalSectionWrapper; class EventWrapper; class ThreadWrapper; -class VideoChannelAGL : public VideoRenderCallback -{ -public: +class VideoChannelAGL : public VideoRenderCallback { + public: - VideoChannelAGL(AGLContext& aglContext, int iId, VideoRenderAGL* owner); - virtual ~VideoChannelAGL(); - virtual int FrameSizeChange(int width, int height, int numberOfStreams); - virtual int DeliverFrame(const I420VideoFrame& videoFrame); - virtual int UpdateSize(int width, int height); - int SetStreamSettings(int streamId, float startWidth, float startHeight, float stopWidth, float stopHeight); - int SetStreamCropSettings(int streamId, float startWidth, float startHeight, float stopWidth, float stopHeight); - int RenderOffScreenBuffer(); - int IsUpdated(bool& isUpdated); - virtual int UpdateStretchSize(int stretchHeight, int stretchWidth); - virtual WebRtc_Word32 RenderFrame(const WebRtc_UWord32 streamId, - I420VideoFrame& videoFrame); - - -private: - - AGLContext _aglContext; - int _id; - VideoRenderAGL* _owner; - int _width; - int _height; - int _stretchedWidth; - int _stretchedHeight; - float _startHeight; - float _startWidth; - float _stopWidth; - float _stopHeight; - int _xOldWidth; - int _yOldHeight; - int _oldStretchedHeight; - int _oldStretchedWidth; - unsigned char* _buffer; - int _bufferSize; - int _incommingBufferSize; - bool _bufferIsUpdated; - bool _sizeInitialized; - int _numberOfStreams; - bool _bVideoSizeStartedChanging; - GLenum _pixelFormat; - GLenum _pixelDataType; - unsigned int _texture; + VideoChannelAGL(AGLContext& aglContext, int iId, VideoRenderAGL* owner); + virtual ~VideoChannelAGL(); + virtual int FrameSizeChange(int width, int height, int numberOfStreams); + virtual int DeliverFrame(const I420VideoFrame& videoFrame); + virtual int UpdateSize(int width, int height); + int SetStreamSettings(int streamId, float startWidth, float startHeight, + float stopWidth, float stopHeight); + int SetStreamCropSettings(int streamId, float startWidth, float startHeight, + float stopWidth, float stopHeight); + int RenderOffScreenBuffer(); + int IsUpdated(bool& isUpdated); + virtual int UpdateStretchSize(int stretchHeight, int stretchWidth); + virtual int32_t RenderFrame(const uint32_t streamId, + I420VideoFrame& videoFrame); + + private: + + AGLContext _aglContext; + int _id; + VideoRenderAGL* _owner; + int _width; + int _height; + int _stretchedWidth; + int _stretchedHeight; + float _startHeight; + float _startWidth; + float _stopWidth; + float _stopHeight; + int _xOldWidth; + int _yOldHeight; + int _oldStretchedHeight; + int _oldStretchedWidth; + unsigned char* _buffer; + int _bufferSize; + int _incommingBufferSize; + bool _bufferIsUpdated; + bool _sizeInitialized; + int _numberOfStreams; + bool _bVideoSizeStartedChanging; + GLenum _pixelFormat; + 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& channelList); + void LockAGLCntx(); + void UnlockAGLCntx(); + static int GetOpenGLVersion(int& aglMajor, int& aglMinor); -class VideoRenderAGL -{ -public: - VideoRenderAGL(WindowRef windowRef, bool fullscreen, int iId); - VideoRenderAGL(HIViewRef windowRef, bool fullscreen, int iId); - ~VideoRenderAGL(); + // ********** new module functions ************ // + int ChangeWindow(void* newWindowRef); + int32_t ChangeUniqueID(int32_t id); + int32_t StartRender(); + int32_t StopRender(); + 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(); - 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& 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: + static bool ScreenUpdateThreadProc(void* obj); + bool ScreenUpdateProcess(); + int GetWindowRect(Rect& rect); -protected: - static bool ScreenUpdateThreadProc(void* obj); - bool ScreenUpdateProcess(); - int GetWindowRect(Rect& rect); - -private: - int CreateMixingContext(); - int RenderOffScreenBuffers(); - int SwapAndDisplayBuffers(); - int UpdateClipping(); - int CalculateVisibleRegion(ControlRef control, RgnHandle &visibleRgn, bool clipChildren); - bool CheckValidRegion(RgnHandle rHandle); - void ParentWindowResized(WindowRef window); + private: + int CreateMixingContext(); + int RenderOffScreenBuffers(); + int SwapAndDisplayBuffers(); + int UpdateClipping(); + int CalculateVisibleRegion(ControlRef control, RgnHandle& visibleRgn, + bool clipChildren); + bool CheckValidRegion(RgnHandle rHandle); + void ParentWindowResized(WindowRef window); - // Carbon GUI event handlers - static pascal OSStatus sHandleWindowResized (EventHandlerCallRef nextHandler, EventRef theEvent, void* userData); - static pascal OSStatus sHandleHiViewResized (EventHandlerCallRef nextHandler, EventRef theEvent, void* userData); + // Carbon GUI event handlers + static pascal OSStatus sHandleWindowResized( + 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 _aglChannels; + std::multimap _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 _aglChannels; - std::multimap _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 diff --git a/webrtc/modules/video_render/mac/video_render_mac_carbon_impl.cc b/webrtc/modules/video_render/mac/video_render_mac_carbon_impl.cc index aec73bc318..f3fb2de38a 100644 --- a/webrtc/modules/video_render/mac/video_render_mac_carbon_impl.cc +++ b/webrtc/modules/video_render/mac/video_render_mac_carbon_impl.cc @@ -19,7 +19,7 @@ namespace webrtc { -VideoRenderMacCarbonImpl::VideoRenderMacCarbonImpl(const WebRtc_Word32 id, +VideoRenderMacCarbonImpl::VideoRenderMacCarbonImpl(const int32_t id, const VideoRenderType videoRenderType, void* window, const bool fullscreen) : @@ -39,7 +39,7 @@ VideoRenderMacCarbonImpl::~VideoRenderMacCarbonImpl() delete &_renderMacCarbonCritsect; } -WebRtc_Word32 +int32_t VideoRenderMacCarbonImpl::Init() { CriticalSectionScoped cs(&_renderMacCarbonCritsect); @@ -96,8 +96,8 @@ VideoRenderMacCarbonImpl::Init() return 0; } -WebRtc_Word32 -VideoRenderMacCarbonImpl::ChangeUniqueId(const WebRtc_Word32 id) +int32_t +VideoRenderMacCarbonImpl::ChangeUniqueId(const int32_t id) { return -1; @@ -113,7 +113,7 @@ VideoRenderMacCarbonImpl::ChangeUniqueId(const WebRtc_Word32 id) return 0; } -WebRtc_Word32 +int32_t VideoRenderMacCarbonImpl::ChangeWindow(void* window) { return -1; @@ -133,8 +133,8 @@ VideoRenderMacCarbonImpl::ChangeWindow(void* window) } VideoRenderCallback* -VideoRenderMacCarbonImpl::AddIncomingRenderStream(const WebRtc_UWord32 streamId, - const WebRtc_UWord32 zOrder, +VideoRenderMacCarbonImpl::AddIncomingRenderStream(const uint32_t streamId, + const uint32_t zOrder, const float left, const float top, const float right, @@ -158,8 +158,8 @@ VideoRenderMacCarbonImpl::AddIncomingRenderStream(const WebRtc_UWord32 streamId, } -WebRtc_Word32 -VideoRenderMacCarbonImpl::DeleteIncomingRenderStream(const WebRtc_UWord32 streamId) +int32_t +VideoRenderMacCarbonImpl::DeleteIncomingRenderStream(const uint32_t streamId) { WEBRTC_TRACE(kTraceDebug, kTraceVideoRenderer, _id, "%s:%d", __FUNCTION__, __LINE__); @@ -169,9 +169,9 @@ VideoRenderMacCarbonImpl::DeleteIncomingRenderStream(const WebRtc_UWord32 stream return 0; } -WebRtc_Word32 -VideoRenderMacCarbonImpl::GetIncomingRenderStreamProperties(const WebRtc_UWord32 streamId, - WebRtc_UWord32& zOrder, +int32_t +VideoRenderMacCarbonImpl::GetIncomingRenderStreamProperties(const uint32_t streamId, + uint32_t& zOrder, float& left, float& top, float& right, @@ -181,13 +181,13 @@ VideoRenderMacCarbonImpl::GetIncomingRenderStreamProperties(const WebRtc_UWord32 return _ptrCarbonRender->GetChannelProperties(streamId, zOrder, left, top, right, bottom); } -WebRtc_Word32 +int32_t VideoRenderMacCarbonImpl::StartRender() { return _ptrCarbonRender->StartRender(); } -WebRtc_Word32 +int32_t VideoRenderMacCarbonImpl::StopRender() { return _ptrCarbonRender->StopRender(); @@ -211,18 +211,18 @@ VideoRenderMacCarbonImpl::FullScreen() return false; } -WebRtc_Word32 -VideoRenderMacCarbonImpl::GetGraphicsMemory(WebRtc_UWord64& totalGraphicsMemory, - WebRtc_UWord64& availableGraphicsMemory) const +int32_t +VideoRenderMacCarbonImpl::GetGraphicsMemory(uint64_t& totalGraphicsMemory, + uint64_t& availableGraphicsMemory) const { totalGraphicsMemory = 0; availableGraphicsMemory = 0; return 0; } -WebRtc_Word32 -VideoRenderMacCarbonImpl::GetScreenResolution(WebRtc_UWord32& screenWidth, - WebRtc_UWord32& screenHeight) const +int32_t +VideoRenderMacCarbonImpl::GetScreenResolution(uint32_t& screenWidth, + uint32_t& screenHeight) const { CriticalSectionScoped cs(&_renderMacCarbonCritsect); //NSScreen* mainScreen = [NSScreen mainScreen]; @@ -234,15 +234,15 @@ VideoRenderMacCarbonImpl::GetScreenResolution(WebRtc_UWord32& screenWidth, return 0; } -WebRtc_UWord32 -VideoRenderMacCarbonImpl::RenderFrameRate(const WebRtc_UWord32 streamId) +uint32_t +VideoRenderMacCarbonImpl::RenderFrameRate(const uint32_t streamId) { CriticalSectionScoped cs(&_renderMacCarbonCritsect); return 0; } -WebRtc_Word32 -VideoRenderMacCarbonImpl::SetStreamCropping(const WebRtc_UWord32 streamId, +int32_t +VideoRenderMacCarbonImpl::SetStreamCropping(const uint32_t streamId, const float left, const float top, const float right, @@ -251,42 +251,42 @@ VideoRenderMacCarbonImpl::SetStreamCropping(const WebRtc_UWord32 streamId, return 0; } -WebRtc_Word32 VideoRenderMacCarbonImpl::ConfigureRenderer(const WebRtc_UWord32 streamId, - const unsigned int zOrder, - const float left, - const float top, - const float right, - const float bottom) +int32_t VideoRenderMacCarbonImpl::ConfigureRenderer(const uint32_t streamId, + const unsigned int zOrder, + const float left, + const float top, + const float right, + const float bottom) { return 0; } -WebRtc_Word32 +int32_t VideoRenderMacCarbonImpl::SetTransparentBackground(const bool enable) { return 0; } -WebRtc_Word32 VideoRenderMacCarbonImpl::SetText(const WebRtc_UWord8 textId, - const WebRtc_UWord8* text, - const WebRtc_Word32 textLength, - const WebRtc_UWord32 textColorRef, - const WebRtc_UWord32 backgroundColorRef, - const float left, - const float top, - const float right, - const float bottom) +int32_t VideoRenderMacCarbonImpl::SetText(const uint8_t textId, + const uint8_t* text, + const int32_t textLength, + const uint32_t textColorRef, + const uint32_t backgroundColorRef, + const float left, + const float top, + const float right, + const float bottom) { return 0; } -WebRtc_Word32 VideoRenderMacCarbonImpl::SetBitmap(const void* bitMap, - const WebRtc_UWord8 pictureId, - const void* colorKey, - const float left, - const float top, - const float right, - const float bottom) +int32_t VideoRenderMacCarbonImpl::SetBitmap(const void* bitMap, + const uint8_t pictureId, + const void* colorKey, + const float left, + const float top, + const float right, + const float bottom) { return 0; } diff --git a/webrtc/modules/video_render/mac/video_render_mac_carbon_impl.h b/webrtc/modules/video_render/mac/video_render_mac_carbon_impl.h index 578a1c09a6..b0cb0fc9a3 100644 --- a/webrtc/modules/video_render/mac/video_render_mac_carbon_impl.h +++ b/webrtc/modules/video_render/mac/video_render_mac_carbon_impl.h @@ -29,39 +29,39 @@ public: * Constructor/destructor */ - VideoRenderMacCarbonImpl(const WebRtc_Word32 id, + VideoRenderMacCarbonImpl(const int32_t id, const VideoRenderType videoRenderType, void* window, const bool fullscreen); 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 * ***************************************************************************/ - virtual VideoRenderCallback* AddIncomingRenderStream(const WebRtc_UWord32 streamId, - const WebRtc_UWord32 zOrder, + virtual VideoRenderCallback* AddIncomingRenderStream(const uint32_t streamId, + const uint32_t zOrder, const float left, const float top, const float right, 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, - WebRtc_UWord32& zOrder, - float& left, - float& top, - float& right, - float& bottom) const; + virtual int32_t GetIncomingRenderStreamProperties(const uint32_t streamId, + uint32_t& zOrder, + float& left, + float& top, + float& right, + 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 WebRtc_Word32 GetGraphicsMemory(WebRtc_UWord64& totalGraphicsMemory, - WebRtc_UWord64& availableGraphicsMemory) const; + virtual int32_t GetGraphicsMemory(uint64_t& totalGraphicsMemory, + uint64_t& availableGraphicsMemory) const; - virtual WebRtc_Word32 GetScreenResolution(WebRtc_UWord32& screenWidth, - WebRtc_UWord32& screenHeight) const; + virtual int32_t GetScreenResolution(uint32_t& screenWidth, + 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 right, const float bottom); - virtual WebRtc_Word32 ConfigureRenderer(const WebRtc_UWord32 streamId, + virtual int32_t ConfigureRenderer(const uint32_t streamId, const unsigned int zOrder, const float left, const float top, const float right, 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, - const WebRtc_UWord8* text, - const WebRtc_Word32 textLength, - const WebRtc_UWord32 textColorRef, - const WebRtc_UWord32 backgroundColorRef, + virtual int32_t SetText(const uint8_t textId, + const uint8_t* text, + const int32_t textLength, + const uint32_t textColorRef, + const uint32_t backgroundColorRef, const float left, const float top, const float right, const float bottom); - virtual WebRtc_Word32 SetBitmap(const void* bitMap, - const WebRtc_UWord8 pictureId, + virtual int32_t SetBitmap(const void* bitMap, + const uint8_t pictureId, const void* colorKey, const float left, const float top, const float right, 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 return -1; } private: - WebRtc_Word32 _id; + int32_t _id; CriticalSectionWrapper& _renderMacCarbonCritsect; bool _fullScreen; void* _ptrWindow; diff --git a/webrtc/modules/video_render/mac/video_render_mac_cocoa_impl.h b/webrtc/modules/video_render/mac/video_render_mac_cocoa_impl.h index da8a41022a..5507f06470 100644 --- a/webrtc/modules/video_render/mac/video_render_mac_cocoa_impl.h +++ b/webrtc/modules/video_render/mac/video_render_mac_cocoa_impl.h @@ -29,39 +29,39 @@ public: * Constructor/destructor */ - VideoRenderMacCocoaImpl(const WebRtc_Word32 id, + VideoRenderMacCocoaImpl(const int32_t id, const VideoRenderType videoRenderType, void* window, const bool fullscreen); 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 * ***************************************************************************/ - virtual VideoRenderCallback* AddIncomingRenderStream(const WebRtc_UWord32 streamId, - const WebRtc_UWord32 zOrder, + virtual VideoRenderCallback* AddIncomingRenderStream(const uint32_t streamId, + const uint32_t zOrder, const float left, const float top, const float right, 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, - WebRtc_UWord32& zOrder, - float& left, - float& top, - float& right, - float& bottom) const; + virtual int32_t GetIncomingRenderStreamProperties(const uint32_t streamId, + uint32_t& zOrder, + float& left, + float& top, + float& right, + 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 WebRtc_Word32 GetGraphicsMemory(WebRtc_UWord64& totalGraphicsMemory, - WebRtc_UWord64& availableGraphicsMemory) const; + virtual int32_t GetGraphicsMemory(uint64_t& totalGraphicsMemory, + uint64_t& availableGraphicsMemory) const; - virtual WebRtc_Word32 GetScreenResolution(WebRtc_UWord32& screenWidth, - WebRtc_UWord32& screenHeight) const; + virtual int32_t GetScreenResolution(uint32_t& screenWidth, + 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, - const float left, - const float top, - const float right, - const float bottom); + virtual int32_t SetStreamCropping(const uint32_t streamId, + const float left, + const float top, + const float right, + const float bottom); - virtual WebRtc_Word32 ConfigureRenderer(const WebRtc_UWord32 streamId, - const unsigned int zOrder, - const float left, - const float top, - const float right, - const float bottom); + virtual int32_t ConfigureRenderer(const uint32_t streamId, + const unsigned int zOrder, + const float left, + const float top, + const float right, + 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, - const WebRtc_UWord8* text, - const WebRtc_Word32 textLength, - const WebRtc_UWord32 textColorRef, - const WebRtc_UWord32 backgroundColorRef, - const float left, - const float top, - const float right, - const float bottom); + virtual int32_t SetText(const uint8_t textId, + const uint8_t* text, + const int32_t textLength, + const uint32_t textColorRef, + const uint32_t backgroundColorRef, + const float left, + const float top, + const float right, + const float bottom); - virtual WebRtc_Word32 SetBitmap(const void* bitMap, - const WebRtc_UWord8 pictureId, - const void* colorKey, - const float left, - const float top, - const float right, - const float bottom); + virtual int32_t SetBitmap(const void* bitMap, + const uint8_t pictureId, + const void* colorKey, + const float left, + const float top, + const float right, + const float bottom); - virtual WebRtc_Word32 FullScreenRender(void* window, const bool enable); + virtual int32_t FullScreenRender(void* window, const bool enable); private: - WebRtc_Word32 _id; + int32_t _id; CriticalSectionWrapper& _renderMacCocoaCritsect; bool _fullScreen; void* _ptrWindow; diff --git a/webrtc/modules/video_render/mac/video_render_mac_cocoa_impl.mm b/webrtc/modules/video_render/mac/video_render_mac_cocoa_impl.mm index bc5057f8b3..c518c1f033 100644 --- a/webrtc/modules/video_render/mac/video_render_mac_cocoa_impl.mm +++ b/webrtc/modules/video_render/mac/video_render_mac_cocoa_impl.mm @@ -20,7 +20,7 @@ namespace webrtc { -VideoRenderMacCocoaImpl::VideoRenderMacCocoaImpl(const WebRtc_Word32 id, +VideoRenderMacCocoaImpl::VideoRenderMacCocoaImpl(const int32_t id, const VideoRenderType videoRenderType, void* window, const bool fullscreen) : @@ -44,7 +44,7 @@ VideoRenderMacCocoaImpl::~VideoRenderMacCocoaImpl() } } -WebRtc_Word32 +int32_t VideoRenderMacCocoaImpl::Init() { @@ -68,8 +68,8 @@ VideoRenderMacCocoaImpl::Init() return 0; } -WebRtc_Word32 -VideoRenderMacCocoaImpl::ChangeUniqueId(const WebRtc_Word32 id) +int32_t +VideoRenderMacCocoaImpl::ChangeUniqueId(const int32_t id) { CriticalSectionScoped cs(&_renderMacCocoaCritsect); WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, _id, "%s", __FUNCTION__); @@ -83,7 +83,7 @@ VideoRenderMacCocoaImpl::ChangeUniqueId(const WebRtc_Word32 id) return 0; } -WebRtc_Word32 +int32_t VideoRenderMacCocoaImpl::ChangeWindow(void* window) { @@ -104,8 +104,8 @@ VideoRenderMacCocoaImpl::ChangeWindow(void* window) } VideoRenderCallback* -VideoRenderMacCocoaImpl::AddIncomingRenderStream(const WebRtc_UWord32 streamId, - const WebRtc_UWord32 zOrder, +VideoRenderMacCocoaImpl::AddIncomingRenderStream(const uint32_t streamId, + const uint32_t zOrder, const float left, const float top, const float right, @@ -128,8 +128,8 @@ VideoRenderMacCocoaImpl::AddIncomingRenderStream(const WebRtc_UWord32 streamId, } -WebRtc_Word32 -VideoRenderMacCocoaImpl::DeleteIncomingRenderStream(const WebRtc_UWord32 streamId) +int32_t +VideoRenderMacCocoaImpl::DeleteIncomingRenderStream(const uint32_t streamId) { WEBRTC_TRACE(kTraceDebug, kTraceVideoRenderer, _id, "Constructor %s:%d", __FUNCTION__, __LINE__); CriticalSectionScoped cs(&_renderMacCocoaCritsect); @@ -138,9 +138,9 @@ VideoRenderMacCocoaImpl::DeleteIncomingRenderStream(const WebRtc_UWord32 streamI return 0; } -WebRtc_Word32 -VideoRenderMacCocoaImpl::GetIncomingRenderStreamProperties(const WebRtc_UWord32 streamId, - WebRtc_UWord32& zOrder, +int32_t +VideoRenderMacCocoaImpl::GetIncomingRenderStreamProperties(const uint32_t streamId, + uint32_t& zOrder, float& left, float& top, float& right, @@ -149,13 +149,13 @@ VideoRenderMacCocoaImpl::GetIncomingRenderStreamProperties(const WebRtc_UWord32 return _ptrCocoaRender->GetChannelProperties(streamId, zOrder, left, top, right, bottom); } -WebRtc_Word32 +int32_t VideoRenderMacCocoaImpl::StartRender() { return _ptrCocoaRender->StartRender(); } -WebRtc_Word32 +int32_t VideoRenderMacCocoaImpl::StopRender() { return _ptrCocoaRender->StopRender(); @@ -179,18 +179,18 @@ VideoRenderMacCocoaImpl::FullScreen() return false; } -WebRtc_Word32 -VideoRenderMacCocoaImpl::GetGraphicsMemory(WebRtc_UWord64& totalGraphicsMemory, - WebRtc_UWord64& availableGraphicsMemory) const +int32_t +VideoRenderMacCocoaImpl::GetGraphicsMemory(uint64_t& totalGraphicsMemory, + uint64_t& availableGraphicsMemory) const { totalGraphicsMemory = 0; availableGraphicsMemory = 0; return 0; } -WebRtc_Word32 -VideoRenderMacCocoaImpl::GetScreenResolution(WebRtc_UWord32& screenWidth, - WebRtc_UWord32& screenHeight) const +int32_t +VideoRenderMacCocoaImpl::GetScreenResolution(uint32_t& screenWidth, + uint32_t& screenHeight) const { CriticalSectionScoped cs(&_renderMacCocoaCritsect); NSScreen* mainScreen = [NSScreen mainScreen]; @@ -202,15 +202,15 @@ VideoRenderMacCocoaImpl::GetScreenResolution(WebRtc_UWord32& screenWidth, return 0; } -WebRtc_UWord32 -VideoRenderMacCocoaImpl::RenderFrameRate(const WebRtc_UWord32 streamId) +uint32_t +VideoRenderMacCocoaImpl::RenderFrameRate(const uint32_t streamId) { CriticalSectionScoped cs(&_renderMacCocoaCritsect); return 0; } -WebRtc_Word32 -VideoRenderMacCocoaImpl::SetStreamCropping(const WebRtc_UWord32 streamId, +int32_t +VideoRenderMacCocoaImpl::SetStreamCropping(const uint32_t streamId, const float left, const float top, const float right, @@ -219,47 +219,47 @@ VideoRenderMacCocoaImpl::SetStreamCropping(const WebRtc_UWord32 streamId, return 0; } -WebRtc_Word32 VideoRenderMacCocoaImpl::ConfigureRenderer(const WebRtc_UWord32 streamId, - const unsigned int zOrder, - const float left, - const float top, - const float right, - const float bottom) +int32_t VideoRenderMacCocoaImpl::ConfigureRenderer(const uint32_t streamId, + const unsigned int zOrder, + const float left, + const float top, + const float right, + const float bottom) { return 0; } -WebRtc_Word32 +int32_t VideoRenderMacCocoaImpl::SetTransparentBackground(const bool enable) { return 0; } -WebRtc_Word32 VideoRenderMacCocoaImpl::SetText(const WebRtc_UWord8 textId, - const WebRtc_UWord8* text, - const WebRtc_Word32 textLength, - const WebRtc_UWord32 textColorRef, - const WebRtc_UWord32 backgroundColorRef, - const float left, - const float top, - const float right, - const float bottom) +int32_t VideoRenderMacCocoaImpl::SetText(const uint8_t textId, + const uint8_t* text, + const int32_t textLength, + const uint32_t textColorRef, + const uint32_t backgroundColorRef, + const float left, + const float top, + const float right, + const float bottom) { return _ptrCocoaRender->SetText(textId, text, textLength, textColorRef, backgroundColorRef, left, top, right, bottom); } -WebRtc_Word32 VideoRenderMacCocoaImpl::SetBitmap(const void* bitMap, - const WebRtc_UWord8 pictureId, - const void* colorKey, - const float left, - const float top, - const float right, - const float bottom) +int32_t VideoRenderMacCocoaImpl::SetBitmap(const void* bitMap, + const uint8_t pictureId, + const void* colorKey, + const float left, + const float top, + const float right, + const float bottom) { return 0; } -WebRtc_Word32 VideoRenderMacCocoaImpl::FullScreenRender(void* window, const bool enable) +int32_t VideoRenderMacCocoaImpl::FullScreenRender(void* window, const bool enable) { return -1; } diff --git a/webrtc/modules/video_render/mac/video_render_nsopengl.h b/webrtc/modules/video_render/mac/video_render_nsopengl.h index 63e479ba09..3e5af3a4a4 100644 --- a/webrtc/modules/video_render/mac/video_render_nsopengl.h +++ b/webrtc/modules/video_render/mac/video_render_nsopengl.h @@ -63,23 +63,23 @@ public: virtual int UpdateStretchSize(int stretchHeight, int stretchWidth); // ********** new module functions ************ // - virtual WebRtc_Word32 RenderFrame(const WebRtc_UWord32 streamId, - I420VideoFrame& videoFrame); + virtual int32_t RenderFrame(const uint32_t streamId, + I420VideoFrame& videoFrame); // ********** new module helper functions ***** // int ChangeContext(NSOpenGLContext *nsglContext); - WebRtc_Word32 GetChannelProperties(float& left, - float& top, - float& right, - float& bottom); + int32_t GetChannelProperties(float& left, + float& top, + float& right, + float& bottom); private: NSOpenGLContext* _nsglContext; int _id; VideoRenderNSOpenGL* _owner; - WebRtc_Word32 _width; - WebRtc_Word32 _height; + int32_t _width; + int32_t _height; float _startWidth; float _startHeight; float _stopWidth; @@ -123,26 +123,26 @@ public: // methods // ********** new module functions ************ // int ChangeWindow(CocoaRenderView* newWindowRef); - WebRtc_Word32 ChangeUniqueID(WebRtc_Word32 id); - WebRtc_Word32 StartRender(); - WebRtc_Word32 StopRender(); - WebRtc_Word32 DeleteNSGLChannel(const WebRtc_UWord32 streamID); - WebRtc_Word32 GetChannelProperties(const WebRtc_UWord16 streamId, - WebRtc_UWord32& zOrder, - float& left, - float& top, - float& right, - float& bottom); + int32_t ChangeUniqueID(int32_t id); + int32_t StartRender(); + int32_t StopRender(); + int32_t DeleteNSGLChannel(const uint32_t streamID); + int32_t GetChannelProperties(const uint16_t streamId, + uint32_t& zOrder, + float& left, + float& top, + float& right, + float& bottom); - WebRtc_Word32 SetText(const WebRtc_UWord8 textId, - const WebRtc_UWord8* text, - const WebRtc_Word32 textLength, - const WebRtc_UWord32 textColorRef, - const WebRtc_UWord32 backgroundColorRef, - const float left, - const float top, - const float right, - const float bottom); + int32_t SetText(const uint8_t textId, + const uint8_t* text, + const int32_t textLength, + const uint32_t textColorRef, + const uint32_t backgroundColorRef, + const float left, + const float top, + const float right, + const float bottom); // ********** new module helper functions ***** // int configureNSOpenGLEngine(); diff --git a/webrtc/modules/video_render/mac/video_render_nsopengl.mm b/webrtc/modules/video_render/mac/video_render_nsopengl.mm index 69642288e8..5b80bdddfd 100644 --- a/webrtc/modules/video_render/mac/video_render_nsopengl.mm +++ b/webrtc/modules/video_render/mac/video_render_nsopengl.mm @@ -74,10 +74,8 @@ int VideoChannelNSOpenGL::ChangeContext(NSOpenGLContext *nsglContext) } -WebRtc_Word32 VideoChannelNSOpenGL::GetChannelProperties(float& left, - float& top, - float& right, - float& bottom) +int32_t VideoChannelNSOpenGL::GetChannelProperties(float& left, float& top, + float& right, float& bottom) { _owner->LockAGLCntx(); @@ -91,8 +89,8 @@ WebRtc_Word32 VideoChannelNSOpenGL::GetChannelProperties(float& left, return 0; } -WebRtc_Word32 VideoChannelNSOpenGL::RenderFrame( - const WebRtc_UWord32 /*streamId*/, I420VideoFrame& videoFrame) { +int32_t VideoChannelNSOpenGL::RenderFrame( + const uint32_t /*streamId*/, I420VideoFrame& videoFrame) { _owner->LockAGLCntx(); @@ -422,7 +420,7 @@ int VideoRenderNSOpenGL::ChangeWindow(CocoaRenderView* newWindowRef) * If so then they will simply be restarted * If not then create them and continue */ -WebRtc_Word32 VideoRenderNSOpenGL::StartRender() +int32_t VideoRenderNSOpenGL::StartRender() { LockAGLCntx(); @@ -457,7 +455,7 @@ WebRtc_Word32 VideoRenderNSOpenGL::StartRender() UnlockAGLCntx(); return 0; } -WebRtc_Word32 VideoRenderNSOpenGL::StopRender() +int32_t VideoRenderNSOpenGL::StopRender() { LockAGLCntx(); @@ -792,7 +790,7 @@ int VideoRenderNSOpenGL::DeleteAllNSGLChannels() return 0; } -WebRtc_Word32 VideoRenderNSOpenGL::DeleteNSGLChannel(const WebRtc_UWord32 channel) +int32_t VideoRenderNSOpenGL::DeleteNSGLChannel(const uint32_t channel) { CriticalSectionScoped cs(&_nsglContextCritSec); @@ -823,12 +821,12 @@ WebRtc_Word32 VideoRenderNSOpenGL::DeleteNSGLChannel(const WebRtc_UWord32 channe return 0; } -WebRtc_Word32 VideoRenderNSOpenGL::GetChannelProperties(const WebRtc_UWord16 streamId, - WebRtc_UWord32& zOrder, - float& left, - float& top, - float& right, - float& bottom) +int32_t VideoRenderNSOpenGL::GetChannelProperties(const uint16_t streamId, + uint32_t& zOrder, + float& left, + float& top, + float& right, + float& bottom) { 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); @@ -1188,15 +1186,15 @@ WebRtc_Word32 VideoRenderNSOpenGL::ChangeUniqueID(WebRtc_Word32 id) return 0; } -WebRtc_Word32 VideoRenderNSOpenGL::SetText(const WebRtc_UWord8 /*textId*/, - const WebRtc_UWord8* /*text*/, - const WebRtc_Word32 /*textLength*/, - const WebRtc_UWord32 /*textColorRef*/, - const WebRtc_UWord32 /*backgroundColorRef*/, - const float /*left*/, - const float /*top*/, - const float /*right*/, - const float /*bottom*/) +int32_t VideoRenderNSOpenGL::SetText(const uint8_t /*textId*/, + const uint8_t* /*text*/, + const int32_t /*textLength*/, + const uint32_t /*textColorRef*/, + const uint32_t /*backgroundColorRef*/, + const float /*left*/, + const float /*top*/, + const float /*right*/, + const float /*bottom*/) { return 0; diff --git a/webrtc/modules/video_render/test/testAPI/testAPI.cc b/webrtc/modules/video_render/test/testAPI/testAPI.cc index 975453b028..8293b72dc0 100644 --- a/webrtc/modules/video_render/test/testAPI/testAPI.cc +++ b/webrtc/modules/video_render/test/testAPI/testAPI.cc @@ -43,7 +43,7 @@ using namespace webrtc; void GetTestVideoFrame(I420VideoFrame* frame, - WebRtc_UWord8 startColor); + uint8_t startColor); int TestSingleStream(VideoRender* renderModule); int TestFullscreenStream(VideoRender* &renderModule, void* window, @@ -261,8 +261,8 @@ public: { } ; - virtual WebRtc_Word32 RenderFrame(const WebRtc_UWord32 streamId, - I420VideoFrame& videoFrame) + virtual int32_t RenderFrame(const uint32_t streamId, + I420VideoFrame& videoFrame) { _cnt++; if (_cnt % 100 == 0) @@ -271,13 +271,13 @@ public: } return 0; } - WebRtc_Word32 _cnt; + int32_t _cnt; }; void GetTestVideoFrame(I420VideoFrame* frame, - WebRtc_UWord8 startColor) { + uint8_t startColor) { // changing color - static WebRtc_UWord8 color = startColor; + static uint8_t color = startColor; memset(frame->buffer(kYPlane), color, frame->allocated_size(kYPlane)); memset(frame->buffer(kUPlane), color, frame->allocated_size(kUPlane)); @@ -316,7 +316,7 @@ int TestSingleStream(VideoRender* renderModule) { I420VideoFrame videoFrame0; videoFrame0.CreateEmptyFrame(width, height, width, half_width, half_width); - const WebRtc_UWord32 renderDelayMs = 500; + const uint32_t renderDelayMs = 500; for (int i=0; iSetText(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, 1.0f); @@ -390,7 +390,7 @@ int TestBitmapText(VideoRender* renderModule) { I420VideoFrame videoFrame0; videoFrame0.CreateEmptyFrame(width, height, width, half_width, half_width); - const WebRtc_UWord32 renderDelayMs = 500; + const uint32_t renderDelayMs = 500; for (int i=0; irender_time_ms() + KOldRenderTimestampMS < time_now) { WEBRTC_TRACE(kTraceWarning, kTraceVideoRenderer, -1, @@ -119,7 +119,7 @@ I420VideoFrame* VideoRenderFrames::FrameToRender() { return render_frame; } -WebRtc_Word32 VideoRenderFrames::ReturnFrame(I420VideoFrame* old_frame) { +int32_t VideoRenderFrames::ReturnFrame(I420VideoFrame* old_frame) { old_frame->ResetSize(); old_frame->set_timestamp(0); old_frame->set_render_time_ms(0); @@ -127,7 +127,7 @@ WebRtc_Word32 VideoRenderFrames::ReturnFrame(I420VideoFrame* old_frame) { return 0; } -WebRtc_Word32 VideoRenderFrames::ReleaseAllFrames() { +int32_t VideoRenderFrames::ReleaseAllFrames() { while (!incoming_frames_.Empty()) { ListItem* item = incoming_frames_.First(); if (item) { @@ -149,8 +149,8 @@ WebRtc_Word32 VideoRenderFrames::ReleaseAllFrames() { return 0; } -WebRtc_UWord32 VideoRenderFrames::TimeToNextFrameRelease() { - WebRtc_Word64 time_to_release = 0; +uint32_t VideoRenderFrames::TimeToNextFrameRelease() { + int64_t time_to_release = 0; ListItem* item = incoming_frames_.First(); if (item) { I420VideoFrame* oldest_frame = @@ -163,11 +163,11 @@ WebRtc_UWord32 VideoRenderFrames::TimeToNextFrameRelease() { } else { time_to_release = KEventMaxWaitTimeMs; } - return static_cast(time_to_release); + return static_cast(time_to_release); } -WebRtc_Word32 VideoRenderFrames::SetRenderDelay( - const WebRtc_UWord32 render_delay) { +int32_t VideoRenderFrames::SetRenderDelay( + const uint32_t render_delay) { if (render_delay < kMinRenderDelayMs || render_delay > kMaxRenderDelayMs) { WEBRTC_TRACE(kTraceWarning, kTraceVideoRenderer, diff --git a/webrtc/modules/video_render/video_render_frames.h b/webrtc/modules/video_render/video_render_frames.h index 8f3d699b8d..754fe1c795 100644 --- a/webrtc/modules/video_render/video_render_frames.h +++ b/webrtc/modules/video_render/video_render_frames.h @@ -23,22 +23,22 @@ class VideoRenderFrames { ~VideoRenderFrames(); // 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. I420VideoFrame* FrameToRender(); // Return an old frame - WebRtc_Word32 ReturnFrame(I420VideoFrame* old_frame); + int32_t ReturnFrame(I420VideoFrame* old_frame); // Releases all frames - WebRtc_Word32 ReleaseAllFrames(); + int32_t ReleaseAllFrames(); // Returns the number of ms to next frame to render - WebRtc_UWord32 TimeToNextFrameRelease(); + uint32_t TimeToNextFrameRelease(); // Sets estimates delay in renderer - WebRtc_Word32 SetRenderDelay(const WebRtc_UWord32 render_delay); + int32_t SetRenderDelay(const uint32_t render_delay); private: // 10 seconds for 30 fps. @@ -54,7 +54,7 @@ class VideoRenderFrames { ListWrapper empty_frames_; // Estimated delay from a frame is released until it's rendered. - WebRtc_UWord32 render_delay_ms_; + uint32_t render_delay_ms_; }; } // namespace webrtc diff --git a/webrtc/modules/video_render/video_render_impl.cc b/webrtc/modules/video_render/video_render_impl.cc index cce26ba921..a6cff878e1 100644 --- a/webrtc/modules/video_render/video_render_impl.cc +++ b/webrtc/modules/video_render/video_render_impl.cc @@ -66,7 +66,7 @@ namespace webrtc { VideoRender* -VideoRender::CreateVideoRender(const WebRtc_Word32 id, +VideoRender::CreateVideoRender(const int32_t id, void* window, const bool fullscreen, const VideoRenderType videoRenderType/*=kRenderDefault*/) @@ -90,7 +90,7 @@ void VideoRender::DestroyVideoRender( } ModuleVideoRenderImpl::ModuleVideoRenderImpl( - const WebRtc_Word32 id, + const int32_t id, const VideoRenderType videoRenderType, void* window, 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); @@ -325,12 +325,12 @@ WebRtc_Word32 ModuleVideoRenderImpl::ChangeUniqueId(const WebRtc_Word32 id) return 0; } -WebRtc_Word32 ModuleVideoRenderImpl::TimeUntilNextProcess() +int32_t ModuleVideoRenderImpl::TimeUntilNextProcess() { // Not used return 50; } -WebRtc_Word32 ModuleVideoRenderImpl::Process() +int32_t ModuleVideoRenderImpl::Process() { // Not used return 0; @@ -343,7 +343,7 @@ ModuleVideoRenderImpl::Window() return _ptrWindow; } -WebRtc_Word32 ModuleVideoRenderImpl::ChangeWindow(void* window) +int32_t ModuleVideoRenderImpl::ChangeWindow(void* window) { CriticalSectionScoped cs(&_moduleCrit); @@ -398,14 +398,14 @@ WebRtc_Word32 ModuleVideoRenderImpl::ChangeWindow(void* window) #endif } -WebRtc_Word32 ModuleVideoRenderImpl::Id() +int32_t ModuleVideoRenderImpl::Id() { CriticalSectionScoped cs(&_moduleCrit); return _id; } -WebRtc_UWord32 ModuleVideoRenderImpl::GetIncomingFrameRate( - const WebRtc_UWord32 streamId) +uint32_t ModuleVideoRenderImpl::GetIncomingFrameRate( + const uint32_t streamId) { CriticalSectionScoped cs(&_moduleCrit); @@ -430,8 +430,8 @@ WebRtc_UWord32 ModuleVideoRenderImpl::GetIncomingFrameRate( } VideoRenderCallback* -ModuleVideoRenderImpl::AddIncomingRenderStream(const WebRtc_UWord32 streamId, - const WebRtc_UWord32 zOrder, +ModuleVideoRenderImpl::AddIncomingRenderStream(const uint32_t streamId, + const uint32_t zOrder, const float left, const float top, const float right, @@ -494,8 +494,8 @@ ModuleVideoRenderImpl::AddIncomingRenderStream(const WebRtc_UWord32 streamId, return moduleCallback; } -WebRtc_Word32 ModuleVideoRenderImpl::DeleteIncomingRenderStream( - const WebRtc_UWord32 streamId) +int32_t ModuleVideoRenderImpl::DeleteIncomingRenderStream( + const uint32_t streamId) { CriticalSectionScoped cs(&_moduleCrit); @@ -524,8 +524,8 @@ WebRtc_Word32 ModuleVideoRenderImpl::DeleteIncomingRenderStream( return 0; } -WebRtc_Word32 ModuleVideoRenderImpl::AddExternalRenderCallback( - const WebRtc_UWord32 streamId, +int32_t ModuleVideoRenderImpl::AddExternalRenderCallback( + const uint32_t streamId, VideoRenderCallback* renderObject) { CriticalSectionScoped cs(&_moduleCrit); @@ -548,9 +548,9 @@ WebRtc_Word32 ModuleVideoRenderImpl::AddExternalRenderCallback( return ptrIncomingStream->SetExternalCallback(renderObject); } -WebRtc_Word32 ModuleVideoRenderImpl::GetIncomingRenderStreamProperties( - const WebRtc_UWord32 streamId, - WebRtc_UWord32& zOrder, +int32_t ModuleVideoRenderImpl::GetIncomingRenderStreamProperties( + const uint32_t streamId, + uint32_t& zOrder, float& left, float& top, float& right, @@ -570,15 +570,15 @@ WebRtc_Word32 ModuleVideoRenderImpl::GetIncomingRenderStreamProperties( bottom); } -WebRtc_UWord32 ModuleVideoRenderImpl::GetNumIncomingRenderStreams() const +uint32_t ModuleVideoRenderImpl::GetNumIncomingRenderStreams() const { CriticalSectionScoped cs(&_moduleCrit); - return (WebRtc_UWord32) _streamRenderMap.Size(); + return (uint32_t) _streamRenderMap.Size(); } bool ModuleVideoRenderImpl::HasIncomingRenderStream( - const WebRtc_UWord32 streamId) const + const uint32_t streamId) const { CriticalSectionScoped cs(&_moduleCrit); @@ -590,14 +590,14 @@ bool ModuleVideoRenderImpl::HasIncomingRenderStream( return hasStream; } -WebRtc_Word32 ModuleVideoRenderImpl::RegisterRawFrameCallback( - const WebRtc_UWord32 streamId, +int32_t ModuleVideoRenderImpl::RegisterRawFrameCallback( + const uint32_t streamId, VideoRenderCallback* callbackObj) { return -1; } -WebRtc_Word32 ModuleVideoRenderImpl::StartRender(const WebRtc_UWord32 streamId) +int32_t ModuleVideoRenderImpl::StartRender(const uint32_t streamId) { CriticalSectionScoped cs(&_moduleCrit); @@ -630,7 +630,7 @@ WebRtc_Word32 ModuleVideoRenderImpl::StartRender(const WebRtc_UWord32 streamId) return 0; } -WebRtc_Word32 ModuleVideoRenderImpl::StopRender(const WebRtc_UWord32 streamId) +int32_t ModuleVideoRenderImpl::StopRender(const uint32_t streamId) { CriticalSectionScoped cs(&_moduleCrit); @@ -658,11 +658,11 @@ WebRtc_Word32 ModuleVideoRenderImpl::StopRender(const WebRtc_UWord32 streamId) return 0; } -WebRtc_Word32 ModuleVideoRenderImpl::ResetRender() +int32_t ModuleVideoRenderImpl::ResetRender() { CriticalSectionScoped cs(&_moduleCrit); - WebRtc_Word32 error = 0; + int32_t error = 0; // Loop through all incoming streams and stop them MapItem* item = _streamRenderMap.First(); @@ -704,9 +704,9 @@ bool ModuleVideoRenderImpl::IsFullScreen() return _ptrRenderer->FullScreen(); } -WebRtc_Word32 ModuleVideoRenderImpl::GetScreenResolution( - WebRtc_UWord32& screenWidth, - WebRtc_UWord32& screenHeight) const +int32_t ModuleVideoRenderImpl::GetScreenResolution( + uint32_t& screenWidth, + uint32_t& screenHeight) const { CriticalSectionScoped cs(&_moduleCrit); @@ -719,8 +719,8 @@ WebRtc_Word32 ModuleVideoRenderImpl::GetScreenResolution( return _ptrRenderer->GetScreenResolution(screenWidth, screenHeight); } -WebRtc_UWord32 ModuleVideoRenderImpl::RenderFrameRate( - const WebRtc_UWord32 streamId) +uint32_t ModuleVideoRenderImpl::RenderFrameRate( + const uint32_t streamId) { CriticalSectionScoped cs(&_moduleCrit); @@ -733,8 +733,8 @@ WebRtc_UWord32 ModuleVideoRenderImpl::RenderFrameRate( return _ptrRenderer->RenderFrameRate(streamId); } -WebRtc_Word32 ModuleVideoRenderImpl::SetStreamCropping( - const WebRtc_UWord32 streamId, +int32_t ModuleVideoRenderImpl::SetStreamCropping( + const uint32_t streamId, const float left, const float top, const float right, @@ -751,7 +751,7 @@ WebRtc_Word32 ModuleVideoRenderImpl::SetStreamCropping( 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); @@ -764,18 +764,17 @@ WebRtc_Word32 ModuleVideoRenderImpl::SetTransparentBackground(const bool enable) return _ptrRenderer->SetTransparentBackground(enable); } -WebRtc_Word32 ModuleVideoRenderImpl::FullScreenRender(void* window, - const bool enable) +int32_t ModuleVideoRenderImpl::FullScreenRender(void* window, const bool enable) { return -1; } -WebRtc_Word32 ModuleVideoRenderImpl::SetText( - const WebRtc_UWord8 textId, - const WebRtc_UWord8* text, - const WebRtc_Word32 textLength, - const WebRtc_UWord32 textColorRef, - const WebRtc_UWord32 backgroundColorRef, +int32_t ModuleVideoRenderImpl::SetText( + const uint8_t textId, + const uint8_t* text, + const int32_t textLength, + const uint32_t textColorRef, + const uint32_t backgroundColorRef, const float left, const float top, const float right, const float bottom) @@ -792,13 +791,13 @@ WebRtc_Word32 ModuleVideoRenderImpl::SetText( backgroundColorRef, left, top, right, bottom); } -WebRtc_Word32 ModuleVideoRenderImpl::SetBitmap(const void* bitMap, - const WebRtc_UWord8 pictureId, - const void* colorKey, - const float left, - const float top, - const float right, - const float bottom) +int32_t ModuleVideoRenderImpl::SetBitmap(const void* bitMap, + const uint8_t pictureId, + const void* colorKey, + const float left, + const float top, + const float right, + const float bottom) { CriticalSectionScoped cs(&_moduleCrit); @@ -812,8 +811,8 @@ WebRtc_Word32 ModuleVideoRenderImpl::SetBitmap(const void* bitMap, right, bottom); } -WebRtc_Word32 ModuleVideoRenderImpl::GetLastRenderedFrame( - const WebRtc_UWord32 streamId, +int32_t ModuleVideoRenderImpl::GetLastRenderedFrame( + const uint32_t streamId, I420VideoFrame &frame) const { CriticalSectionScoped cs(&_moduleCrit); @@ -845,8 +844,8 @@ WebRtc_Word32 ModuleVideoRenderImpl::GetLastRenderedFrame( return incomingStream->GetLastRenderedFrame(frame); } -WebRtc_Word32 ModuleVideoRenderImpl::SetExpectedRenderDelay( - WebRtc_UWord32 stream_id, WebRtc_Word32 delay_ms) { +int32_t ModuleVideoRenderImpl::SetExpectedRenderDelay( + uint32_t stream_id, int32_t delay_ms) { CriticalSectionScoped cs(&_moduleCrit); if (!_ptrRenderer) { @@ -876,8 +875,8 @@ WebRtc_Word32 ModuleVideoRenderImpl::SetExpectedRenderDelay( return incoming_stream->SetExpectedRenderDelay(delay_ms); } -WebRtc_Word32 ModuleVideoRenderImpl::ConfigureRenderer( - const WebRtc_UWord32 streamId, +int32_t ModuleVideoRenderImpl::ConfigureRenderer( + const uint32_t streamId, const unsigned int zOrder, const float left, const float top, @@ -896,8 +895,8 @@ WebRtc_Word32 ModuleVideoRenderImpl::ConfigureRenderer( bottom); } -WebRtc_Word32 ModuleVideoRenderImpl::SetStartImage( - const WebRtc_UWord32 streamId, +int32_t ModuleVideoRenderImpl::SetStartImage( + const uint32_t streamId, const I420VideoFrame& videoFrame) { CriticalSectionScoped cs(&_moduleCrit); @@ -930,10 +929,10 @@ WebRtc_Word32 ModuleVideoRenderImpl::SetStartImage( } -WebRtc_Word32 ModuleVideoRenderImpl::SetTimeoutImage( - const WebRtc_UWord32 streamId, +int32_t ModuleVideoRenderImpl::SetTimeoutImage( + const uint32_t streamId, const I420VideoFrame& videoFrame, - const WebRtc_UWord32 timeout) + const uint32_t timeout) { CriticalSectionScoped cs(&_moduleCrit); @@ -964,10 +963,10 @@ WebRtc_Word32 ModuleVideoRenderImpl::SetTimeoutImage( return incomingStream->SetTimeoutImage(videoFrame, timeout); } -WebRtc_Word32 ModuleVideoRenderImpl::MirrorRenderStream(const int renderId, - const bool enable, - const bool mirrorXAxis, - const bool mirrorYAxis) +int32_t ModuleVideoRenderImpl::MirrorRenderStream(const int renderId, + const bool enable, + const bool mirrorXAxis, + const bool mirrorYAxis) { CriticalSectionScoped cs(&_moduleCrit); diff --git a/webrtc/modules/video_render/video_render_impl.h b/webrtc/modules/video_render/video_render_impl.h index f5ea951d40..49bd77b855 100644 --- a/webrtc/modules/video_render/video_render_impl.h +++ b/webrtc/modules/video_render/video_render_impl.h @@ -28,7 +28,7 @@ public: /* * VideoRenderer constructor/destructor */ - ModuleVideoRenderImpl(const WebRtc_Word32 id, + ModuleVideoRenderImpl(const int32_t id, const VideoRenderType videoRenderType, void* window, const bool fullscreen); @@ -37,10 +37,10 @@ public: /* * 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 WebRtc_Word32 Process(); + virtual int32_t TimeUntilNextProcess(); + virtual int32_t Process(); /* * Returns the render window @@ -50,12 +50,12 @@ public: /* * Change render window */ - virtual WebRtc_Word32 ChangeWindow(void* window); + virtual int32_t ChangeWindow(void* window); /* * Returns module id */ - WebRtc_Word32 Id(); + int32_t Id(); /************************************************************************** * @@ -67,58 +67,58 @@ public: * Add incoming render stream */ virtual VideoRenderCallback - * AddIncomingRenderStream(const WebRtc_UWord32 streamId, - const WebRtc_UWord32 zOrder, + * AddIncomingRenderStream(const uint32_t streamId, + const uint32_t zOrder, const float left, const float top, const float right, const float bottom); /* * Delete incoming render stream */ - virtual WebRtc_Word32 - DeleteIncomingRenderStream(const WebRtc_UWord32 streamId); + virtual int32_t + DeleteIncomingRenderStream(const uint32_t streamId); /* * Add incoming render callback, used for external rendering */ - virtual WebRtc_Word32 - AddExternalRenderCallback(const WebRtc_UWord32 streamId, + virtual int32_t + AddExternalRenderCallback(const uint32_t streamId, VideoRenderCallback* renderObject); /* * Get the porperties for an incoming render stream */ - virtual WebRtc_Word32 - GetIncomingRenderStreamProperties(const WebRtc_UWord32 streamId, - WebRtc_UWord32& zOrder, + virtual int32_t + GetIncomingRenderStreamProperties(const uint32_t streamId, + uint32_t& zOrder, float& left, float& top, float& right, float& bottom) const; /* * 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 */ - virtual WebRtc_UWord32 GetNumIncomingRenderStreams() const; + virtual uint32_t GetNumIncomingRenderStreams() const; /* * 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 - RegisterRawFrameCallback(const WebRtc_UWord32 streamId, + virtual int32_t + RegisterRawFrameCallback(const uint32_t streamId, VideoRenderCallback* callbackObj); - virtual WebRtc_Word32 GetLastRenderedFrame(const WebRtc_UWord32 streamId, - I420VideoFrame &frame) const; + virtual int32_t GetLastRenderedFrame(const uint32_t streamId, + I420VideoFrame &frame) const; - virtual WebRtc_Word32 SetExpectedRenderDelay(WebRtc_UWord32 stream_id, - WebRtc_Word32 delay_ms); + virtual int32_t SetExpectedRenderDelay(uint32_t stream_id, + int32_t delay_ms); /************************************************************************** * @@ -129,17 +129,17 @@ public: /* * Starts rendering the specified stream */ - virtual WebRtc_Word32 StartRender(const WebRtc_UWord32 streamId); + virtual int32_t StartRender(const uint32_t streamId); /* * 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. */ - virtual WebRtc_Word32 ResetRender(); + virtual int32_t ResetRender(); /************************************************************************** * @@ -160,62 +160,60 @@ public: /* * Gets screen resolution in pixels */ - virtual WebRtc_Word32 - GetScreenResolution(WebRtc_UWord32& screenWidth, - WebRtc_UWord32& screenHeight) const; + virtual int32_t + GetScreenResolution(uint32_t& screenWidth, + uint32_t& screenHeight) const; /* * Get the actual render rate for this stream. I.e rendered frame rate, * 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 */ - virtual WebRtc_Word32 SetStreamCropping(const WebRtc_UWord32 streamId, - const float left, const float top, - const float right, - const float bottom); + virtual int32_t SetStreamCropping(const uint32_t streamId, + const float left, const float top, + const float right, const float bottom); - virtual WebRtc_Word32 ConfigureRenderer(const WebRtc_UWord32 streamId, - const unsigned int zOrder, - const float left, const float top, - const float right, - const float bottom); + virtual int32_t ConfigureRenderer(const uint32_t streamId, + const unsigned int zOrder, + const float left, const float top, + const float right, 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, - const WebRtc_UWord8 pictureId, - const void* colorKey, const float left, - const float top, const float right, - const float bottom); + virtual int32_t SetBitmap(const void* bitMap, + const uint8_t pictureId, + const void* colorKey, + const float left, const float top, + const float right, const float bottom); - virtual WebRtc_Word32 SetText(const WebRtc_UWord8 textId, - const WebRtc_UWord8* text, - const WebRtc_Word32 textLength, - const WebRtc_UWord32 textColorRef, - const WebRtc_UWord32 backgroundColorRef, - const float left, const float top, - const float right, const float bottom); + virtual int32_t SetText(const uint8_t textId, + const uint8_t* text, + const int32_t textLength, + const uint32_t textColorRef, + const uint32_t backgroundColorRef, + const float left, const float top, + const float right, const float bottom); - virtual WebRtc_Word32 SetStartImage(const WebRtc_UWord32 streamId, - const I420VideoFrame& videoFrame); + virtual int32_t SetStartImage(const uint32_t streamId, + const I420VideoFrame& videoFrame); - virtual WebRtc_Word32 SetTimeoutImage(const WebRtc_UWord32 streamId, - const I420VideoFrame& videoFrame, - const WebRtc_UWord32 timeout); + virtual int32_t SetTimeoutImage(const uint32_t streamId, + const I420VideoFrame& videoFrame, + const uint32_t timeout); - virtual WebRtc_Word32 MirrorRenderStream(const int renderId, - const bool enable, - const bool mirrorXAxis, - const bool mirrorYAxis); + virtual int32_t MirrorRenderStream(const int renderId, + const bool enable, + const bool mirrorXAxis, + const bool mirrorYAxis); private: - WebRtc_Word32 _id; + int32_t _id; CriticalSectionWrapper& _moduleCrit; void* _ptrWindow; bool _fullScreen; diff --git a/webrtc/modules/video_render/windows/i_video_render_win.h b/webrtc/modules/video_render/windows/i_video_render_win.h index a765134b47..f9680ba2af 100644 --- a/webrtc/modules/video_render/windows/i_video_render_win.h +++ b/webrtc/modules/video_render/windows/i_video_render_win.h @@ -28,7 +28,7 @@ public: { }; - virtual WebRtc_Word32 Init() = 0; + virtual int32_t Init() = 0; /************************************************************************** * @@ -37,22 +37,20 @@ public: ***************************************************************************/ virtual VideoRenderCallback - * CreateChannel(const WebRtc_UWord32 streamId, - const WebRtc_UWord32 zOrder, + * CreateChannel(const uint32_t streamId, + const uint32_t zOrder, const float left, const float top, const float right, 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, - const WebRtc_UWord16 streamId, - WebRtc_UWord32& zOrder, - float& left, - float& top, - float& right, - float& bottom) = 0; + virtual int32_t GetStreamSettings(const uint32_t channel, + const uint16_t streamId, + uint32_t& zOrder, + float& left, float& top, + 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 WebRtc_Word32 SetCropping(const WebRtc_UWord32 channel, - const WebRtc_UWord16 streamId, + virtual int32_t SetCropping(const uint32_t channel, + 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 top, const float right, const float bottom) = 0; - virtual WebRtc_Word32 ConfigureRenderer(const WebRtc_UWord32 channel, - const WebRtc_UWord16 streamId, - const unsigned int zOrder, - const float left, - const float top, - const float right, - const float bottom) = 0; + virtual int32_t SetTransparentBackground(const bool enable) = 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, - const WebRtc_UWord8* text, - const WebRtc_Word32 textLength, - const WebRtc_UWord32 colorText, - const WebRtc_UWord32 colorBg, - const float left, - const float top, - const float rigth, - const float bottom) = 0; + virtual int32_t SetBitmap(const void* bitMap, + const uint8_t pictureId, + const void* colorKey, + const float left, const float top, + const float right, const float bottom) = 0; - virtual WebRtc_Word32 SetBitmap(const void* bitMap, - const WebRtc_UWord8 pictureId, - const void* colorKey, - const float left, - const float top, - const float right, - const float bottom) = 0; + virtual int32_t ChangeWindow(void* window) = 0; - virtual WebRtc_Word32 ChangeWindow(void* window) = 0; - - virtual WebRtc_Word32 GetGraphicsMemory(WebRtc_UWord64& totalMemory, - WebRtc_UWord64& availableMemory) = 0; + virtual int32_t GetGraphicsMemory(uint64_t& totalMemory, + uint64_t& availableMemory) = 0; }; diff --git a/webrtc/modules/video_render/windows/video_render_direct3d9.cc b/webrtc/modules/video_render/windows/video_render_direct3d9.cc index 60d9902c5b..87a23c350f 100644 --- a/webrtc/modules/video_render/windows/video_render_direct3d9.cc +++ b/webrtc/modules/video_render/windows/video_render_direct3d9.cc @@ -68,8 +68,8 @@ D3D9Channel::~D3D9Channel() } } -void D3D9Channel::SetStreamSettings(WebRtc_UWord16 streamId, - WebRtc_UWord32 zOrder, +void D3D9Channel::SetStreamSettings(uint16_t streamId, + uint32_t zOrder, float startWidth, float startHeight, float stopWidth, @@ -83,8 +83,8 @@ void D3D9Channel::SetStreamSettings(WebRtc_UWord16 streamId, _stopHeight = stopHeight; } -int D3D9Channel::GetStreamSettings(WebRtc_UWord16 streamId, - WebRtc_UWord32& zOrder, +int D3D9Channel::GetStreamSettings(uint16_t streamId, + uint32_t& zOrder, float& startWidth, float& startHeight, float& stopWidth, @@ -142,8 +142,8 @@ int D3D9Channel::FrameSizeChange(int width, int height, int numberOfStreams) return 0; } -WebRtc_Word32 D3D9Channel::RenderFrame(const WebRtc_UWord32 streamId, - I420VideoFrame& videoFrame) +int32_t D3D9Channel::RenderFrame(const uint32_t streamId, + I420VideoFrame& videoFrame) { CriticalSectionScoped cs(_critSect); if (_width != videoFrame.width() || _height != videoFrame.height()) @@ -539,7 +539,7 @@ int VideoRenderDirect3D9::InitDevice() return 0; } -WebRtc_Word32 VideoRenderDirect3D9::Init() +int32_t VideoRenderDirect3D9::Init() { WEBRTC_TRACE(kTraceInfo, kTraceVideo, -1, "VideoRenderDirect3D9::Init"); @@ -570,7 +570,7 @@ WebRtc_Word32 VideoRenderDirect3D9::Init() return InitDevice(); } -WebRtc_Word32 VideoRenderDirect3D9::ChangeWindow(void* window) +int32_t VideoRenderDirect3D9::ChangeWindow(void* window) { WEBRTC_TRACE(kTraceError, kTraceVideo, -1, "Not supported."); return -1; @@ -636,7 +636,7 @@ int VideoRenderDirect3D9::UpdateRenderSurface() textureWidth = channelObj->GetTextureWidth(); textureHeight = channelObj->GetTextureHeight(); - WebRtc_UWord32 zOrder; + uint32_t zOrder; float startWidth, startHeight, stopWidth, stopHeight; channelObj->GetStreamSettings(0, zOrder, startWidth, startHeight, stopWidth, @@ -815,7 +815,7 @@ D3D9Channel* VideoRenderDirect3D9::GetD3DChannel(int channel) return ddobj; } -WebRtc_Word32 VideoRenderDirect3D9::DeleteChannel(const WebRtc_UWord32 streamId) +int32_t VideoRenderDirect3D9::DeleteChannel(const uint32_t streamId) { CriticalSectionScoped cs(&_refD3DCritsect); @@ -843,8 +843,8 @@ WebRtc_Word32 VideoRenderDirect3D9::DeleteChannel(const WebRtc_UWord32 streamId) return -1; } -VideoRenderCallback* VideoRenderDirect3D9::CreateChannel(const WebRtc_UWord32 channel, - const WebRtc_UWord32 zOrder, +VideoRenderCallback* VideoRenderDirect3D9::CreateChannel(const uint32_t channel, + const uint32_t zOrder, const float left, const float top, const float right, @@ -871,13 +871,11 @@ VideoRenderCallback* VideoRenderDirect3D9::CreateChannel(const WebRtc_UWord32 ch return d3dChannel; } -WebRtc_Word32 VideoRenderDirect3D9::GetStreamSettings(const WebRtc_UWord32 channel, - const WebRtc_UWord16 streamId, - WebRtc_UWord32& zOrder, - float& left, - float& top, - float& right, - float& bottom) +int32_t VideoRenderDirect3D9::GetStreamSettings(const uint32_t channel, + const uint16_t streamId, + uint32_t& zOrder, + float& left, float& top, + float& right, float& bottom) { std::map::iterator ddIt; ddIt = _d3dChannels.find(channel & 0x0000ffff); @@ -939,13 +937,13 @@ int VideoRenderDirect3D9::UpdateVerticeBuffer(LPDIRECT3DVERTEXBUFFER9 pVB, return 0; } -WebRtc_Word32 VideoRenderDirect3D9::StartRender() +int32_t VideoRenderDirect3D9::StartRender() { WEBRTC_TRACE(kTraceError, kTraceVideo, -1, "Not supported."); return 0; } -WebRtc_Word32 VideoRenderDirect3D9::StopRender() +int32_t VideoRenderDirect3D9::StopRender() { WEBRTC_TRACE(kTraceError, kTraceVideo, -1, "Not supported."); return 0; @@ -956,45 +954,39 @@ bool VideoRenderDirect3D9::IsFullScreen() return _fullScreen; } -WebRtc_Word32 VideoRenderDirect3D9::SetCropping(const WebRtc_UWord32 channel, - const WebRtc_UWord16 streamId, - const float left, - const float top, - const float right, - const float bottom) +int32_t VideoRenderDirect3D9::SetCropping(const uint32_t channel, + const uint16_t streamId, + const float left, const float top, + const float right, const float bottom) { WEBRTC_TRACE(kTraceError, kTraceVideo, -1, "Not supported."); return 0; } -WebRtc_Word32 VideoRenderDirect3D9::SetTransparentBackground( +int32_t VideoRenderDirect3D9::SetTransparentBackground( const bool enable) { WEBRTC_TRACE(kTraceError, kTraceVideo, -1, "Not supported."); return 0; } -WebRtc_Word32 VideoRenderDirect3D9::SetText(const WebRtc_UWord8 textId, - const WebRtc_UWord8* text, - const WebRtc_Word32 textLength, - const WebRtc_UWord32 colorText, - const WebRtc_UWord32 colorBg, - const float left, - const float top, - const float rigth, - const float bottom) +int32_t VideoRenderDirect3D9::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) { WEBRTC_TRACE(kTraceError, kTraceVideo, -1, "Not supported."); return 0; } -WebRtc_Word32 VideoRenderDirect3D9::SetBitmap(const void* bitMap, - const WebRtc_UWord8 pictureId, - const void* colorKey, - const float left, - const float top, - const float right, - const float bottom) +int32_t VideoRenderDirect3D9::SetBitmap(const void* bitMap, + const uint8_t pictureId, + const void* colorKey, + const float left, const float top, + const float right, const float bottom) { if (!bitMap) { @@ -1141,8 +1133,8 @@ WebRtc_Word32 VideoRenderDirect3D9::SetBitmap(const void* bitMap, } -WebRtc_Word32 VideoRenderDirect3D9::GetGraphicsMemory(WebRtc_UWord64& totalMemory, - WebRtc_UWord64& availableMemory) +int32_t VideoRenderDirect3D9::GetGraphicsMemory(uint64_t& totalMemory, + uint64_t& availableMemory) { if (_totalMemory == -1 || _availableMemory == -1) { @@ -1155,13 +1147,13 @@ WebRtc_Word32 VideoRenderDirect3D9::GetGraphicsMemory(WebRtc_UWord64& totalMemor return 0; } -WebRtc_Word32 VideoRenderDirect3D9::ConfigureRenderer(const WebRtc_UWord32 channel, - const WebRtc_UWord16 streamId, - const unsigned int zOrder, - const float left, - const float top, - const float right, - const float bottom) +int32_t VideoRenderDirect3D9::ConfigureRenderer(const uint32_t channel, + const uint16_t streamId, + const unsigned int zOrder, + const float left, + const float top, + const float right, + const float bottom) { std::map::iterator ddIt; ddIt = _d3dChannels.find(channel & 0x0000ffff); diff --git a/webrtc/modules/video_render/windows/video_render_direct3d9.h b/webrtc/modules/video_render/windows/video_render_direct3d9.h index 7f88d0a528..9688f77ef5 100644 --- a/webrtc/modules/video_render/windows/video_render_direct3d9.h +++ b/webrtc/modules/video_render/windows/video_render_direct3d9.h @@ -45,8 +45,8 @@ public: // A new frame is delivered. virtual int DeliverFrame(const I420VideoFrame& videoFrame); - virtual WebRtc_Word32 RenderFrame(const WebRtc_UWord32 streamId, - I420VideoFrame& videoFrame); + virtual int32_t RenderFrame(const uint32_t streamId, + I420VideoFrame& videoFrame); // Called to check if the video frame is updated. int IsUpdated(bool& isUpdated); @@ -58,14 +58,14 @@ public: int GetTextureWidth(); int GetTextureHeight(); // - void SetStreamSettings(WebRtc_UWord16 streamId, - WebRtc_UWord32 zOrder, + void SetStreamSettings(uint16_t streamId, + uint32_t zOrder, float startWidth, float startHeight, float stopWidth, float stopHeight); - int GetStreamSettings(WebRtc_UWord16 streamId, - WebRtc_UWord32& zOrder, + int GetStreamSettings(uint16_t streamId, + uint32_t& zOrder, float& startWidth, float& startHeight, float& stopWidth, @@ -88,8 +88,8 @@ private: int _height; //sream settings //TODO support multiple streams in one channel - WebRtc_UWord16 _streamId; - WebRtc_UWord32 _zOrder; + uint16_t _streamId; + uint32_t _zOrder; float _startWidth; float _startHeight; float _stopWidth; @@ -110,7 +110,7 @@ public: * Init * ***************************************************************************/ - virtual WebRtc_Word32 Init(); + virtual int32_t Init(); /************************************************************************** * @@ -118,22 +118,20 @@ public: * ***************************************************************************/ virtual VideoRenderCallback - * CreateChannel(const WebRtc_UWord32 streamId, - const WebRtc_UWord32 zOrder, + * CreateChannel(const uint32_t streamId, + const uint32_t zOrder, const float left, const float top, const float right, 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, - const WebRtc_UWord16 streamId, - WebRtc_UWord32& zOrder, - float& left, - float& top, - float& right, - float& bottom); + virtual int32_t GetStreamSettings(const uint32_t channel, + const uint16_t streamId, + uint32_t& zOrder, + float& left, float& top, + float& right, float& bottom); /************************************************************************** * @@ -141,8 +139,8 @@ public: * ***************************************************************************/ - virtual WebRtc_Word32 StartRender(); - virtual WebRtc_Word32 StopRender(); + virtual int32_t StartRender(); + virtual int32_t StopRender(); /************************************************************************** * @@ -152,45 +150,37 @@ public: virtual bool IsFullScreen(); - virtual WebRtc_Word32 SetCropping(const WebRtc_UWord32 channel, - const WebRtc_UWord16 streamId, - const float left, - const float top, - const float right, - const float bottom); + virtual int32_t SetCropping(const uint32_t channel, + const uint16_t streamId, + const float left, const float top, + const float right, const float bottom); - virtual WebRtc_Word32 ConfigureRenderer(const WebRtc_UWord32 channel, - const WebRtc_UWord16 streamId, - const unsigned int zOrder, - const float left, - const float top, - const float right, - const float bottom); + virtual int32_t ConfigureRenderer(const uint32_t channel, + const uint16_t streamId, + const unsigned int zOrder, + const float left, const float top, + 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, - WebRtc_UWord64& availableMemory); + virtual int32_t GetGraphicsMemory(uint64_t& totalMemory, + uint64_t& availableMemory); - virtual WebRtc_Word32 SetText(const WebRtc_UWord8 textId, - const WebRtc_UWord8* text, - const WebRtc_Word32 textLength, - const WebRtc_UWord32 colorText, - const WebRtc_UWord32 colorBg, - const float left, - const float top, - const float rigth, - const float bottom); + 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); - virtual WebRtc_Word32 SetBitmap(const void* bitMap, - const WebRtc_UWord8 pictureId, - const void* colorKey, - const float left, - const float top, - const float right, - const float bottom); + virtual int32_t SetBitmap(const void* bitMap, + const uint8_t pictureId, + const void* colorKey, + const float left, const float top, + const float right, const float bottom); public: // Get a channel by channel id diff --git a/webrtc/modules/video_render/windows/video_render_windows_impl.cc b/webrtc/modules/video_render/windows/video_render_windows_impl.cc index f42714f0c4..686f778cc0 100644 --- a/webrtc/modules/video_render/windows/video_render_windows_impl.cc +++ b/webrtc/modules/video_render/windows/video_render_windows_impl.cc @@ -21,7 +21,7 @@ namespace webrtc { -VideoRenderWindowsImpl::VideoRenderWindowsImpl(const WebRtc_Word32 id, +VideoRenderWindowsImpl::VideoRenderWindowsImpl(const int32_t id, const VideoRenderType videoRenderType, void* window, const bool fullscreen) : _id(id), _renderWindowsCritsect(*CriticalSectionWrapper::CreateCriticalSection()), @@ -41,7 +41,7 @@ VideoRenderWindowsImpl::~VideoRenderWindowsImpl() } } -WebRtc_Word32 VideoRenderWindowsImpl::Init() +int32_t VideoRenderWindowsImpl::Init() { // Create the win renderer switch (_renderMethod) @@ -72,14 +72,14 @@ WebRtc_Word32 VideoRenderWindowsImpl::Init() return -1; } -WebRtc_Word32 VideoRenderWindowsImpl::ChangeUniqueId(const WebRtc_Word32 id) +int32_t VideoRenderWindowsImpl::ChangeUniqueId(const int32_t id) { CriticalSectionScoped cs(&_renderWindowsCritsect); _id = id; return 0; } -WebRtc_Word32 VideoRenderWindowsImpl::ChangeWindow(void* window) +int32_t VideoRenderWindowsImpl::ChangeWindow(void* window) { CriticalSectionScoped cs(&_renderWindowsCritsect); if (!_ptrRendererWin) @@ -93,8 +93,8 @@ WebRtc_Word32 VideoRenderWindowsImpl::ChangeWindow(void* window) } VideoRenderCallback* -VideoRenderWindowsImpl::AddIncomingRenderStream(const WebRtc_UWord32 streamId, - const WebRtc_UWord32 zOrder, +VideoRenderWindowsImpl::AddIncomingRenderStream(const uint32_t streamId, + const uint32_t zOrder, const float left, const float top, const float right, @@ -115,11 +115,11 @@ VideoRenderWindowsImpl::AddIncomingRenderStream(const WebRtc_UWord32 streamId, return renderCallback; } -WebRtc_Word32 VideoRenderWindowsImpl::DeleteIncomingRenderStream( - const WebRtc_UWord32 streamId) +int32_t VideoRenderWindowsImpl::DeleteIncomingRenderStream( + const uint32_t streamId) { CriticalSectionScoped cs(&_renderWindowsCritsect); - WebRtc_Word32 error = -1; + int32_t error = -1; if (!_ptrRendererWin) { } @@ -130,9 +130,9 @@ WebRtc_Word32 VideoRenderWindowsImpl::DeleteIncomingRenderStream( return error; } -WebRtc_Word32 VideoRenderWindowsImpl::GetIncomingRenderStreamProperties( - const WebRtc_UWord32 streamId, - WebRtc_UWord32& zOrder, +int32_t VideoRenderWindowsImpl::GetIncomingRenderStreamProperties( + const uint32_t streamId, + uint32_t& zOrder, float& left, float& top, float& right, @@ -145,7 +145,7 @@ WebRtc_Word32 VideoRenderWindowsImpl::GetIncomingRenderStreamProperties( right = 0; bottom = 0; - WebRtc_Word32 error = -1; + int32_t error = -1; if (!_ptrRendererWin) { } @@ -157,10 +157,10 @@ WebRtc_Word32 VideoRenderWindowsImpl::GetIncomingRenderStreamProperties( return error; } -WebRtc_Word32 VideoRenderWindowsImpl::StartRender() +int32_t VideoRenderWindowsImpl::StartRender() { CriticalSectionScoped cs(&_renderWindowsCritsect); - WebRtc_Word32 error = -1; + int32_t error = -1; if (!_ptrRendererWin) { } @@ -171,10 +171,10 @@ WebRtc_Word32 VideoRenderWindowsImpl::StartRender() return error; } -WebRtc_Word32 VideoRenderWindowsImpl::StopRender() +int32_t VideoRenderWindowsImpl::StopRender() { CriticalSectionScoped cs(&_renderWindowsCritsect); - WebRtc_Word32 error = -1; + int32_t error = -1; if (!_ptrRendererWin) { } @@ -209,9 +209,9 @@ bool VideoRenderWindowsImpl::FullScreen() return fullscreen; } -WebRtc_Word32 VideoRenderWindowsImpl::GetGraphicsMemory( - WebRtc_UWord64& totalGraphicsMemory, - WebRtc_UWord64& availableGraphicsMemory) const +int32_t VideoRenderWindowsImpl::GetGraphicsMemory( + uint64_t& totalGraphicsMemory, + uint64_t& availableGraphicsMemory) const { if (_ptrRendererWin) { @@ -224,9 +224,9 @@ WebRtc_Word32 VideoRenderWindowsImpl::GetGraphicsMemory( return -1; } -WebRtc_Word32 VideoRenderWindowsImpl::GetScreenResolution( - WebRtc_UWord32& screenWidth, - WebRtc_UWord32& screenHeight) const +int32_t VideoRenderWindowsImpl::GetScreenResolution( + uint32_t& screenWidth, + uint32_t& screenHeight) const { CriticalSectionScoped cs(&_renderWindowsCritsect); screenWidth = 0; @@ -234,22 +234,22 @@ WebRtc_Word32 VideoRenderWindowsImpl::GetScreenResolution( return 0; } -WebRtc_UWord32 VideoRenderWindowsImpl::RenderFrameRate( - const WebRtc_UWord32 streamId) +uint32_t VideoRenderWindowsImpl::RenderFrameRate( + const uint32_t streamId) { CriticalSectionScoped cs(&_renderWindowsCritsect); return 0; } -WebRtc_Word32 VideoRenderWindowsImpl::SetStreamCropping( - const WebRtc_UWord32 streamId, +int32_t VideoRenderWindowsImpl::SetStreamCropping( + const uint32_t streamId, const float left, const float top, const float right, const float bottom) { CriticalSectionScoped cs(&_renderWindowsCritsect); - WebRtc_Word32 error = -1; + int32_t error = -1; if (!_ptrRendererWin) { } @@ -261,8 +261,8 @@ WebRtc_Word32 VideoRenderWindowsImpl::SetStreamCropping( return error; } -WebRtc_Word32 VideoRenderWindowsImpl::ConfigureRenderer( - const WebRtc_UWord32 streamId, +int32_t VideoRenderWindowsImpl::ConfigureRenderer( + const uint32_t streamId, const unsigned int zOrder, const float left, const float top, @@ -270,7 +270,7 @@ WebRtc_Word32 VideoRenderWindowsImpl::ConfigureRenderer( const float bottom) { CriticalSectionScoped cs(&_renderWindowsCritsect); - WebRtc_Word32 error = -1; + int32_t error = -1; if (!_ptrRendererWin) { } @@ -283,11 +283,11 @@ WebRtc_Word32 VideoRenderWindowsImpl::ConfigureRenderer( return error; } -WebRtc_Word32 VideoRenderWindowsImpl::SetTransparentBackground( +int32_t VideoRenderWindowsImpl::SetTransparentBackground( const bool enable) { CriticalSectionScoped cs(&_renderWindowsCritsect); - WebRtc_Word32 error = -1; + int32_t error = -1; if (!_ptrRendererWin) { } @@ -298,19 +298,19 @@ WebRtc_Word32 VideoRenderWindowsImpl::SetTransparentBackground( return error; } -WebRtc_Word32 VideoRenderWindowsImpl::SetText( - const WebRtc_UWord8 textId, - const WebRtc_UWord8* text, - const WebRtc_Word32 textLength, - const WebRtc_UWord32 textColorRef, - const WebRtc_UWord32 backgroundColorRef, +int32_t VideoRenderWindowsImpl::SetText( + const uint8_t textId, + const uint8_t* text, + const int32_t textLength, + const uint32_t textColorRef, + const uint32_t backgroundColorRef, const float left, const float top, const float right, const float bottom) { CriticalSectionScoped cs(&_renderWindowsCritsect); - WebRtc_Word32 error = -1; + int32_t error = -1; if (!_ptrRendererWin) { } @@ -323,16 +323,14 @@ WebRtc_Word32 VideoRenderWindowsImpl::SetText( return error; } -WebRtc_Word32 VideoRenderWindowsImpl::SetBitmap(const void* bitMap, - const WebRtc_UWord8 pictureId, - const void* colorKey, - const float left, - const float top, - const float right, - const float bottom) +int32_t VideoRenderWindowsImpl::SetBitmap(const void* bitMap, + const uint8_t pictureId, + const void* colorKey, + const float left, const float top, + const float right, const float bottom) { CriticalSectionScoped cs(&_renderWindowsCritsect); - WebRtc_Word32 error = -1; + int32_t error = -1; if (!_ptrRendererWin) { } diff --git a/webrtc/modules/video_render/windows/video_render_windows_impl.h b/webrtc/modules/video_render/windows/video_render_windows_impl.h index 0d4c15f613..ec730fead8 100644 --- a/webrtc/modules/video_render/windows/video_render_windows_impl.h +++ b/webrtc/modules/video_render/windows/video_render_windows_impl.h @@ -34,17 +34,17 @@ public: * Constructor/destructor */ - VideoRenderWindowsImpl(const WebRtc_Word32 id, + VideoRenderWindowsImpl(const int32_t id, const VideoRenderType videoRenderType, void* window, const bool fullscreen); 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 - * AddIncomingRenderStream(const WebRtc_UWord32 streamId, - const WebRtc_UWord32 zOrder, + * AddIncomingRenderStream(const uint32_t streamId, + const uint32_t zOrder, const float left, const float top, const float right, 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, - WebRtc_UWord32& zOrder, + virtual int32_t + GetIncomingRenderStreamProperties(const uint32_t streamId, + uint32_t& zOrder, float& left, float& top, 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 WebRtc_Word32 - GetGraphicsMemory(WebRtc_UWord64& totalGraphicsMemory, - WebRtc_UWord64& availableGraphicsMemory) const; + virtual int32_t + GetGraphicsMemory(uint64_t& totalGraphicsMemory, + uint64_t& availableGraphicsMemory) const; - virtual WebRtc_Word32 - GetScreenResolution(WebRtc_UWord32& screenWidth, - WebRtc_UWord32& screenHeight) const; + virtual int32_t + GetScreenResolution(uint32_t& screenWidth, + 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, - const float left, const float top, - const float right, - const float bottom); + virtual int32_t SetStreamCropping(const uint32_t streamId, + const float left, const float top, + const float right, const float bottom); - virtual WebRtc_Word32 ConfigureRenderer(const WebRtc_UWord32 streamId, - const unsigned int zOrder, - const float left, const float top, - const float right, - const float bottom); + virtual int32_t ConfigureRenderer(const uint32_t streamId, + const unsigned int zOrder, + const float left, const float top, + const float right, 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, - const WebRtc_UWord8* text, - const WebRtc_Word32 textLength, - const WebRtc_UWord32 textColorRef, - const WebRtc_UWord32 backgroundColorRef, - const float left, const float top, - const float right, const float bottom); + virtual int32_t SetText(const uint8_t textId, + const uint8_t* text, + const int32_t textLength, + const uint32_t textColorRef, + const uint32_t backgroundColorRef, + const float left, const float top, + const float right, const float bottom); - virtual WebRtc_Word32 SetBitmap(const void* bitMap, - const WebRtc_UWord8 pictureId, - const void* colorKey, const float left, - const float top, const float right, - const float bottom); + virtual int32_t SetBitmap(const void* bitMap, + const uint8_t pictureId, + const void* colorKey, + const float left, const float top, + const float right, const float bottom); private: - WebRtc_Word32 _id; + int32_t _id; CriticalSectionWrapper& _renderWindowsCritsect; void* _prtWindow;