41 namespace ArgusSamples
48 const float seconds = atof(optArg);
50 ORIGINATE_ERROR(
"'SECONDS' is invalid, must not be less than or equal to zero");
53 PROPAGATE_ERROR(module->
start());
68 PROPAGATE_ERROR(Window::getInstance().pollEvents());
73 recordingGuard.cancel();
77 runningGuard.cancel();
78 PROPAGATE_ERROR(module->
stop());
93 : m_initialized(false)
95 , m_guiContainerConfig(NULL)
112 PROPAGATE_ERROR(options.addOption(
113 Options::Option(
"video",
'v',
"DURATION",
114 Options::Option::TYPE_ACTION, Options::Option::FLAG_REQUIRED_ARGUMENT,
115 "record video for DURATION seconds and save to a file.",
video,
this)));
117 PROPAGATE_ERROR(options.addOption(
118 createValueOption(
"videobitrate", 0,
"RATE",
119 "set the video bit rate mode to RATE. If RATE is zero a reasonable default "
121 PROPAGATE_ERROR(options.addOption(
122 createValueOption(
"videoformat", 0,
"FORMAT",
124 PROPAGATE_ERROR(options.addOption(
125 createValueOption(
"videofiletype", 0,
"TYPE",
126 "set the video file type. For 'h265' set the file type as 'mkv' since 'h265' is only "
139 PROPAGATE_ERROR_CONTINUE(
stop());
154 Window::IGuiContainer *iGuiContainerConfig)
160 PROPAGATE_ERROR(Window::getInstance().registerObserver(
this));
168 PROPAGATE_ERROR(Window::IGuiContainerGrid::create(&
m_guiConfig));
171 UniquePointer<Window::IGuiElement> element;
174 Window::IGuiContainerGrid::BuildHelper buildHelper(
m_guiConfig);
176 #define CREATE_GUI_ELEMENT(_NAME, _VALUE) \
177 PROPAGATE_ERROR(Window::IGuiElement::createValue(&dispatcher._VALUE, &element));\
178 PROPAGATE_ERROR(buildHelper.append(_NAME, element.get())); \
181 #define CREATE_GUI_ELEMENT_COMBO_BOX(_NAME, _VALUE, _FROMTYPE, _TOTYPE) \
182 assert(sizeof(_FROMTYPE) == sizeof(_TOTYPE)); \
183 PROPAGATE_ERROR(Window::IGuiElement::createValue(reinterpret_cast< \
184 Value<_TOTYPE>*>(&dispatcher._VALUE), &element)); \
185 PROPAGATE_ERROR(buildHelper.append(_NAME, element.get())); \
195 #undef CREATE_GUI_ELEMENT
196 #undef CREATE_GUI_ELEMENT_COMBO_BOX
198 PROPAGATE_ERROR(Window::IGuiElement::createAction(
"Toggle Recording",
200 Window::IGuiElement::ICON_MEDIA_RECORD, &element));
201 PROPAGATE_ERROR(buildHelper.append(element.get(), 2));
228 PROPAGATE_ERROR(Window::getInstance().unregisterObserver(
this));
237 if (key == Key(
"space"))