Skip to content

Commit 0610e2a

Browse files
committed
csd-14707
1 parent 2f0645b commit 0610e2a

9 files changed

Lines changed: 62 additions & 30 deletions

File tree

OpenLive-Windows/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,3 +352,4 @@ ASALocalRun/
352352
*.exe
353353
*.out
354354
*.app
355+
sdk/

OpenLive-Windows/OpenLive/AGEngineEventHandler.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,4 +320,11 @@ void CAGEngineEventHandler::onConnectionInterrupted()
320320

321321
void CAGEngineEventHandler::onUserEnableVideo(uid_t uid, bool enabled)
322322
{
323+
}
324+
325+
void CAGEngineEventHandler::onLastmileQuality(int quality)
326+
{
327+
if (m_hMainWnd != NULL)
328+
::PostMessage(m_hMainWnd, WM_MSGID(EID_LASTMILE_QUALITY), quality, 0);
329+
323330
}

OpenLive-Windows/OpenLive/AGEngineEventHandler.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ class CAGEngineEventHandler :
4343
virtual void onConnectionInterrupted() override;
4444

4545
virtual void onUserEnableVideo(uid_t uid, bool enabled) override;
46+
47+
virtual void onLastmileQuality(int quality)override;
4648
private:
4749
HWND m_hMainWnd;
4850
};

OpenLive-Windows/OpenLive/AGEventDef.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,5 +243,5 @@ typedef struct _AGE_APICALL_EXECUTED
243243

244244
#define EID_APICALL_EXECUTED 0x00000020
245245

246-
246+
#define EID_LASTMILE_QUALITY 0x00000021
247247
#endif

OpenLive-Windows/OpenLive/OpenLiveDlg.cpp

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ BEGIN_MESSAGE_MAP(COpenLiveDlg, CDialogEx)
8484
ON_MESSAGE(WM_MSGID(EID_NETWORK_QUALITY), &COpenLiveDlg::OnNetworkQuality)
8585
ON_MESSAGE(WM_MSGID(EID_APICALL_EXECUTED), &COpenLiveDlg::OnEIDApiExecuted)
8686
ON_MESSAGE(WM_MSGID(EID_ERROR), &COpenLiveDlg::OnEIDError)
87-
87+
ON_MESSAGE(WM_MSGID(EID_LASTMILE_QUALITY), &COpenLiveDlg::OnLastMileQuality)
8888
ON_MESSAGE(WM_MSGID(EID_LEAVE_CHANNEL), &COpenLiveDlg::OnEIDLeaveChannel)
8989
ON_WM_CLOSE()
9090
END_MESSAGE_MAP()
@@ -153,6 +153,7 @@ BOOL COpenLiveDlg::OnInitDialog()
153153
m_lpAgoraObject->SetMsgHandlerWnd(GetSafeHwnd());
154154
CAgoraObject::GetEngine()->setChannelProfile(CHANNEL_PROFILE_LIVE_BROADCASTING);
155155
CAgoraObject::GetAgoraObject()->EnableVideo(TRUE);
156+
CAgoraObject::GetAgoraObject()->EnableLastmileTest(TRUE);
156157
CAgoraObject::GetAgoraObject()->SetClientRole(CLIENT_ROLE_BROADCASTER);
157158

158159
SetBackgroundImage(IDB_DLG_MAIN);
@@ -339,7 +340,7 @@ LRESULT COpenLiveDlg::OnJoinChannel(WPARAM wParam, LPARAM lParam)
339340
{
340341
IRtcEngine *lpRtcEngine = CAgoraObject::GetEngine();
341342
CAgoraObject *lpAgoraObject = CAgoraObject::GetAgoraObject();
342-
343+
lpAgoraObject->EnableLastmileTest(FALSE);
343344
CString strChannelName = m_dlgEnterChannel.GetChannelName();
344345

345346
m_dlgVideo.MoveWindow(0, 0, 960, 720, 1);
@@ -430,3 +431,16 @@ LRESULT COpenLiveDlg::OnEIDLeaveChannel(WPARAM wParam, LPARAM lParam)
430431
lpData = NULL;
431432
return 0;
432433
}
434+
435+
436+
437+
LRESULT COpenLiveDlg::OnLastMileQuality(WPARAM wParam, LPARAM lParam)
438+
{
439+
int quality = wParam;
440+
441+
if (m_nNetworkQuality != quality) {
442+
m_nNetworkQuality = quality;
443+
InvalidateRect(CRect(16, 40, 48, 72), TRUE);
444+
}
445+
return 0;
446+
}

