]> git.sesse.net Git - pkanalytics/blobdiff - video_widget.h
Make it possible to zoom the VideoWidget.
[pkanalytics] / video_widget.h
index 293c968852d4ef976c60ed30394a4740efdc2ad5..801d5cdb6844565e1c7de2853a06de28bc6e99ee 100644 (file)
@@ -37,6 +37,7 @@ public:
        void initializeGL() override;
        void resizeGL(int w, int h) override;
        void paintGL() override;
+       void wheelEvent(QWheelEvent *event) override;
 
 signals:
        void position_changed(uint64_t pos);
@@ -59,6 +60,11 @@ private:
        GLuint last_chroma_width = 0, last_chroma_height = 0;
        GLfloat cbcr_offset[2];
        double display_aspect = 1.0;
+       double zoom_matrix[9] = {  // Column-major, to match with OpenGL.
+               1.0, 0.0, 0.0,
+               0.0, 1.0, 0.0,
+               0.0, 0.0, 1.0,
+       };
 
        int64_t pts_origin;
        int64_t last_pts;
@@ -95,6 +101,8 @@ private:
        Frame make_video_frame(const AVFrame *frame);
        bool process_queued_commands(AVFormatContext *format_ctx, AVCodecContext *video_codec_ctx, int video_stream_index, bool *seeked);
        void store_pts(int64_t pts);
+
+       void fixup_zoom_matrix();
 };
 
 #endif  // !defined(_VIDEO_WIDGET_H)