From ec74e66eb71af86f946dfe08bcb633fb0a24802c Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Tue, 28 Nov 2017 14:47:06 +0100 Subject: [PATCH] Fix ogl render. --- src/c-wrapper/api/c-call.cpp | 10 +--------- src/call/call.cpp | 6 ++++++ src/call/call.h | 1 + src/conference/session/media-session-p.h | 1 + src/conference/session/media-session.cpp | 8 ++++++++ src/conference/session/media-session.h | 1 + 6 files changed, 18 insertions(+), 9 deletions(-) diff --git a/src/c-wrapper/api/c-call.cpp b/src/c-wrapper/api/c-call.cpp index 2294b527b..2630d627d 100644 --- a/src/c-wrapper/api/c-call.cpp +++ b/src/c-wrapper/api/c-call.cpp @@ -1056,15 +1056,7 @@ bool_t linphone_call_media_in_progress (const LinphoneCall *call) { } void linphone_call_ogl_render (const LinphoneCall *call) { -#if 0 - #ifdef VIDEO_ENABLED - - VideoStream *stream = call->videostream; - if (stream && stream->output && ms_filter_get_id(stream->output) == MS_OGL_ID) - ms_filter_call_method(stream->output, MS_OGL_RENDER, nullptr); - - #endif -#endif + L_GET_CPP_PTR_FROM_C_OBJECT(call)->oglRender(); } LinphoneStatus linphone_call_send_info_message (LinphoneCall *call, const LinphoneInfoMessage *info) { diff --git a/src/call/call.cpp b/src/call/call.cpp index d68a20330..b353d2a44 100644 --- a/src/call/call.cpp +++ b/src/call/call.cpp @@ -17,6 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#include "c-wrapper/c-wrapper.h" #include "call-p.h" #include "conference/local-conference.h" #include "conference/participant-p.h" @@ -276,6 +277,11 @@ LinphoneStatus Call::decline (const LinphoneErrorInfo *ei) { return d->getActiveSession()->decline(ei); } +void Call::oglRender () const { + L_D(); + static_pointer_cast(d->getActiveSession())->getPrivate()->oglRender(); +} + LinphoneStatus Call::pause () { L_D(); return static_cast(d->getActiveSession().get())->pause(); diff --git a/src/call/call.h b/src/call/call.h index fee720d5a..ca48c4826 100644 --- a/src/call/call.h +++ b/src/call/call.h @@ -53,6 +53,7 @@ public: LinphoneStatus acceptUpdate (const MediaSessionParams *msp); LinphoneStatus decline (LinphoneReason reason); LinphoneStatus decline (const LinphoneErrorInfo *ei); + void oglRender () const; LinphoneStatus pause (); LinphoneStatus redirect (const std::string &redirectUri); LinphoneStatus resume (); diff --git a/src/conference/session/media-session-p.h b/src/conference/session/media-session-p.h index f47fb3a40..b512e9ec1 100644 --- a/src/conference/session/media-session-p.h +++ b/src/conference/session/media-session-p.h @@ -54,6 +54,7 @@ public: void updating (bool isUpdate) override; void enableSymmetricRtp (bool value); + void oglRender () const; void sendVfu (); void clearIceCheckList (IceCheckList *cl); diff --git a/src/conference/session/media-session.cpp b/src/conference/session/media-session.cpp index f37983a33..2a4c85ab5 100644 --- a/src/conference/session/media-session.cpp +++ b/src/conference/session/media-session.cpp @@ -40,6 +40,7 @@ #include #include #include +#include #include #include #include @@ -457,6 +458,13 @@ void MediaSessionPrivate::enableSymmetricRtp (bool value) { } } +void MediaSessionPrivate::oglRender () const { +#ifdef VIDEO_ENABLED + if (videoStream && videoStream->output && (ms_filter_get_id(videoStream->output) == MS_OGL_ID)) + ms_filter_call_method(videoStream->output, MS_OGL_RENDER, nullptr); +#endif +} + void MediaSessionPrivate::sendVfu () { #ifdef VIDEO_ENABLED if (videoStream) diff --git a/src/conference/session/media-session.h b/src/conference/session/media-session.h index 2ef160ab5..ef3ca87c2 100644 --- a/src/conference/session/media-session.h +++ b/src/conference/session/media-session.h @@ -32,6 +32,7 @@ class IceAgent; class MediaSessionPrivate; class LINPHONE_PUBLIC MediaSession : public CallSession { + friend class Call; friend class CallPrivate; friend class IceAgent;