3#include "../global.hpp"
4#include "../string.hpp"
5#include "../exception.hpp"
23 friend class RecordingEngine;
61 frameRate_ = frameRate;
80 bool useMetaData_ =
false;
84 double frameRate_ = 25.0;
96friend class DirectShowEngine;
113 auto handle = CreateMovie2();
115 CExports::cvbval_t numComperessors = 0;
116 auto resultNumCompressors = CExports::Movie2GetNumCompressors(handle.get(), numComperessors);
117 if (resultNumCompressors < 0)
118 std::rethrow_exception(CvbException::FromCvbResult(resultNumCompressors,
"failed to get the number of compressors"));
122 for (CExports::cvbres_t i = 0; i < numComperessors; ++i)
125 auto resultCompressorName = CExports::Movie2GetCompressorNameTyped(handle.get(), i, &buffer[0],
static_cast<CExports::cvbres_t
>(buffer.size()));
126 if (resultCompressorName < 0)
127 std::rethrow_exception(CvbException::FromCvbResult(resultCompressorName,
"failed to get compressor name"));
129 codecs[
static_cast<size_t>(i)] =
String(&buffer[0]);
141 auto handle = CreateMovie2();
144 auto resultCompressorName = CExports::Movie2GetCompressorNameTyped(handle.get(),
145 static_cast<CExports::cvbval_t
>(codecIndex_),
147 static_cast<CExports::cvbres_t
>(buffer.size()));
148 if (resultCompressorName < 0)
149 std::rethrow_exception(CvbException::FromCvbResult(resultCompressorName,
"failed to get compressor name"));
151 return String(&buffer[0]);
162 auto codecIndex = std::find(codecs.begin(), codecs.end(), name) - codecs.begin();
166 codecIndex_ =
static_cast<int>(codecIndex);
190 useMetaData_ = useMetaData;
195 int CodecIndex() const noexcept
204 std::unique_ptr<void, void(*)(
void *)> handle(CExports::CreateMovie2Recorder(CExports::Movie2_EngineDirectShow),
205 [](
void * handle) { CVB_CALL_CAPI(ReleaseObject(handle)); });
223friend class RawVideoEngine;
Settings for initializing a direct show engine recorder.
Definition: recording_settings.hpp:94
std::vector< String > AvailableCodecs()
Gets the available codecs currently installed in the system.
Definition: recording_settings.hpp:111
bool UseMetaData() const noexcept
Gets whether text metadata is to be written into the stream.
Definition: recording_settings.hpp:176
void SetUseMetaData(bool useMetaData) noexcept
Sets whether text metadata is to be written into the stream.
Definition: recording_settings.hpp:188
String Codec() const
Gets the name of the codec to use.
Definition: recording_settings.hpp:139
void SetCodec(const String &name)
Sets the name of the codec to use.
Definition: recording_settings.hpp:159
Settings for initializing a raw video engine recorder.
Definition: recording_settings.hpp:221
RawVideoSettings() noexcept
Created default settings.
Definition: recording_settings.hpp:231
Settings for initializing a recorder.
Definition: recording_settings.hpp:22
double FrameRate() const noexcept
Gets the frame rate the video uses for playback.
Definition: recording_settings.hpp:43
void SetFrameRate(double frameRate)
Sets the frame rate the video uses for playback.
Definition: recording_settings.hpp:56
RecordingEngineType EngineType() const noexcept
Returns the engine type.
Definition: recording_settings.hpp:69
RecordingEngineType
Defines the recording engine that the recorder should use.
Definition: movie2.hpp:43
@ DirectShow
Use DirectShow framework for recording AVI files.
@ Undefined
Place holder for situations where the engine is undefined.
Root namespace for the Image Manager interface.
Definition: c_barcode.h:24