Skip to content

Commit 2b5421f

Browse files
committed
[Windows]adapt to 4003 version rtc sdk.
1 parent 915ec8a commit 2b5421f

6 files changed

Lines changed: 1 addition & 150 deletions

File tree

windows/APIExample/APIExample/APIExample.rc

100644100755
Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,6 @@ BEGIN
9898
CONTROL "Report",IDC_CHECK_REPORT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,368,59,10
9999
CONTROL "Moderation",IDC_CHECK_MODERATION,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,380,52,10
100100
PUSHBUTTON "Snapshot",IDC_BUTTON_SNAPSHOT,540,366,50,14
101-
LTEXT "Playback Device",IDC_STATIC_PLAYBACK,81,370,52,8
102-
COMBOBOX IDC_COMBO_PLAYBACK,134,367,203,30,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP
103-
LTEXT "Loopback Device",IDC_STATIC_LOOPBACK,80,382,54,8
104-
COMBOBOX IDC_COMBO_LOOPBACK,134,381,203,30,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP
105101
END
106102

107103
IDD_DIALOG_RTMPINJECT DIALOGEX 0, 0, 632, 400
@@ -378,7 +374,6 @@ BEGIN
378374
LTEXT "camera",IDC_STATIC_CAMERA,64,124,34,8
379375
COMBOBOX IDC_COMBO_VIDEO,110,122,218,30,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
380376
PUSHBUTTON "Set AudioProfile",IDC_BUTTON_CAMERA,338,121,60,14
381-
PUSHBUTTON "GetNetworkType",IDC_BUTTON_GET_NETWORK_TYPE,65,19,60,14
382377
END
383378

384379
IDD_DIALOG_VOLUME DIALOGEX 0, 0, 632, 400

windows/APIExample/APIExample/Advanced/OriginalAudio/CAgoraOriginalAudioDlg.cpp

100644100755
Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -45,20 +45,6 @@ BEGIN_MESSAGE_MAP(CAgoraOriginalAudioDlg, CDialogEx)
4545
ON_BN_CLICKED(IDC_BUTTON_ENCODED_AUDIO, &CAgoraOriginalAudioDlg::OnBnClickedButtonEncodedAudio)
4646
END_MESSAGE_MAP()
4747

48-
bool COriginalAudioProcFrameObserver::onEarMonitoringAudioFrame(AudioFrame& audioFrame)
49-
{
50-
return false;
51-
}
52-
53-
/*
54-
* According to the setting of audio collection frame rate,
55-
* the Agora SDK calls this callback function at an appropriate time
56-
* to obtain the audio data collected by the user.
57-
*/
58-
IAudioFrameObserverBase::AudioParams COriginalAudioProcFrameObserver::getEarMonitoringAudioParams()
59-
{
60-
return IAudioFrameObserverBase::AudioParams();
61-
}
6248

