mirror of
https://github.com/kunkundi/crossdesk.git
synced 2025-10-27 04:35:34 +08:00
[fix] fix load NvCodec API failed on Windows
This commit is contained in:
@@ -228,7 +228,6 @@ int PeerConnection::CreateVideoCodec(bool hardware_acceleration) {
|
||||
"MacOS not support hardware acceleration, use default software codec");
|
||||
}
|
||||
#else
|
||||
InitNvCodecApi();
|
||||
#endif
|
||||
|
||||
if (av1_encoding_) {
|
||||
@@ -237,7 +236,7 @@ int PeerConnection::CreateVideoCodec(bool hardware_acceleration) {
|
||||
LOG_WARN("Only support software codec for AV1");
|
||||
} else {
|
||||
if (hardware_acceleration_) {
|
||||
if (0 == InitNvCodecApi()) {
|
||||
if (0 == LoadNvCodecDll()) {
|
||||
video_encoder_ = VideoEncoderFactory::CreateVideoEncoder(true, false);
|
||||
video_decoder_ = VideoDecoderFactory::CreateVideoDecoder(true, false);
|
||||
} else {
|
||||
@@ -614,6 +613,10 @@ int PeerConnection::Destroy() {
|
||||
delete nv12_data_;
|
||||
nv12_data_ = nullptr;
|
||||
}
|
||||
|
||||
if (hardware_acceleration_) {
|
||||
ReleaseNvCodecDll();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user