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 <MltFrame.h>
23 #include <QExplicitlySharedDataPointer>
24 #include <QObject>
25 
26 #include <stdint.h>
27 
28 class FrameData;
29 
50 {
51 public:
52  SharedFrame();
53  SharedFrame(Mlt::Frame &frame);
54  SharedFrame(const SharedFrame &other);
55  ~SharedFrame();
56  SharedFrame &operator=(const SharedFrame &other);
57 
58  bool is_valid() const;
59  Mlt::Frame clone(bool audio = false, bool image = false, bool alpha = false) const;
60  int get_int(const char *name) const;
61  int64_t get_int64(const char *name) const;
62  double get_double(const char *name) const;
63  int get_position() const;
64  mlt_image_format get_image_format() const;
65  int get_image_width() const;
66  int get_image_height() const;
67  const uint8_t *get_image(mlt_image_format format) const;
68  mlt_audio_format get_audio_format() const;
69  int get_audio_channels() const;
70  int get_audio_frequency() const;
71  int get_audio_samples() const;
72  const int16_t *get_audio() const;
73  Mlt::Producer *get_original_producer();
74 
75 private:
76  QExplicitlySharedDataPointer<FrameData> d;
77 };
78 
79 #endif // SHAREDFRAME_H
The SharedFrame provides thread safe access to Mlt::Frame data.
Definition: sharedframe.h:50