Medical Imaging Interaction Toolkit  2018.4.99-389bf124
Medical Imaging Interaction Toolkit
QmitkFFmpegWriter.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef QmitkFFmpegWriter_h
14 #define QmitkFFmpegWriter_h
15 
16 #include <QProcess>
17 #include <QSize>
18 
20 
22 {
23  Q_OBJECT
24 
25 public:
26  explicit QmitkFFmpegWriter(QObject *parent = nullptr);
27  ~QmitkFFmpegWriter() override;
28 
29  QString GetFFmpegPath() const;
30  void SetFFmpegPath(const QString &path);
31 
32  QSize GetSize() const;
33  void SetSize(const QSize &size);
34  void SetSize(int width, int height);
35 
36  int GetFramerate() const;
37  void SetFramerate(int framerate);
38 
39  QString GetOutputPath() const;
40  void SetOutputPath(const QString &path);
41 
42  void Start();
43  bool IsRunning() const;
44  void WriteFrame(const unsigned char *frame);
45  void Stop();
46 
47 private slots:
48  void OnProcessError(QProcess::ProcessError error);
49  void OnProcessFinished(int exitCode, QProcess::ExitStatus exitStatus);
50 
51 private:
52  QProcess *m_Process;
53  QString m_FFmpegPath;
54  QSize m_Size;
55  int m_Framerate;
56  QString m_OutputPath;
57  bool m_IsRunning;
58 };
59 
60 #endif
#define MITKQTWIDGETSEXT_EXPORT