Fix h264 frame size error

This commit is contained in:
dijunkun
2023-12-05 15:09:25 +08:00
parent 62f85bb333
commit 936348ba9e
3 changed files with 10 additions and 9 deletions

View File

@@ -50,6 +50,10 @@ int NvidiaVideoDecoder::Decode(
return -1;
}
if (SAVE_DECODER_STREAM) {
fwrite((unsigned char *)data, 1, size, file_);
}
if ((*(data + 4) & 0x1f) == 0x07) {
// LOG_WARN("Receive key frame");
}
@@ -67,10 +71,6 @@ int NvidiaVideoDecoder::Decode(
data, decoder->GetWidth() * decoder->GetHeight() * 3 / 2,
decoder->GetWidth(), decoder->GetHeight());
on_receive_decoded_frame(decoded_frame);
if (SAVE_DECODER_STREAM) {
fwrite((unsigned char *)decoded_frame.Buffer(), 1,
decoded_frame.Size(), file_);
}
}
}
}

View File

@@ -152,6 +152,10 @@ int OpenH264Decoder::Decode(
fwrite((unsigned char *)data, 1, size, h264_stream_);
}
if ((*(data + 4) & 0x1f) == 0x07) {
// LOG_WARN("Receive key frame");
}
SBufferInfo sDstBufInfo = {0};
memset(&sDstBufInfo, 0, sizeof(SBufferInfo));