OpenLive-Windows/OpenLive/OpenLiveDlg.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ class COpenLiveDlg : public CDialogEx
4848
afx_msg LRESULT OnEIDApiExecuted(WPARAM wParam, LPARAM lParam);
4949
afx_msg LRESULT OnEIDError(WPARAM wParam, LPARAM lParam);
5050
afx_msg LRESULT OnEIDLeaveChannel(WPARAM wParam, LPARAM lParam);
51+
afx_msg LRESULT OnLastMileQuality(WPARAM wParam, LPARAM lParam);
5152
DECLARE_MESSAGE_MAP()
5253

5354
protected:

OpenLive-Windows/OpenLive/VideoDlg.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,8 @@ void CVideoDlg::OnBnClickedBtnclose()
362362
CAgoraObject::GetAgoraObject()->MuteLocalAudio(FALSE);
363363
m_btnAudio.SwitchButtonStatus(CAGButton::AGBTN_NORMAL);
364364

365-
CAgoraObject::GetAgoraObject()->EnableScreenCapture(NULL, 0, NULL, FALSE);
365+
if (CAgoraObject::GetAgoraObject()->IsScreenCaptureEnabled())
366+
CAgoraObject::GetAgoraObject()->EnableScreenCapture(NULL, 0, NULL, FALSE);
366367
m_btnScrCap.SwitchButtonStatus(CAGButton::AGBTN_NORMAL);
367368

368369
m_dlgChat.ShowWindow(SW_HIDE);

OpenLive-Windows/README.md

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Open Live Windows
1+
# Open Live Windows
22

33
*其他语言版本: [简体中文](README.zh.md)*
44

@@ -16,35 +16,42 @@ This demo is written in **C++**
1616

