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;
96 friend 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();
163 if (codecIndex >= static_cast<std::ptrdiff_t>(codecs.size()))
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)); });
223 friend class RawVideoEngine;
void SetUseMetaData(bool useMetaData) noexcept
Sets whether text metadata is to be written into the stream.
Definition: recording_settings.hpp:188
void SetCodec(const String &name)
Sets the name of the codec to use.
Definition: recording_settings.hpp:159
Settings for initializing a direct show engine recorder.
Definition: recording_settings.hpp:93
RecordingEngineType
Defines the recording engine that the recorder should use.
Definition: movie2.hpp:42
double FrameRate() const noexcept
Gets the frame rate the video uses for playback.
Definition: recording_settings.hpp:43
Root namespace for the Image Manager interface.
Definition: version.hpp:11
Settings for initializing a raw video engine recorder.
Definition: recording_settings.hpp:220
std::vector< String > AvailableCodecs()
Gets the available codecs currently installed in the system.
Definition: recording_settings.hpp:111
void SetFrameRate(double frameRate)
Sets the frame rate the video uses for playback.
Definition: recording_settings.hpp:56
RawVideoSettings() noexcept
Created default settings.
Definition: recording_settings.hpp:231
Settings for initializing a recorder.
Definition: recording_settings.hpp:21
bool UseMetaData() const noexcept
Gets whether text metadata is to be written into the stream.
Definition: recording_settings.hpp:176
Use DirectShow framework for recording AVI files.
Place holder for situations where the engine is undefined.
Use RawVideo for recording raw video.
RecordingEngineType EngineType() const noexcept
Returns the engine type.
Definition: recording_settings.hpp:69
String Codec() const
Gets the name of the codec to use.
Definition: recording_settings.hpp:139