CuteLogger
Fast and simple logging solution for Qt based applications
avformatproducerwidget.h
1 /*
2  * Copyright (c) 2012-2021 Meltytech, LLC
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef AVFORMATPRODUCERWIDGET_H
19 #define AVFORMATPRODUCERWIDGET_H
20 
21 #include <QWidget>
22 #include <QRunnable>
23 #include "abstractproducerwidget.h"
24 #include "sharedframe.h"
25 #include "dialogs/transcodedialog.h"
26 
27 namespace Ui {
28  class AvformatProducerWidget;
29 }
30 
31 class AvformatProducerWidget : public QWidget, public AbstractProducerWidget
32 {
33  Q_OBJECT
34 
35 public:
36  explicit AvformatProducerWidget(QWidget *parent = 0);
37  ~AvformatProducerWidget();
38 
39  // AbstractProducerWidget overrides
40  Mlt::Producer* newProducer(Mlt::Profile&);
41  void setProducer(Mlt::Producer*);
42 
43 public slots:
44  void updateDuration();
45  void rename();
46  void offerConvert(QString message, bool set709Convert = false, bool setSubClip = false);
47 
48 signals:
49  void producerChanged(Mlt::Producer*);
50  void producerReopened(bool play);
51  void modified();
52 
53 protected:
54  void keyPressEvent(QKeyEvent *event);
55 
56 private slots:
57  void onFrameDisplayed(const SharedFrame&);
58 
59  void onProducerChanged(Mlt::Producer*);
60 
61  void onFrameDecoded();
62 
63  void on_videoTrackComboBox_activated(int index);
64 
65  void on_audioTrackComboBox_activated(int index);
66 
67  void on_scanComboBox_activated(int index);
68 
69  void on_fieldOrderComboBox_activated(int index);
70 
71  void on_aspectNumSpinBox_valueChanged(int );
72 
73  void on_aspectDenSpinBox_valueChanged(int );
74 
75  void on_durationSpinBox_editingFinished();
76 
77  void on_speedSpinBox_editingFinished();
78 
79  void on_pitchCheckBox_stateChanged(int state);
80 
81  void on_syncSlider_valueChanged(int value);
82 
83  void on_actionOpenFolder_triggered();
84 
85  void on_menuButton_clicked();
86 
87  void on_actionCopyFullFilePath_triggered();
88 
89  void on_notesTextEdit_textChanged();
90 
91  void on_actionFFmpegInfo_triggered();
92 
93  void on_actionFFmpegIntegrityCheck_triggered();
94 
95  void on_actionFFmpegConvert_triggered();
96 
97  void on_reverseButton_clicked();
98 
99  void on_actionExtractSubclip_triggered();
100 
101  void on_actionSetFileDate_triggered();
102 
103  void on_rangeComboBox_activated(int index);
104 
105  void on_filenameLabel_editingFinished();
106 
107  void on_convertButton_clicked();
108 
109  void on_actionDisableProxy_triggered(bool checked);
110 
111  void on_actionMakeProxy_triggered();
112 
113  void on_actionDeleteProxy_triggered();
114 
115  void on_actionCopyHashCode_triggered();
116 
117  void on_proxyButton_clicked();
118 
119  void on_actionReset_triggered();
120 
121  void on_actionSetEquirectangular_triggered();
122 
123  void on_actionFFmpegVideoQuality_triggered();
124 
125  void on_rotationComboBox_activated(int index);
126 
127 private:
128  Ui::AvformatProducerWidget *ui;
129  int m_defaultDuration;
130  bool m_recalcDuration;
131  bool m_askToConvert;
132 
133  void reopen(Mlt::Producer* p);
134  void recreateProducer();
135  void convert(TranscodeDialog& dialog);
136  bool revertToOriginalResource();
137  void setSyncVisibility();
138 };
139 
140 
141 class DecodeTask : public QObject, public QRunnable
142 {
143  Q_OBJECT
144 
145 public:
146  explicit DecodeTask(AvformatProducerWidget* widget);
147  void run();
148 
149 signals:
150  void frameDecoded();
151 
152 private:
153  QScopedPointer<Mlt::Frame> m_frame;
154 };
155 
156 #endif // AVFORMATPRODUCERWIDGET_H
The SharedFrame provides thread safe access to Mlt::Frame data.
Definition: sharedframe.h:49