ffmpegdecoder: read pixel format from frame instead of stream

This commit is contained in:
itsmattkc
2022-05-22 13:41:44 -07:00
parent 3de9251cf5
commit cab62ba5d1
5 changed files with 54 additions and 37 deletions
+3 -3
View File
@@ -66,7 +66,7 @@ public:
virtual FootageDescription Probe(const QString &filename, const QAtomicInt *cancelled) const override;
virtual VideoParams GetParamsForTexture(const Decoder::RetrieveVideoParams &p) const override;
virtual VideoParams GetParamsForTexture(const Decoder::RetrieveVideoParams &p) override;
protected:
virtual bool OpenInternal() override;
@@ -134,7 +134,7 @@ private:
*/
static QString FFmpegError(int error_code);
bool InitScaler(const RetrieveVideoParams &params);
bool InitScaler(AVFrame *input, const RetrieveVideoParams &params);
void FreeScaler();
static VideoParams::Format GetNativePixelFormat(AVPixelFormat pix_fmt);
@@ -156,7 +156,7 @@ private:
AVFilterGraph* filter_graph_;
AVFilterContext* buffersrc_ctx_;
AVFilterContext* buffersink_ctx_;
AVPixelFormat ideal_pix_fmt_;
AVPixelFormat input_fmt_;
VideoParams::Format native_pix_fmt_;
int native_channel_count_;