6349
bool COriginalAudioProcFrameObserver::onRecordAudioFrame(const char* channelId, AudioFrame& audioFrame)
6450
{

windows/APIExample/APIExample/Advanced/OriginalAudio/CAgoraOriginalAudioDlg.h

100644100755
Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -37,25 +37,6 @@ class COriginalAudioProcFrameObserver :
3737
{
3838
public:
3939

40-
/**
41-
* Occurs when the ear monitoring audio frame is received.
42-
* @param audioFrame The reference to the audio frame: AudioFrame.
43-
* @return
44-
* - true: The ear monitoring audio data is valid and is encoded and sent.
45-
* - false: The ear monitoring audio data is invalid and is not encoded or sent.
46-
*/
47-
virtual bool onEarMonitoringAudioFrame(AudioFrame& audioFrame) override;
48-
/** Sets the ear monitoring audio format
49-
**Note**:
50-
- The SDK calculates the sample interval according to the `AudioParams`
51-
you set in the return value of this callback and triggers the
52-
`onEarMonitoringAudioFrame` callback at the calculated sample interval.
53-
Sample interval (seconds) = `samplesPerCall`/(`sampleRate` × `channel`).
54-
Ensure that the value of sample interval is equal to or greater than 0.01.
55-
56-
@return Sets the audio format. See AgoraAudioParams.
57-
*/
58-
virtual IAudioFrameObserverBase::AudioParams getEarMonitoringAudioParams() override;
5940
/*
6041
* According to the setting of audio collection frame rate,
6142
* the Agora SDK calls this callback function at an appropriate time

windows/APIExample/APIExample/Advanced/PreCallTest/CAgoraPreCallTestDlg.cpp

100644100755
Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@ BEGIN_MESSAGE_MAP(CAgoraPreCallTestDlg, CDialogEx)
4949
ON_MESSAGE(WM_MSGID(EID_LASTMILE_PROBE_RESULT), &CAgoraPreCallTestDlg::OnEIDLastmileProbeResult)
5050
ON_MESSAGE(WM_MSGID(EID_LASTMILE_QUAILTY), &CAgoraPreCallTestDlg::OnEIDLastmileQuality)
5151
ON_MESSAGE(WM_MSGID(EID_AUDIO_VOLUME_INDICATION), &CAgoraPreCallTestDlg::OnEIDAudioVolumeIndication)
52-
ON_WM_PAINT()
53-
ON_BN_CLICKED(IDC_BUTTON_GET_NETWORK_TYPE, &CAgoraPreCallTestDlg::OnBnClickedButtonGetNetworkType)
52+
ON_WM_PAINT()
5453
END_MESSAGE_MAP()
5554

5655
//init ctrl text.
@@ -400,32 +399,3 @@ void CAgoraPreCallTestDlg::OnPaint()
400399
}
401400

402401

403-
void CAgoraPreCallTestDlg::OnBnClickedButtonGetNetworkType()
404-
{
405-
406-
int networkType = m_rtcEngine->getNetworkType();
407-
CString infoStr;
408-
switch (networkType) {
409-
case NETWORK_TYPE_DISCONNECTED:
410-
infoStr.Format(_T("Curr NetworkType: DISCONNECTED"));
411-
break;
412-
case NETWORK_TYPE_LAN:
413-
infoStr.Format(_T("Curr NetworkType: LAN"));
414-
break;
415-
case NETWORK_TYPE_WIFI:
416-
infoStr.Format(_T("Curr NetworkType: WIFI"));
417-
break;
418-
case NETWORK_TYPE_MOBILE_2G:
419-
infoStr.Format(_T("Curr NetworkType: 2G"));
420-
break;
421-
case NETWORK_TYPE_MOBILE_3G:
422-
infoStr.Format(_T("Curr NetworkType: 3G"));
423-
break;
424-
case NETWORK_TYPE_MOBILE_4G:
425-
infoStr.Format(_T("Curr NetworkType: 4G"));
426-
break;
427-
default:
428-
infoStr.Format(_T("Curr NetworkType: UNKNOWN"));
429-
}
430-
m_lstInfo.InsertString(m_lstInfo.GetCount(), infoStr);
431-
}

windows/APIExample/APIExample/Basic/LiveBroadcasting/CLiveBroadcastingDlg.cpp

Lines changed: 0 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -111,17 +111,13 @@ void CLiveBroadcastingDlg::DoDataExchange(CDataExchange* pDX)
111111
DDX_Control(pDX, IDC_CHECK_REPORT, m_chkReport);
112112
DDX_Control(pDX, IDC_CHECK_MODERATION, m_chkModeration);
113113
DDX_Control(pDX, IDC_BUTTON_SNAPSHOT, m_chkSnapshot);
114-
DDX_Control(pDX, IDC_COMBO_PLAYBACK, m_cmbPlayback);
115-
DDX_Control(pDX, IDC_COMBO_LOOPBACK, m_cmbLoopback);
116114
}
117115

118116

119117
BEGIN_MESSAGE_MAP(CLiveBroadcastingDlg, CDialogEx)
120118
ON_BN_CLICKED(IDC_BUTTON_JOINCHANNEL, &CLiveBroadcastingDlg::OnBnClickedButtonJoinchannel)
121119
ON_CBN_SELCHANGE(IDC_COMBO_PERSONS, &CLiveBroadcastingDlg::OnSelchangeComboPersons)
122120
ON_CBN_SELCHANGE(IDC_COMBO_ROLE, &CLiveBroadcastingDlg::OnSelchangeComboRole)
123-
ON_CBN_SELCHANGE(IDC_COMBO_PLAYBACK, &CLiveBroadcastingDlg::OnSelchangeComboPlayback)
124-
ON_CBN_SELCHANGE(IDC_COMBO_LOOPBACK, &CLiveBroadcastingDlg::OnSelchangeComboLoopback)
125121
ON_MESSAGE(WM_MSGID(EID_JOINCHANNEL_SUCCESS), &CLiveBroadcastingDlg::OnEIDJoinChannelSuccess)
126122
ON_MESSAGE(WM_MSGID(EID_LEAVE_CHANNEL), &CLiveBroadcastingDlg::OnEIDLeaveChannel)
127123
ON_MESSAGE(WM_MSGID(EID_USER_JOINED), &CLiveBroadcastingDlg::OnEIDUserJoined)
@@ -333,8 +329,6 @@ void CLiveBroadcastingDlg::ResumeStatus()
333329
m_lstInfo.ResetContent();
334330
m_cmbRole.SetCurSel(0);
335331
m_cmbPersons.SetCurSel(0);
336-
m_cmbPlayback.SetCurSel(0);
337-
m_cmbLoopback.SetCurSel(0);
338332
m_cmbVideoEncoder.SetCurSel(1);
339333
ShowVideoWnds();
340334
InitCtrlText();
@@ -376,29 +370,6 @@ void CLiveBroadcastingDlg::StopLocalVideo()
376370
}
377371
}
378372

379-
void CLiveBroadcastingDlg::SetupAudioDeviceLayout()
380-
{
381-
char szDeviceName[1024];
382-
char szDeviceId[1024];
383-
384-
m_cmbPlayback.ResetContent();
385-
m_cmbLoopback.ResetContent();
386-
m_mapPlaybackDevices.clear();
387-
388-
//get audio record devices and add to combobox and insert map.
389-
IAudioDeviceCollection* audioPlaybackDevices = (*m_audioDeviceManager)->enumeratePlaybackDevices();
390-
for (int i = 0; i < audioPlaybackDevices->getCount(); i++)
391-
{
392-
int nRet = audioPlaybackDevices->getDevice(i, szDeviceName, szDeviceId);
393-
m_cmbPlayback.AddString(utf82cs(szDeviceName));
394-
m_cmbLoopback.AddString(utf82cs(szDeviceName));
395-
m_mapPlaybackDevices.insert(std::make_pair(utf82cs(szDeviceName), szDeviceId));
396-
}
397-
audioPlaybackDevices->release();
398-
m_cmbPlayback.SetCurSel(0);
399-
m_cmbLoopback.SetCurSel(0);
400-
}
401-
402373

403374
void CLiveBroadcastingDlg::OnSelchangeComboPersons()
404375
{
@@ -424,51 +395,6 @@ void CLiveBroadcastingDlg::OnSelchangeComboRole()
424395
}
425396
}
426397

427-
void CLiveBroadcastingDlg::OnSelchangeComboPlayback()
428-
{
429-
if (!m_audioDeviceManager) {
430-
return;
431-
}
432-
433-
int nSel = m_cmbPlayback.GetCurSel();
434-
if (nSel < 0) return;
435-
436-
CString strDeviceName;
437-
m_cmbPlayback.GetLBText(nSel, strDeviceName);
438-
439-
const char* deviceId = m_mapPlaybackDevices[strDeviceName].c_str();
440-
int ret = (*m_audioDeviceManager)->setPlaybackDevice(deviceId);
441-
CString infoStr;
442-
infoStr.Format(_T("PlaybackDeviceName : %s"), strDeviceName);
443-
m_lstInfo.InsertString(m_lstInfo.GetCount(), infoStr);
444-
infoStr.Format(_T("PlaybackDeviceId : %s"), utf82cs(deviceId));
445-
m_lstInfo.InsertString(m_lstInfo.GetCount(), infoStr);
446-
infoStr.Format(_T("setPlaybackDevice : %d"), ret);
447-
m_lstInfo.InsertString(m_lstInfo.GetCount(), infoStr);
448-
}
449-
450-
void CLiveBroadcastingDlg::OnSelchangeComboLoopback()
451-
{
452-
if (!m_audioDeviceManager) {
453-
return;
454-
}
455-
456-
int nSel = m_cmbLoopback.GetCurSel();
457-
if (nSel < 0) return;
458-
459-
CString strDeviceName;
460-
m_cmbLoopback.GetLBText(nSel, strDeviceName);
461-
462-
const char* deviceId = m_mapPlaybackDevices[strDeviceName].c_str();
463-
int ret = (*m_audioDeviceManager)->setLoopbackDevice(deviceId);
464-
CString infoStr;
465-
infoStr.Format(_T("LoopbackkDeviceName : %s"), strDeviceName);
466-
m_lstInfo.InsertString(m_lstInfo.GetCount(), infoStr);
467-
infoStr.Format(_T("LoopbackDeviceId : %s"), utf82cs(deviceId));
468-
m_lstInfo.InsertString(m_lstInfo.GetCount(), infoStr);
469-
infoStr.Format(_T("setLoopbackDevice : %d"), ret);
470-
m_lstInfo.InsertString(m_lstInfo.GetCount(), infoStr);
471-
}
472398

473399
void CLiveBroadcastingDlg::OnBnClickedButtonJoinchannel()
474400
{
@@ -482,7 +408,6 @@ void CLiveBroadcastingDlg::OnBnClickedButtonJoinchannel()
482408
AfxMessageBox(_T("Fill channel name first"));
483409
return;
484410
}
485-
m_rtcEngine->enableLoopbackRecording(true);
486411

487412
VideoEncoderConfiguration config;
488413
if (m_cmbVideoEncoder.GetCurSel() < 3)
@@ -521,7 +446,6 @@ void CLiveBroadcastingDlg::OnShowWindow(BOOL bShow, UINT nStatus)
521446

522447
if (bShow) {
523448
RenderLocalVideo();
524-
SetupAudioDeviceLayout();
525449
}
526450
else
527451
{

windows/APIExample/APIExample/Basic/LiveBroadcasting/CLiveBroadcastingDlg.h

100644100755
Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,6 @@ class CLiveBroadcastingDlg : public CDialogEx
209209
public:
210210
afx_msg void OnSelchangeComboPersons();
211211
afx_msg void OnSelchangeComboRole();
212-
afx_msg void OnSelchangeComboPlayback();
213-
afx_msg void OnSelchangeComboLoopback();
214212
afx_msg void OnShowWindow(BOOL bShow, UINT nStatus);
215213
//Agora Event handler
216214
afx_msg LRESULT OnEIDJoinChannelSuccess(WPARAM wParam, LPARAM lParam);
@@ -274,9 +272,6 @@ class CLiveBroadcastingDlg : public CDialogEx
274272
CButton m_chkReport;
275273
CButton m_chkModeration;
276274
CButton m_chkSnapshot;
277-
CComboBox m_cmbPlayback;
278-
CComboBox m_cmbLoopback;
279-
std::map<CString, std::string> m_mapPlaybackDevices;
280275
afx_msg void OnBnClickedCheckReport();
281276
afx_msg void OnBnClickedModeration();
282277
afx_msg void OnBnClickedSnapshot();

0 commit comments

Comments
 (0)