libpromeki 1.0.0-alpha
PROfessional MEdia toolKIt
 
Loading...
Searching...
No Matches
jpegvideocodec.h
Go to the documentation of this file.
1
8#pragma once
9
10
11#include <promeki/config.h>
12#if PROMEKI_ENABLE_PROAV
13#include <promeki/namespace.h>
16#include <promeki/pixelformat.h>
17#include <promeki/deque.h>
18#include <promeki/frame.h>
19#include <promeki/uniqueptr.h>
20
21PROMEKI_NAMESPACE_BEGIN
22
53class JpegVideoEncoder : public VideoEncoder {
54 public:
56 enum Subsampling {
57 Subsampling444,
58 Subsampling422,
59 Subsampling420
60 };
61
62 JpegVideoEncoder();
63 ~JpegVideoEncoder() override;
64
72 static List<int> supportedInputList();
73
74 void onConfigure(const MediaConfig &config) override;
75 Error submitFrame(const Frame &frame) override;
76 Frame receiveFrame() override;
77 Error flush() override;
78 Error reset() override;
79
81 int quality() const { return _quality; }
82
84 Subsampling subsampling() const { return _subsampling; }
85
86 private:
87 struct Impl;
88 using ImplPtr = UniquePtr<Impl>;
89 ImplPtr _impl;
90
91 int _quality = 85;
92 Subsampling _subsampling = Subsampling422;
93 PixelFormat _outputPd;
94 int _capacity = 8;
95 Deque<Frame> _queue;
96 bool _capacityWarned = false;
97};
98
118class JpegVideoDecoder : public VideoDecoder {
119 public:
120 JpegVideoDecoder();
121 ~JpegVideoDecoder() override;
122
128 static List<int> supportedOutputList();
129
130 void onConfigure(const MediaConfig &config) override;
131 Error submitFrame(const Frame &frame) override;
132 Frame receiveFrame() override;
133 Error flush() override;
134 Error reset() override;
135
136 private:
137 struct Impl;
138 using ImplPtr = UniquePtr<Impl>;
139 ImplPtr _impl;
140
141 PixelFormat _outputPd;
142 int _capacity = 8;
143 Deque<Frame> _queue;
144 bool _capacityWarned = false;
145};
146
147PROMEKI_NAMESPACE_END
148
149#endif // PROMEKI_ENABLE_PROAV