3#include "../global.hpp"
4#include "../string.hpp"
5#include "../exception.hpp"
20 class RecordingSettings
22 friend class RecordingEngine;
25 RecordingSettings()
noexcept =
default;
28 virtual ~RecordingSettings() =
default;
56 frameRate_ = frameRate;
76 bool useMetaData_ =
false;
79 double frameRate_ = 25.0;
20 class RecordingSettings {
…};
86 class DirectShowSettings :
public RecordingSettings
89 friend class DirectShowEngine;
92 DirectShowSettings() noexcept
97 ~DirectShowSettings() =
default;
106 auto handle = CreateMovie2();
108 CExports::cvbval_t numComperessors = 0;
109 auto resultNumCompressors = CExports::Movie2GetNumCompressors(handle.get(), numComperessors);
110 if (resultNumCompressors < 0)
112 CvbException::FromCvbResult(resultNumCompressors,
"failed to get the number of compressors"));
115 for (CExports::cvbres_t i = 0; i < numComperessors; ++i)
118 auto resultCompressorName = CExports::Movie2GetCompressorNameTyped(
119 handle.get(), i, &buffer[0],
static_cast<CExports::cvbres_t
>(buffer.size()));
120 if (resultCompressorName < 0)
121 std::rethrow_exception(CvbException::FromCvbResult(resultCompressorName,
"failed to get compressor name"));
123 codecs[
static_cast<size_t>(i)] =
String(&buffer[0]);
135 auto handle = CreateMovie2();
138 auto resultCompressorName =
139 CExports::Movie2GetCompressorNameTyped(handle.get(),
static_cast<CExports::cvbval_t
>(codecIndex_),
140 &buffer[0],
static_cast<CExports::cvbres_t
>(buffer.size()));
141 if (resultCompressorName < 0)
142 std::rethrow_exception(CvbException::FromCvbResult(resultCompressorName,
"failed to get compressor name"));
144 return String(&buffer[0]);
155 auto codecIndex =
std::find(codecs.begin(), codecs.end(), name) - codecs.begin();
159 codecIndex_ =
static_cast<int>(codecIndex);
183 useMetaData_ = useMetaData;
188 int CodecIndex() const noexcept
197 CExports::CreateMovie2Recorder(CExports::Movie2_EngineDirectShow),
86 class DirectShowSettings :
public RecordingSettings {
…};
213 friend class RawVideoEngine;
std::vector< String > AvailableCodecs()
Gets the available codecs currently installed in the system.
Definition recording_settings.hpp:104
bool UseMetaData() const noexcept
Gets whether text metadata is to be written into the stream.
Definition recording_settings.hpp:169
void SetUseMetaData(bool useMetaData) noexcept
Sets whether text metadata is to be written into the stream.
Definition recording_settings.hpp:181
String Codec() const
Gets the name of the codec to use.
Definition recording_settings.hpp:133
void SetCodec(const String &name)
Sets the name of the codec to use.
Definition recording_settings.hpp:152
Settings for initializing a raw video engine recorder.
Definition recording_settings.hpp:211
RawVideoSettings() noexcept
Created default settings.
Definition recording_settings.hpp:220
Settings for initializing a recorder.
Definition recording_settings.hpp:21
double FrameRate() const noexcept
Gets the frame rate the video uses for playback.
Definition recording_settings.hpp:38
void SetFrameRate(double frameRate)
Sets the frame rate the video uses for playback.
Definition recording_settings.hpp:51
RecordingEngineType EngineType() const noexcept
Returns the engine type.
Definition recording_settings.hpp:64
cvbbool_t ReleaseObject(OBJ &Object)
Record movies with classes from this tool.
Definition detail_recording_engine.hpp:15
RecordingEngineType
Defines the recording engine that the recorder should use.
Definition movie2.hpp:32
@ DirectShow
Use DirectShow framework for recording AVI files.
Definition movie2.hpp:36
@ RawVideo
Use RawVideo for recording raw video.
Definition movie2.hpp:38
@ Undefined
Place holder for situations where the engine is undefined.
Definition movie2.hpp:34
Root namespace for the Image Manager interface.
Definition c_bayer_to_rgb.h:17
std::string String
String for wide characters or unicode characters.
Definition string.hpp:49
T rethrow_exception(T... args)