Skip to content

Commit

Permalink
webrtc::SimulcastEncoderAdapter を設定する処理のロジックを整理する
Browse files Browse the repository at this point in the history
  • Loading branch information
enm10k committed Feb 1, 2024
1 parent 934edbf commit bccc7bb
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/sora_video_encoder_factory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,16 +125,15 @@ SoraVideoEncoderFactory::CreateVideoEncoder(
const webrtc::SdpVideoFormat& format) {
if (internal_encoder_factory_ != nullptr) {
// サイマルキャストの場合はアダプタを噛ましつつ、無条件ですべてアライメントする
auto encoder = std::make_shared<webrtc::SimulcastEncoderAdapter>(
internal_encoder_factory_.get(), format);
std::shared_ptr<webrtc::VideoEncoder> encoder =
std::make_shared<webrtc::SimulcastEncoderAdapter>(
internal_encoder_factory_.get(), format);

if (!config_.force_simulcast_i420_conversion) {
return absl::make_unique<AlignedEncoderAdapter>(encoder, 16, 16);
if (config_.force_simulcast_i420_conversion) {
encoder = std::make_shared<I420EncoderAdapter>(encoder);
}

auto adapted1 = std::make_shared<I420EncoderAdapter>(encoder);
auto adapted2 = absl::make_unique<AlignedEncoderAdapter>(adapted1, 16, 16);
return adapted2;
return absl::make_unique<AlignedEncoderAdapter>(encoder, 16, 16);
}

int alignment = 0;
Expand Down

0 comments on commit bccc7bb

Please sign in to comment.