summaryrefslogtreecommitdiffstats
path: root/examples/multimedia/camera/videosettings.h
blob: 358b1fb16f5a70213b00918a526d9df0aa8ce492 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause

#ifndef VIDEOSETTINGS_H
#define VIDEOSETTINGS_H

#include <QDialog>

QT_BEGIN_NAMESPACE
class QCameraFormat;
class QComboBox;
class QMediaRecorder;
namespace Ui {
class VideoSettingsUi;
}
QT_END_NAMESPACE

class VideoSettings : public QDialog
{
    Q_OBJECT

public:
    explicit VideoSettings(QMediaRecorder *mediaRecorder, QWidget *parent = nullptr);
    ~VideoSettings();

    void applySettings();
    void updateFormatsAndCodecs();

protected:
    void changeEvent(QEvent *e) override;

private:
    void setFpsRange(const QCameraFormat &format);
    QVariant boxValue(const QComboBox *) const;
    void selectComboBoxItem(QComboBox *box, const QVariant &value);

    Ui::VideoSettingsUi *ui;
    QMediaRecorder *mediaRecorder;
    bool m_updatingFormats = false;
};

#endif // VIDEOSETTINGS_H