Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev/3.3.1 #136

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -111,25 +111,20 @@ public void onJoinChannelSuccess(String channel, int uid, int elapsed) {

@Override
public void onUserJoined(int uid, int elapsed) {
// Do nothing at the moment
}

@Override
public void onUserOffline(final int uid, int reason) {
runOnUiThread(new Runnable() {
@Override
public void run() {
removeRemoteUser(uid);
renderRemoteUser(uid);
}
});
}

@Override
public void onFirstRemoteVideoDecoded(final int uid, int width, int height, int elapsed) {
public void onUserOffline(final int uid, int reason) {
runOnUiThread(new Runnable() {
@Override
public void run() {
renderRemoteUser(uid);
removeRemoteUser(uid);
}
});
}
14 changes: 0 additions & 14 deletions OpenLive-Windows-MFC/OpenLive/AGEngineEventHandler.cpp
Original file line number Diff line number Diff line change
@@ -186,20 +186,6 @@ void CAGEngineEventHandler::onFirstLocalVideoFrame(int width, int height, int el

}

void CAGEngineEventHandler::onFirstRemoteVideoDecoded(uid_t uid, int width, int height, int elapsed)
{
LPAGE_FIRST_REMOTE_VIDEO_DECODED lpData = new AGE_FIRST_REMOTE_VIDEO_DECODED;

lpData->uid = uid;
lpData->width = width;
lpData->height = height;
lpData->elapsed = elapsed;

if(m_hMainWnd != NULL)
::PostMessage(m_hMainWnd, WM_MSGID(EID_FIRST_REMOTE_VIDEO_DECODED), (WPARAM)lpData, 0);

}

void CAGEngineEventHandler::onFirstRemoteVideoFrame(uid_t uid, int width, int height, int elapsed)
{
LPAGE_FIRST_REMOTE_VIDEO_FRAME lpData = new AGE_FIRST_REMOTE_VIDEO_FRAME;
1 change: 0 additions & 1 deletion OpenLive-Windows-MFC/OpenLive/AGEngineEventHandler.h
Original file line number Diff line number Diff line change
@@ -27,7 +27,6 @@ class CAGEngineEventHandler :

virtual void onNetworkQuality(uid_t uid, int txQuality, int rxQuality) override;
virtual void onFirstLocalVideoFrame(int width, int height, int elapsed) override;
virtual void onFirstRemoteVideoDecoded(uid_t uid, int width, int height, int elapsed) override;
virtual void onFirstRemoteVideoFrame(uid_t uid, int width, int height, int elapsed) override;
virtual void onUserJoined(uid_t uid, int elapsed) override;
virtual void onUserOffline(uid_t uid, USER_OFFLINE_REASON_TYPE reason) override;
30 changes: 3 additions & 27 deletions OpenLive-Windows-MFC/OpenLive/VideoDlg.cpp
Original file line number Diff line number Diff line change
@@ -53,7 +53,6 @@ BEGIN_MESSAGE_MAP(CVideoDlg, CDialogEx)
ON_MESSAGE(WM_MSGID(EID_REJOINCHANNEL_SUCCESS), &CVideoDlg::OnEIDReJoinChannelSuccess)
ON_MESSAGE(WM_MSGID(EID_FIRST_LOCAL_VIDEO_FRAME), &CVideoDlg::OnEIDFirstLocalFrame)

ON_MESSAGE(WM_MSGID(EID_FIRST_REMOTE_VIDEO_DECODED), &CVideoDlg::OnEIDFirstRemoteFrameDecoded)
ON_MESSAGE(WM_MSGID(EID_FIRST_REMOTE_VIDEO_FRAME), &CVideoDlg::OnEIDFirstRemoteVideoFrame)

ON_MESSAGE(WM_MSGID(EID_USER_JOINED),&CVideoDlg::OnEIDUserJoined)
@@ -1107,31 +1106,6 @@ LRESULT CVideoDlg::OnEIDFirstLocalFrame(WPARAM wParam, LPARAM lParam)
return 0;
}

LRESULT CVideoDlg::OnEIDFirstRemoteFrameDecoded(WPARAM wParam, LPARAM lParam)
{
LPAGE_FIRST_REMOTE_VIDEO_DECODED lpData = (LPAGE_FIRST_REMOTE_VIDEO_DECODED)wParam;
POSITION pos = m_listWndInfo.GetHeadPosition();
while (pos != NULL) {
AGVIDEO_WNDINFO &agvWndInfo = m_listWndInfo.GetNext(pos);
if (agvWndInfo.nUID == lpData->uid) {
agvWndInfo.nWidth = lpData->width;
agvWndInfo.nHeight = lpData->height;
break;
}
}

RebindVideoWnd();

SEI_INFO seiInfo;
memset(&seiInfo, 0, sizeof(SEI_INFO));
seiInfo.nUID = lpData->uid;
seiInfo.nWidth = lpData->width;
seiInfo.nHeight = lpData->height;
CAgoraObject::GetAgoraObject()->SetSEIInfo(seiInfo.nUID, &seiInfo);
delete lpData;
lpData = NULL;
return false;
}

LRESULT CVideoDlg::OnEIDFirstRemoteVideoFrame(WPARAM wParam, LPARAM lParam)
{
@@ -1162,9 +1136,11 @@ LRESULT CVideoDlg::OnEIDUserJoined(WPARAM wParam, LPARAM lParam)
agvWndInfo.nUID = lpData->uid;
m_listWndInfo.AddTail(agvWndInfo);
}
RebindVideoWnd();

delete lpData;

delete lpData;
lpData = NULL;
return 0;
}

2 changes: 1 addition & 1 deletion OpenLive-Windows-MFC/OpenLive/VideoDlg.h
Original file line number Diff line number Diff line change
@@ -71,7 +71,7 @@ class CVideoDlg : public CDialogEx
afx_msg LRESULT OnEIDReJoinChannelSuccess(WPARAM wParam, LPARAM lParam);

afx_msg LRESULT OnEIDFirstLocalFrame(WPARAM wParam, LPARAM lParam);
afx_msg LRESULT OnEIDFirstRemoteFrameDecoded(WPARAM wParam, LPARAM lParam);

afx_msg LRESULT OnEIDFirstRemoteVideoFrame(WPARAM wParam, LPARAM lParam);
afx_msg LRESULT OnEIDUserJoined(WPARAM wParam, LPARAM lParam);
afx_msg LRESULT OnEIDUserOffline(WPARAM wParam, LPARAM lParam);
5 changes: 1 addition & 4 deletions OpenLive-Windows/agoraobject.cpp
Original file line number Diff line number Diff line change
@@ -37,10 +37,7 @@ class AgoraRtcEngineEvent : public agora::rtc::IRtcEngineEventHandler
{
emit m_pInstance.sender_firstRemoteVideoDecoded(uid, width, height, elapsed);
}
virtual void onFirstRemoteVideoFrame(uid_t uid, int width, int height, int elapsed) override
{
emit m_pInstance.sender_firstRemoteVideoFrameDrawn(uid, width, height, elapsed);
}

virtual void onLocalVideoStats(const LocalVideoStats &stats) override
{
emit m_pInstance.sender_localVideoStats(stats);
8 changes: 8 additions & 0 deletions OpenLive-iOS/OpenLive/LiveRoomViewController.swift
Original file line number Diff line number Diff line change
@@ -304,6 +304,14 @@ extension LiveRoomViewController: AgoraRtcEngineDelegate {

let userSession = videoSession(of: uid)
userSession.updateInfo(resolution: size)
}

func rtcEngine(_ engine: AgoraRtcEngineKit, didJoinedOfUid uid: UInt, elapsed: Int) {
guard videoSessions.count <= maxVideoSession else {
return
}

let userSession = videoSession(of: uid)
agoraKit.setupRemoteVideo(userSession.canvas)
}

4 changes: 4 additions & 0 deletions OpenLive-macOS/OpenLive/RoomViewController.swift
Original file line number Diff line number Diff line change
@@ -485,6 +485,10 @@ extension RoomViewController: AgoraRtcEngineDelegate {
func rtcEngine(_ engine: AgoraRtcEngineKit, firstRemoteVideoDecodedOfUid uid: UInt, size: CGSize, elapsed: Int) {
let userSession = videoSession(of: uid)
userSession.updateInfo(resolution: size)
}

func rtcEngine(_ engine: AgoraRtcEngineKit, didJoinedOfUid uid: UInt, elapsed: Int) {
let userSession = videoSession(of: uid)
agoraKit.setupRemoteVideo(userSession.canvas)
}