diff --git a/CHANGES.md b/CHANGES.md index 4b1f535..d3b0f4d 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -53,6 +53,8 @@ - [UPDATE] Sora C++ SDK のバージョンを `2024.8.0` に上げる - WEBRTC_BUILD_VERSION を `m130.6723.2.0` に上げる - libwebrtc のモジュール分割に追従するため rtc::CreateRandomString のヘッダを追加 + - Sora CPP SDK の absl::optional を std::optional に変更した仕様に追従する + - Sora CPP SDK の absl::nullopt を std::nullopt に変更した仕様に追従する - CMAKE_VERSION を `3.30.5` に上げる - BOOST_VERSION を `1.86.0` に上げる - OPENH264_VERSION を `v2.5.0` に上げる diff --git a/src/dynamic_h264_decoder.cpp b/src/dynamic_h264_decoder.cpp index 8b26507..9576e45 100644 --- a/src/dynamic_h264_decoder.cpp +++ b/src/dynamic_h264_decoder.cpp @@ -89,7 +89,7 @@ int32_t DynamicH264Decoder::Decode(const EncodedImage& input_image, } h264_bitstream_parser_.ParseBitstream(input_image); - absl::optional qp = h264_bitstream_parser_.GetLastSliceQp(); + std::optional qp = h264_bitstream_parser_.GetLastSliceQp(); std::array yuv; SBufferInfo info = {}; @@ -127,7 +127,7 @@ int32_t DynamicH264Decoder::Decode(const EncodedImage& input_image, video_frame.set_color_space(*input_image.ColorSpace()); } - callback_->Decoded(video_frame, absl::nullopt, qp); + callback_->Decoded(video_frame, std::nullopt, qp); return WEBRTC_VIDEO_CODEC_OK; } diff --git a/src/dynamic_h264_encoder.cpp b/src/dynamic_h264_encoder.cpp index 7e91f31..c584e97 100644 --- a/src/dynamic_h264_encoder.cpp +++ b/src/dynamic_h264_encoder.cpp @@ -62,7 +62,7 @@ enum DynamicH264EncoderEvent { kH264EncoderEventMax = 16, }; -int NumberOfThreads(absl::optional encoder_thread_limit, +int NumberOfThreads(std::optional encoder_thread_limit, int width, int height, int number_of_cores) { @@ -106,7 +106,7 @@ VideoFrameType ConvertToVideoFrameType(EVideoFrameType type) { return VideoFrameType::kEmptyFrame; } -absl::optional ScalabilityModeFromTemporalLayers( +std::optional ScalabilityModeFromTemporalLayers( int num_temporal_layers) { switch (num_temporal_layers) { case 0: @@ -120,7 +120,7 @@ absl::optional ScalabilityModeFromTemporalLayers( default: RTC_DCHECK_NOTREACHED(); } - return absl::nullopt; + return std::nullopt; } } // namespace diff --git a/src/dynamic_h264_encoder.h b/src/dynamic_h264_encoder.h index 65382c1..cb11354 100644 --- a/src/dynamic_h264_encoder.h +++ b/src/dynamic_h264_encoder.h @@ -114,7 +114,7 @@ class DynamicH264Encoder : public VideoEncoder { std::vector configurations_; std::vector encoded_images_; std::vector> svc_controllers_; - absl::InlinedVector, kMaxSimulcastStreams> + absl::InlinedVector, kMaxSimulcastStreams> scalability_modes_; const Environment env_; @@ -122,7 +122,7 @@ class DynamicH264Encoder : public VideoEncoder { H264PacketizationMode packetization_mode_; size_t max_payload_size_; int32_t number_of_cores_; - absl::optional encoder_thread_limit_; + std::optional encoder_thread_limit_; EncodedImageCallback* encoded_image_callback_; bool has_reported_init_; diff --git a/src/sora_audio_sink.cpp b/src/sora_audio_sink.cpp index fa5c077..a1860af 100644 --- a/src/sora_audio_sink.cpp +++ b/src/sora_audio_sink.cpp @@ -53,7 +53,7 @@ void SoraAudioSinkImpl::OnData( int sample_rate, size_t number_of_channels, size_t number_of_frames, - absl::optional absolute_capture_timestamp_ms) { + std::optional absolute_capture_timestamp_ms) { if (absolute_capture_timestamp_ms) { audio_frame_->set_absolute_capture_timestamp_ms( *absolute_capture_timestamp_ms); diff --git a/src/sora_audio_sink.h b/src/sora_audio_sink.h index 02c1533..f7ca7d8 100644 --- a/src/sora_audio_sink.h +++ b/src/sora_audio_sink.h @@ -50,7 +50,7 @@ class SoraAudioSinkImpl : public webrtc::AudioTrackSinkInterface, int sample_rate, size_t number_of_channels, size_t number_of_frames, - absl::optional absolute_capture_timestamp_ms) override; + std::optional absolute_capture_timestamp_ms) override; /** * 実装上の留意点:コールバックと Read 関数の共存はパフォーマンスや使い方の面で難しいことが判明したので、 diff --git a/src/sora_audio_source.cpp b/src/sora_audio_source.cpp index a444866..9c5e1d1 100644 --- a/src/sora_audio_source.cpp +++ b/src/sora_audio_source.cpp @@ -17,7 +17,7 @@ SoraAudioSourceInterface::~SoraAudioSourceInterface() { void SoraAudioSourceInterface::OnData(const int16_t* data, size_t samples_per_channel, - absl::optional timestamp) { + std::optional timestamp) { size_t size = samples_per_channel * channels_; if (buffer_used_ > 0) { // 先に 10 ms に満たず残したデータを新たなデータと繋げて 10 ms を超える場合は送る @@ -116,7 +116,7 @@ void SoraAudioSourceInterface::RemoveSink( } void SoraAudioSourceInterface::Add10MsData(const int16_t* data, - absl::optional timestamp) { + std::optional timestamp) { if (timestamp) { last_timestamp_ = *timestamp; } @@ -146,7 +146,7 @@ void SoraAudioSource::OnData(const int16_t* data, } void SoraAudioSource::OnData(const int16_t* data, size_t samples_per_channel) { - source_->OnData(data, samples_per_channel, absl::nullopt); + source_->OnData(data, samples_per_channel, std::nullopt); } void SoraAudioSource::OnData( @@ -166,5 +166,5 @@ void SoraAudioSource::OnData( if (!track_) { return; } - source_->OnData(ndarray.data(), ndarray.shape(0), absl::nullopt); + source_->OnData(ndarray.data(), ndarray.shape(0), std::nullopt); } \ No newline at end of file diff --git a/src/sora_audio_source.h b/src/sora_audio_source.h index 8756f44..c98b193 100644 --- a/src/sora_audio_source.h +++ b/src/sora_audio_source.h @@ -32,7 +32,7 @@ class SoraAudioSourceInterface void OnData(const int16_t* data, size_t samples_per_channel, - absl::optional timestamp); + std::optional timestamp); // MediaSourceInterface implementation. webrtc::MediaSourceInterface::SourceState state() const override; @@ -46,7 +46,7 @@ class SoraAudioSourceInterface void RemoveSink(webrtc::AudioTrackSinkInterface* sink) override; private: - void Add10MsData(const int16_t* data, absl::optional timestamp); + void Add10MsData(const int16_t* data, std::optional timestamp); std::list audio_observers_; webrtc::Mutex sink_lock_; diff --git a/src/sora_audio_stream_sink.cpp b/src/sora_audio_stream_sink.cpp index 3f70dd8..9367f6f 100644 --- a/src/sora_audio_stream_sink.cpp +++ b/src/sora_audio_stream_sink.cpp @@ -179,7 +179,7 @@ void SoraAudioStreamSinkImpl::OnData( int sample_rate, size_t number_of_channels, size_t number_of_frames, - absl::optional absolute_capture_timestamp_ms) { + std::optional absolute_capture_timestamp_ms) { auto tuned_frame = std::make_unique(); tuned_frame->UpdateFrame( 0, static_cast(audio_data), number_of_frames, sample_rate, diff --git a/src/sora_audio_stream_sink.h b/src/sora_audio_stream_sink.h index 0289f78..5f0a6ef 100644 --- a/src/sora_audio_stream_sink.h +++ b/src/sora_audio_stream_sink.h @@ -180,7 +180,7 @@ class SoraAudioStreamSinkImpl : public webrtc::AudioTrackSinkInterface, int sample_rate, size_t number_of_channels, size_t number_of_frames, - absl::optional absolute_capture_timestamp_ms) override; + std::optional absolute_capture_timestamp_ms) override; /** * 音声データが来るたびに呼び出されるコールバック変数です。 *