fix: ffmpeg http camera stream jittering due to incomplete frames

This commit is contained in:
Ian Chua
2026-09-09 13:40:51 +08:00
parent 8f4df1aa8c
commit b0ada2dee5
3 changed files with 146 additions and 15 deletions
+8
View File
@@ -36,6 +36,14 @@ public:
bool toWxBitmap(wxBitmap &bitmap, wxSize const & size);
// Native size of the most recently decoded frame, or an unspecified size if
// nothing has decoded yet. Lets a caller learn the video dimensions when the
// container/probe could not report them up front.
wxSize decoded_frame_size() const
{
return got_frame_ && frame_ ? wxSize{frame_->width, frame_->height} : wxSize{};
}
private:
AVCodecContext *codec_ctx_ = nullptr;
AVFrame * frame_ = nullptr;