src/platform/qt/VideoView.h (view raw)
1#ifndef QGBA_VIDEO_VIEW
2#define QGBA_VIDEO_VIEW
3
4#ifdef USE_FFMPEG
5
6#include <QWidget>
7
8#include "ui_VideoView.h"
9
10extern "C" {
11#include "platform/ffmpeg/ffmpeg-encoder.h"
12}
13
14namespace QGBA {
15
16class VideoView : public QWidget {
17Q_OBJECT
18
19public:
20 VideoView(QWidget* parent = nullptr);
21 virtual ~VideoView();
22
23 GBAAVStream* getStream() { return &m_encoder.d; }
24
25public slots:
26 void startRecording();
27 void stopRecording();
28
29signals:
30 void recordingStarted(GBAAVStream*);
31 void recordingStopped();
32
33private slots:
34 void selectFile();
35 void setFilename(const QString&);
36 void setAudioCodec(const QString&);
37 void setVideoCodec(const QString&);
38 void setContainer(const QString&);
39
40 void setAudioBitrate(int);
41 void setVideoBitrate(int);
42
43private:
44 bool validateSettings();
45 static QString sanitizeCodec(const QString&);
46
47 Ui::VideoView m_ui;
48
49 FFmpegEncoder m_encoder;
50
51 QString m_filename;
52 QString m_audioCodec;
53 QString m_videoCodec;
54 QString m_container;
55 char* m_audioCodecCstr;
56 char* m_videoCodecCstr;
57 char* m_containerCstr;
58
59 int m_abr;
60 int m_vbr;
61
62 static QMap<QString, QString> s_acodecMap;
63 static QMap<QString, QString> s_vcodecMap;
64 static QMap<QString, QString> s_containerMap;
65};
66
67}
68
69#endif
70
71#endif