File indexing completed on 2025-01-05 03:57:27
0001 /* ============================================================ 0002 * 0003 * This file is a part of digiKam project 0004 * https://www.digikam.org 0005 * 0006 * Date : 2006-01-14 0007 * Description : QtAVPlayer video integration class. 0008 * 0009 * SPDX-FileCopyrightText: 2023-2024 by Gilles Caulier <caulier dot gilles at gmail dot com> 0010 * 0011 * SPDX-License-Identifier: GPL-2.0-or-later 0012 * 0013 * ============================================================ */ 0014 0015 #ifndef DIGIKAM_DVIDEO_WIDGET_H 0016 #define DIGIKAM_DVIDEO_WIDGET_H 0017 0018 // Qt includes 0019 0020 #include <QMediaObject> 0021 #include <QFrame> 0022 #include <QVideoFrame> 0023 #include <QGraphicsView> 0024 0025 // QtAVPlayer includes 0026 0027 #include "qavplayer.h" 0028 #include "qavvideoframe.h" 0029 #include "qavaudioframe.h" 0030 #include "qavaudiooutput.h" 0031 0032 namespace Digikam 0033 { 0034 0035 class Q_DECL_HIDDEN DVideoWidget : public QFrame 0036 { 0037 Q_OBJECT 0038 0039 public: 0040 0041 explicit DVideoWidget(QWidget* const parent); 0042 ~DVideoWidget(); 0043 0044 QAVPlayer* player() const; 0045 QAVAudioOutput* audioOutput() const; 0046 QVideoFrame videoFrame() const; 0047 QGraphicsView* view() const; 0048 0049 int videoMediaOrientation() const; 0050 0051 void setVideoItemOrientation(int orientation); 0052 int videoItemOrientation() const; 0053 0054 void adjustVideoSize(); 0055 0056 Q_SIGNALS: 0057 0058 void positionChanged(qint64); 0059 0060 private Q_SLOTS: 0061 0062 void slotAudioFrame(const QAVAudioFrame& frame); 0063 void slotVideoFrame(const QAVVideoFrame& frame); 0064 0065 private: 0066 0067 class Private; 0068 Private* const d; 0069 }; 0070 0071 } // namespace Digikam 0072 0073 #endif // DIGIKAM_DVIDEO_WIDGET_H