-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release/2023.1.0' into main
- Loading branch information
Showing
13 changed files
with
234 additions
and
219 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
SORA_CPP_SDK_VERSION=2022.19.0 | ||
WEBRTC_BUILD_VERSION=m107.5304.4.1 | ||
BOOST_VERSION=1.80.0 | ||
SORA_CPP_SDK_VERSION=2023.1.0 | ||
WEBRTC_BUILD_VERSION=m109.5414.2.0 | ||
BOOST_VERSION=1.81.0 | ||
CMAKE_VERSION=3.23.1 | ||
BAZEL_VERSION=5.3.2 | ||
LYRA_VERSION=1.3.0 | ||
CUDA_VERSION=10.2.89-1 | ||
ANDROID_NDK_VERSION=r25b | ||
ANDROID_NATIVE_API_LEVEL=29 | ||
ANDROID_SDK_CMDLINE_TOOLS_VERSION=8092744 | ||
VPL_VERSION=v2022.1.0 | ||
VPL_VERSION=v2023.1.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,36 @@ | ||
#ifndef SORA_I420_ENCODER_ADAPTER_H_ | ||
#define SORA_I420_ENCODER_ADAPTER_H_ | ||
|
||
#include <memory> | ||
|
||
// WebRTC | ||
#include <api/video_codecs/video_encoder.h> | ||
|
||
namespace sora { | ||
|
||
// kNative なフレームを I420 にするアダプタ | ||
class I420EncoderAdapter : public webrtc::VideoEncoder { | ||
public: | ||
I420EncoderAdapter(std::shared_ptr<webrtc::VideoEncoder> encoder); | ||
|
||
void SetFecControllerOverride( | ||
webrtc::FecControllerOverride* fec_controller_override) override; | ||
int Release() override; | ||
int InitEncode(const webrtc::VideoCodec* codec_settings, | ||
const webrtc::VideoEncoder::Settings& settings) override; | ||
int Encode(const webrtc::VideoFrame& input_image, | ||
const std::vector<webrtc::VideoFrameType>* frame_types) override; | ||
int RegisterEncodeCompleteCallback( | ||
webrtc::EncodedImageCallback* callback) override; | ||
void SetRates(const RateControlParameters& parameters) override; | ||
void OnPacketLossRateUpdate(float packet_loss_rate) override; | ||
void OnRttUpdate(int64_t rtt_ms) override; | ||
void OnLossNotification(const LossNotification& loss_notification) override; | ||
EncoderInfo GetEncoderInfo() const override; | ||
|
||
private: | ||
std::shared_ptr<webrtc::VideoEncoder> encoder_; | ||
}; | ||
|
||
} // namespace sora | ||
#ifndef SORA_I420_ENCODER_ADAPTER_H_ | ||
#define SORA_I420_ENCODER_ADAPTER_H_ | ||
|
||
#include <memory> | ||
|
||
// WebRTC | ||
#include <api/video_codecs/video_encoder.h> | ||
|
||
namespace sora { | ||
|
||
// kNative なフレームを I420 にするアダプタ | ||
class I420EncoderAdapter : public webrtc::VideoEncoder { | ||
public: | ||
I420EncoderAdapter(std::shared_ptr<webrtc::VideoEncoder> encoder); | ||
|
||
void SetFecControllerOverride( | ||
webrtc::FecControllerOverride* fec_controller_override) override; | ||
int Release() override; | ||
int InitEncode(const webrtc::VideoCodec* codec_settings, | ||
const webrtc::VideoEncoder::Settings& settings) override; | ||
int Encode(const webrtc::VideoFrame& input_image, | ||
const std::vector<webrtc::VideoFrameType>* frame_types) override; | ||
int RegisterEncodeCompleteCallback( | ||
webrtc::EncodedImageCallback* callback) override; | ||
void SetRates(const RateControlParameters& parameters) override; | ||
void OnPacketLossRateUpdate(float packet_loss_rate) override; | ||
void OnRttUpdate(int64_t rtt_ms) override; | ||
void OnLossNotification(const LossNotification& loss_notification) override; | ||
EncoderInfo GetEncoderInfo() const override; | ||
|
||
private: | ||
std::shared_ptr<webrtc::VideoEncoder> encoder_; | ||
}; | ||
|
||
} // namespace sora | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
#ifndef SORA_SORA_PEER_CONNECTION_FACTORY_H_ | ||
#define SORA_SORA_PEER_CONNECTION_FACTORY_H_ | ||
|
||
// WebRTC | ||
#include <api/peer_connection_interface.h> | ||
#include <api/scoped_refptr.h> | ||
#include <pc/connection_context.h> | ||
|
||
namespace sora { | ||
|
||
rtc::scoped_refptr<webrtc::PeerConnectionFactoryInterface> | ||
CreateModularPeerConnectionFactoryWithContext( | ||
webrtc::PeerConnectionFactoryDependencies dependencies, | ||
rtc::scoped_refptr<webrtc::ConnectionContext>& context); | ||
|
||
} | ||
#ifndef SORA_SORA_PEER_CONNECTION_FACTORY_H_ | ||
#define SORA_SORA_PEER_CONNECTION_FACTORY_H_ | ||
|
||
// WebRTC | ||
#include <api/peer_connection_interface.h> | ||
#include <api/scoped_refptr.h> | ||
#include <pc/connection_context.h> | ||
|
||
namespace sora { | ||
|
||
rtc::scoped_refptr<webrtc::PeerConnectionFactoryInterface> | ||
CreateModularPeerConnectionFactoryWithContext( | ||
webrtc::PeerConnectionFactoryDependencies dependencies, | ||
rtc::scoped_refptr<webrtc::ConnectionContext>& context); | ||
|
||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,28 @@ | ||
#ifndef SORA_HWENC_VPL_VPL_UTILS_H_ | ||
#define SORA_HWENC_VPL_VPL_UTILS_H_ | ||
|
||
// WebRTC | ||
#include <api/video/video_codec_type.h> | ||
|
||
// oneVPL | ||
#include <vpl/mfxdefs.h> | ||
|
||
#define VPL_CHECK_RESULT(P, X, ERR) \ | ||
{ \ | ||
if ((X) > (P)) { \ | ||
RTC_LOG(LS_ERROR) << "oneVPL Error: " << ERR; \ | ||
throw ERR; \ | ||
} \ | ||
} | ||
|
||
namespace sora { | ||
|
||
static mfxU32 ToMfxCodec(webrtc::VideoCodecType codec) { | ||
return codec == webrtc::kVideoCodecVP8 ? MFX_CODEC_VP8 | ||
: codec == webrtc::kVideoCodecVP9 ? MFX_CODEC_VP9 | ||
: codec == webrtc::kVideoCodecH264 ? MFX_CODEC_AVC | ||
: MFX_CODEC_AV1; | ||
} | ||
|
||
} // namespace sora | ||
#endif | ||
#ifndef SORA_HWENC_VPL_VPL_UTILS_H_ | ||
#define SORA_HWENC_VPL_VPL_UTILS_H_ | ||
|
||
// WebRTC | ||
#include <api/video/video_codec_type.h> | ||
|
||
// oneVPL | ||
#include <vpl/mfxdefs.h> | ||
|
||
#define VPL_CHECK_RESULT(P, X, ERR) \ | ||
{ \ | ||
if ((X) > (P)) { \ | ||
RTC_LOG(LS_ERROR) << "oneVPL Error: " << ERR; \ | ||
throw ERR; \ | ||
} \ | ||
} | ||
|
||
namespace sora { | ||
|
||
static mfxU32 ToMfxCodec(webrtc::VideoCodecType codec) { | ||
return codec == webrtc::kVideoCodecVP8 ? MFX_CODEC_VP8 | ||
: codec == webrtc::kVideoCodecVP9 ? MFX_CODEC_VP9 | ||
: codec == webrtc::kVideoCodecH264 ? MFX_CODEC_AVC | ||
: MFX_CODEC_AV1; | ||
} | ||
|
||
} // namespace sora | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,56 @@ | ||
#include "sora/i420_encoder_adapter.h" | ||
|
||
#include <rtc_base/logging.h> | ||
|
||
namespace sora { | ||
|
||
I420EncoderAdapter::I420EncoderAdapter( | ||
std::shared_ptr<webrtc::VideoEncoder> encoder) | ||
: encoder_(encoder) {} | ||
|
||
void I420EncoderAdapter::SetFecControllerOverride( | ||
webrtc::FecControllerOverride* fec_controller_override) { | ||
encoder_->SetFecControllerOverride(fec_controller_override); | ||
} | ||
int I420EncoderAdapter::Release() { | ||
return encoder_->Release(); | ||
} | ||
int I420EncoderAdapter::InitEncode( | ||
const webrtc::VideoCodec* codec_settings, | ||
const webrtc::VideoEncoder::Settings& settings) { | ||
return encoder_->InitEncode(codec_settings, settings); | ||
} | ||
int I420EncoderAdapter::Encode( | ||
const webrtc::VideoFrame& input_image, | ||
const std::vector<webrtc::VideoFrameType>* frame_types) { | ||
auto frame = input_image; | ||
auto buffer = frame.video_frame_buffer(); | ||
if (buffer->type() == webrtc::VideoFrameBuffer::Type::kNative) { | ||
frame.set_video_frame_buffer(buffer->ToI420()); | ||
} | ||
return encoder_->Encode(frame, frame_types); | ||
} | ||
|
||
int I420EncoderAdapter::RegisterEncodeCompleteCallback( | ||
webrtc::EncodedImageCallback* callback) { | ||
return encoder_->RegisterEncodeCompleteCallback(callback); | ||
} | ||
void I420EncoderAdapter::SetRates(const RateControlParameters& parameters) { | ||
encoder_->SetRates(parameters); | ||
} | ||
void I420EncoderAdapter::OnPacketLossRateUpdate(float packet_loss_rate) { | ||
encoder_->OnPacketLossRateUpdate(packet_loss_rate); | ||
} | ||
void I420EncoderAdapter::OnRttUpdate(int64_t rtt_ms) { | ||
encoder_->OnRttUpdate(rtt_ms); | ||
} | ||
void I420EncoderAdapter::OnLossNotification( | ||
const LossNotification& loss_notification) { | ||
encoder_->OnLossNotification(loss_notification); | ||
} | ||
|
||
webrtc::VideoEncoder::EncoderInfo I420EncoderAdapter::GetEncoderInfo() const { | ||
return encoder_->GetEncoderInfo(); | ||
} | ||
|
||
#include "sora/i420_encoder_adapter.h" | ||
|
||
#include <rtc_base/logging.h> | ||
|
||
namespace sora { | ||
|
||
I420EncoderAdapter::I420EncoderAdapter( | ||
std::shared_ptr<webrtc::VideoEncoder> encoder) | ||
: encoder_(encoder) {} | ||
|
||
void I420EncoderAdapter::SetFecControllerOverride( | ||
webrtc::FecControllerOverride* fec_controller_override) { | ||
encoder_->SetFecControllerOverride(fec_controller_override); | ||
} | ||
int I420EncoderAdapter::Release() { | ||
return encoder_->Release(); | ||
} | ||
int I420EncoderAdapter::InitEncode( | ||
const webrtc::VideoCodec* codec_settings, | ||
const webrtc::VideoEncoder::Settings& settings) { | ||
return encoder_->InitEncode(codec_settings, settings); | ||
} | ||
int I420EncoderAdapter::Encode( | ||
const webrtc::VideoFrame& input_image, | ||
const std::vector<webrtc::VideoFrameType>* frame_types) { | ||
auto frame = input_image; | ||
auto buffer = frame.video_frame_buffer(); | ||
if (buffer->type() == webrtc::VideoFrameBuffer::Type::kNative) { | ||
frame.set_video_frame_buffer(buffer->ToI420()); | ||
} | ||
return encoder_->Encode(frame, frame_types); | ||
} | ||
|
||
int I420EncoderAdapter::RegisterEncodeCompleteCallback( | ||
webrtc::EncodedImageCallback* callback) { | ||
return encoder_->RegisterEncodeCompleteCallback(callback); | ||
} | ||
void I420EncoderAdapter::SetRates(const RateControlParameters& parameters) { | ||
encoder_->SetRates(parameters); | ||
} | ||
void I420EncoderAdapter::OnPacketLossRateUpdate(float packet_loss_rate) { | ||
encoder_->OnPacketLossRateUpdate(packet_loss_rate); | ||
} | ||
void I420EncoderAdapter::OnRttUpdate(int64_t rtt_ms) { | ||
encoder_->OnRttUpdate(rtt_ms); | ||
} | ||
void I420EncoderAdapter::OnLossNotification( | ||
const LossNotification& loss_notification) { | ||
encoder_->OnLossNotification(loss_notification); | ||
} | ||
|
||
webrtc::VideoEncoder::EncoderInfo I420EncoderAdapter::GetEncoderInfo() const { | ||
return encoder_->GetEncoderInfo(); | ||
} | ||
|
||
} // namespace sora |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.