CuteLogger
Fast and simple logging solution for Qt based applications
sharedframe.h
1 /*
2  * Copyright (c) 2015 Meltytech, LLC
3  * Author: Brian Matherly <code@brianmatherly.com>
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #ifndef SHAREDFRAME_H
20 #define SHAREDFRAME_H
21 
22 #include <QObject>
23 #include <QExplicitlySharedDataPointer>
24 #include <MltFrame.h>
25 #include <stdint.h>
26 
27 class FrameData;
28 
49 {
50 public:
51  SharedFrame();
52  SharedFrame(Mlt::Frame& frame);
53  SharedFrame(const SharedFrame& other);
54  ~SharedFrame();
55  SharedFrame& operator=(const SharedFrame& other);
56 
57  bool is_valid() const;
58  Mlt::Frame clone(bool audio = false, bool image = false, bool alpha = false) const;
59  int get_int(const char *name) const;
60  int64_t get_int64(const char *name) const;
61  double get_double(const char *name) const;
62  int get_position() const;
63  mlt_image_format get_image_format() const;
64  int get_image_width() const;
65  int get_image_height() const;
66  const uint8_t* get_image(mlt_image_format format) const;
67  mlt_audio_format get_audio_format() const;
68  int get_audio_channels() const;
69  int get_audio_frequency() const;
70  int get_audio_samples() const;
71  const int16_t* get_audio() const;
72 private:
73  QExplicitlySharedDataPointer<FrameData> d;
74 };
75 
76 #endif // SHAREDFRAME_H
The SharedFrame provides thread safe access to Mlt::Frame data.
Definition: sharedframe.h:48