1717
A tutorial demo can be found here: [Agora-Windows-Tutorial-1to1](https://github.com/AgoraIO/Basic-Video-Call/tree/master/One-to-One-Video/Agora-Windows-Tutorial-1to1)
1818

19-
## Running the App
19+
20+
## Developer Environment Requirements
21+
* VC++ 2013(or higher)
22+
* Windows 7(or higher)
23+
24+
## Running the sample program
2025
First, create a developer account at [Agora.io](https://dashboard.agora.io/signin/), and obtain an App ID. define the APP_ID with your App ID.
2126

22-
#define APP_ID _T("Your App ID")
27+
#define APP_ID _T("Your App ID")
2328

2429
If you don't want to modify the code part, you can create an AppId.ini file under Debug/Release. Modify the appId value to the App ID you just applied.
2530

26-
#[AppID]
27-
28-
#AppID=xxxxxxxxxxxxxxxxxxx
31+
[AppID]
32+
AppID=xxxxxxxxxxxxxxxxxxx
2933

3034
Next, download the **Agora Video SDK** from [Agora.io SDK](https://www.agora.io/en/download/). Unzip the downloaded SDK package and copy the **sdk** to the project folder(the old one may be over written).
3135

3236
Finally, Open OpenLive.sln with your VC++ 2013(or higher) and build all solution and run.
3337

34-
Note:
38+
**Note:**
39+
3540
1. After the program is compiled, if the program "xxx\xxx\xxx\Debug\Language\English.dll" cannot be started when running the program,
3641
please select the OpenLive project in the Solution Explorer and right click. In the pop-up menu bar, select "Set as startup project" to solve. Then run the program again.
3742
2. You may encounter crash when running this demo under debug mode. Please run this demo under release mode.
38-
39-
## Developer Environment Requirements
40-
* VC++ 2013(or higher)
41-
* Windows 7(or higher)
4243

43-
## Connect Us
4444

45+
## Contact us
46+
- For potential issues, you may take a look at our [FAQ](https://docs.agora.io/en/faq) first
47+
- Dive into [Agora SDK Samples](https://github.com/AgoraIO) to see more tutorials
48+
- Would like to see how Agora SDK is used in more complicated real use case? Take a look at [Agora Use Case](https://github.com/AgoraIO-usecase)
49+
- Repositories managed by developer communities can be found at [Agora Community](https://github.com/AgoraIO-Community)
4550
- You can find full API document at [Document Center](https://docs.agora.io/en/)
46-
- You can file bugs about this demo at [issue](https://github.com/AgoraIO/Basic-Video-Call/issues)
51+
- If you encounter problems during integration, you can ask question in [Developer Forum](https://stackoverflow.com/questions/tagged/agora.io)
52+
- You can file bugs about this sample at [issue](https://github.com/AgoraIO/Basic-Video-Call/issues)
4753

54+
4855
## License
4956

5057
The MIT License (MIT).

OpenLive-Windows/README.zh.md

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Open Live Windows
1+
# Open Live Windows
22

33
*Read this in other languages: [English](README.md)*
44

@@ -16,40 +16,39 @@
1616

1717
你也可以在这里查看入门版的示例项目:[Agora-Windows-Tutorial-1to1](https://github.com/AgoraIO/Basic-Video-Call/tree/master/One-to-One-Video/Agora-Windows-Tutorial-1to1)
1818

19-
## 运行示例程序
20-
首先在 [Agora.io 注册](https://dashboard.agora.io/cn/signup/) 注册账号,并创建自己的测试项目,获取到 App ID。将 APP_ID宏定义内容改为刚才申请的 App ID
19+
## 运行环境
20+
* VC++ 2013(或更高版本)
21+
* Windows 7(或更高版本)
2122

2223

23-
#define APP_ID _T("Your App ID")
24+
## 运行示例程序
25+
首先在 [Agora.io 注册](https://dashboard.agora.io/cn/signup/) 注册账号,并创建自己的测试项目,获取到 App ID。将 APP_ID宏定义内容改为刚才申请的 App ID
2426

27+
#define APP_ID _T("Your App ID")
2528

2629
如果你不想修改代码部分,你可以在在Debug/Release下创建一个AppId.ini文件.修改appId的值为刚才申请的App ID
2730

28-
#[AppID]
29-
30-
#AppID=xxxxxxxxxxxxxxxxxxx
31+
[AppID]
32+
AppID=xxxxxxxxxxxxxxxxxxx
3133

3234

3335
然后在 [Agora.io SDK](https://www.agora.io/cn/download/) 下载 **视频通话 + 直播 SDK**,解压后将其中的 **sdk** 复制到本项目目录下(并覆盖原有旧目录)。
3436

3537
最后使用 VC++2013 打开 OpenLive.sln,编译整个解决方案即可运行
3638

37-
Note:
39+
**注意:**
40+
3841
1. 程序编译后,在运行程序时如若出现:无法启动程序"xxx\xxx\xxx\Debug\Language\English.dll"的错误提示,
3942
请在解决方案资源管理器中选中OpenLive 项目,并右击,在弹出的菜单栏中选择 "设为启动项目",即可解决。之后重新运行程序即可。
4043
2. 本开源项目在 debug 模式下运行可能会出现崩溃,请在 release 模式下运行。
4144

42-
## 运行环境
43-
* VC++ 2013(或更高版本)
44-
* Windows 7(或更高版本)
45-
4645
## 联系我们
4746

4847
- 完整的 API 文档见 [文档中心](https://docs.agora.io/cn/)
4948
- 如果在集成中遇到问题,你可以到 [开发者社区](https://dev.agora.io/cn/) 提问
5049
- 如果有售前咨询问题,可以拨打 400 632 6626,或加入官方Q群 12742516 提问
5150
- 如果需要售后技术支持,你可以在 [Agora Dashboard](https://dashboard.agora.io) 提交工单
52-
- 如果发现了示例代码的bug,欢迎提交 [issue](https://github.com/AgoraIO/Basic-Video-Call/issues)
51+
- 如果发现了示例代码的bug,欢迎提交 [issue](https://github.com/AgoraIO/Basic-Video-Broadcasting/issues)
5352

5453
## 代码许可
5554

0 commit comments

Comments
 (0)