Skip to content

Commit

Permalink
disbale hardware encoder
Browse files Browse the repository at this point in the history
  • Loading branch information
sbd021 committed Nov 20, 2020
1 parent 3be2f0e commit 59bdbf9
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 8 deletions.
11 changes: 7 additions & 4 deletions UI/window-basic-main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8618,13 +8618,13 @@ void OBSBasic::on_agoraPKButton_clicked()
}

ui->agoraPKButton->setText(
QTStr("Basic.Main.StartAgoraStreaming"));
QTStr("Basic.Main.StopAgoraStreaming"));
SetControlWhenPK(true);
MuteAudioDevice(true);
if (!agoraOutputHandler->StartAgora(agoraService)) {
SetControlWhenPK(false);
ui->agoraPKButton->setText(
QTStr("Basic.Main.StopAgoraStreaming"));
QTStr("Basic.Main.StartAgoraStreaming"));
}

//for test
Expand Down Expand Up @@ -8867,7 +8867,7 @@ void OBSBasic::OnInitRtcEngineFailed(long long code)
OBSMessageBox::information(this, QString("Agora"),
QString("Init Agora Engine Failed"));
}
SetControlWhenPK(false);

//SetPreviewPK(false);
}

Expand Down Expand Up @@ -9123,4 +9123,7 @@ void OBSBasic::OnTokenPrivilegeWillExpire()
obs_service_update(agoraService, settings);
}

void OBSBasic::OnError(int err, const char *msg) {}
void OBSBasic::OnError(int err, const char *msg)
{
blog(LOG_ERROR, "Agora initialize ret error, err:%d, msg:%s", err, msg);
}
2 changes: 1 addition & 1 deletion UI/window-basic-main.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ class ColorSelect : public QWidget {
std::unique_ptr<Ui::ColorSelect> ui;
};

class OBSBasic : public OBSMainWindow {
class OBSBasic : public OBSMainWindow {
Q_OBJECT
Q_PROPERTY(QIcon imageIcon READ GetImageIcon WRITE SetImageIcon
DESIGNABLE true)
Expand Down
1 change: 1 addition & 0 deletions UI/window-basic-settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4920,6 +4920,7 @@ void OBSBasicSettings::SaveAgoraSettings()
{
AgoraSettings settings;
QString strAppid = ui->lineEditAppid->text().toUtf8();
strAppid = strAppid.trimmed();
if (!strAppid.isEmpty())
settings.appid = strAppid.toUtf8();
settings.appCerf = ui->lineEditToken->text().toUtf8();
Expand Down
1 change: 1 addition & 0 deletions plugins/win-agora/Agora/agorartcengine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ bool AgoraRtcEngine::InitEngine(std::string appid)
signal_handler_signal(
obs_service_get_signal_handler(agoraService),
"initRtcEngineFailed", &params);
blog(LOG_ERROR, "Agora initialize ret, appid: %s, error: %d", appid.c_str(), ret);
return false;
}

Expand Down
4 changes: 1 addition & 3 deletions plugins/win-agora/agora-service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,7 @@ bool AgoraService_Initialize(void *data, obs_output_t *output)
AgoraRtcEngine *agora_engine = AgoraRtcEngine::GetInstance();

if (!agora_engine->bInit) {
if (!agora_engine->InitEngine(
service_data
->agora_appid)) // init agora engine failed
if (!agora_engine->InitEngine(service_data->agora_appid)) // init agora engine failed
return false;
agora_engine->bInit = true;
}
Expand Down

0 comments on commit 59bdbf9

Please sign in to comment.