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",
123 "set the video format. Jetson-tx1 doesn't support vp9, use other "
125 PROPAGATE_ERROR(options.addOption(
126 createValueOption(
"videofiletype", 0,
"TYPE",
127 "set the video file type. For video format 'h265/vp9' set the file type as 'mkv' "
128 "since 'h265 & vp9' are only supported by the 'mkv' container.",
141 PROPAGATE_ERROR_CONTINUE(
stop());
156 Window::IGuiContainer *iGuiContainerConfig)
162 PROPAGATE_ERROR(Window::getInstance().registerObserver(
this));
170 PROPAGATE_ERROR(Window::IGuiContainerGrid::create(&
m_guiConfig));
173 UniquePointer<Window::IGuiElement> element;
176 Window::IGuiContainerGrid::BuildHelper buildHelper(
m_guiConfig);
178 #define CREATE_GUI_ELEMENT(_NAME, _VALUE) \
179 PROPAGATE_ERROR(Window::IGuiElement::createValue(&dispatcher._VALUE, &element));\
180 PROPAGATE_ERROR(buildHelper.append(_NAME, element.get())); \
183 #define CREATE_GUI_ELEMENT_COMBO_BOX(_NAME, _VALUE, _FROMTYPE, _TOTYPE) \
184 assert(sizeof(_FROMTYPE) == sizeof(_TOTYPE)); \
185 PROPAGATE_ERROR(Window::IGuiElement::createValue(reinterpret_cast< \
186 Value<_TOTYPE>*>(&dispatcher._VALUE), &element)); \
187 PROPAGATE_ERROR(buildHelper.append(_NAME, element.get())); \
197 #undef CREATE_GUI_ELEMENT
198 #undef CREATE_GUI_ELEMENT_COMBO_BOX
200 PROPAGATE_ERROR(Window::IGuiElement::createAction(
"Toggle Recording",
202 Window::IGuiElement::ICON_MEDIA_RECORD, &element));
203 PROPAGATE_ERROR(buildHelper.append(element.get(), 2));
230 PROPAGATE_ERROR(Window::getInstance().unregisterObserver(
this));
239 if (key == Key(
"space"))