[fix] fix nvidia encoder crash during reconfigure the resolution

This commit is contained in:
dijunkun
2024-09-10 17:32:43 +08:00
parent 2f16d22ab7
commit a8333c622b
40 changed files with 4507 additions and 25450 deletions

View File

@@ -358,10 +358,12 @@ int OpenH264Encoder::OnEncodedImage(char *encoded_packets, size_t size) {
return 0;
}
void OpenH264Encoder::ForceIdr() {
int OpenH264Encoder::ForceIdr() {
if (openh264_encoder_) {
openh264_encoder_->ForceIntraFrame(true);
return openh264_encoder_->ForceIntraFrame(true);
}
return 0;
}
int OpenH264Encoder::Release() {

View File

@@ -37,7 +37,7 @@ class OpenH264Encoder : public VideoEncoder {
int OnEncodedImage(char* encoded_packets, size_t size);
void ForceIdr();
int ForceIdr();
private:
int InitEncoderParams(int width, int height);