Skip to content

Commit

Permalink
Merge pull request #27 from shiguredo/feature/keyword-args
Browse files Browse the repository at this point in the history
`create_video_source()` と `set_enabled()` の引数に名前をつける(キーワード引数で呼べるようにする)
  • Loading branch information
sile committed Jun 19, 2023
2 parents a4926be + f4137fd commit 59f4beb
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

## develop

- [UPDATE] `create_video_source()``set_enabled()` の引数に名前をつける(キーワード引数で呼べるようにする)
- @sile
- [UPDATE] C++ SDK のバージョンを 2023.7.0 に上げる
- @sile
- [UPDATE] 映像コーデックパラメータを指定可能にする
Expand Down
12 changes: 6 additions & 6 deletions src/sora.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,16 @@ std::shared_ptr<SoraConnection> Sora::CreateConnection(
config.audio_bit_rate = *audio_bit_rate;
}
if (video_vp9_params) {
config.video_vp9_params =
ConvertJsonValue(video_vp9_params, "Invalid JSON value in video_vp9_params");
config.video_vp9_params = ConvertJsonValue(
video_vp9_params, "Invalid JSON value in video_vp9_params");
}
if (video_av1_params) {
config.video_av1_params =
ConvertJsonValue(video_av1_params, "Invalid JSON value in video_av1_params");
config.video_av1_params = ConvertJsonValue(
video_av1_params, "Invalid JSON value in video_av1_params");
}
if (video_h264_params) {
config.video_h264_params =
ConvertJsonValue(video_h264_params, "Invalid JSON value in video_h264_params");
config.video_h264_params = ConvertJsonValue(
video_h264_params, "Invalid JSON value in video_h264_params");
}
config.metadata =
ConvertJsonValue(metadata, "Invalid JSON value in metadata");
Expand Down
5 changes: 3 additions & 2 deletions src/sora_sdk_ext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ NB_MODULE(sora_sdk_ext, m) {
.def_prop_ro("id", &SoraTrackInterface::id)
.def_prop_ro("enabled", &SoraTrackInterface::enabled)
.def_prop_ro("state", &SoraTrackInterface::state)
.def("set_enabled", &SoraTrackInterface::set_enabled);
.def("set_enabled", &SoraTrackInterface::set_enabled, "enable"_a);

nb::class_<SoraAudioSource, SoraTrackInterface>(m, "SoraAudioSource")
.def("on_data", nb::overload_cast<const int16_t*, size_t, double>(
Expand Down Expand Up @@ -240,6 +240,7 @@ NB_MODULE(sora_sdk_ext, m) {
"client_key"_a = nb::none(), "proxy_url"_a = nb::none(),
"proxy_username"_a = nb::none(), "proxy_password"_a = nb::none(),
"proxy_agent"_a = nb::none())
.def("create_audio_source", &Sora::CreateAudioSource)
.def("create_audio_source", &Sora::CreateAudioSource, "channels"_a,
"sample_rate"_a)
.def("create_video_source", &Sora::CreateVideoSource);
}

0 comments on commit 59f4beb

Please sign in to comment.