42 namespace ArgusSamples
49 fprintf(stderr,
"------------------------------------------------------\n");
50 fprintf(stderr,
"Error: Video recording is not supported on Android due\n");
51 fprintf(stderr,
"to the lack of the required gstreamer functionality\n");
52 fprintf(stderr,
"------------------------------------------------------\n");
53 ORIGINATE_ERROR(
"Unsupported function on Android");
58 const float seconds = atof(optArg);
60 ORIGINATE_ERROR(
"'SECONDS' is invalid, must not be less than or equal to zero");
63 PROPAGATE_ERROR(module->
start());
78 PROPAGATE_ERROR(Window::getInstance().pollEvents());
83 recordingGuard.cancel();
87 runningGuard.cancel();
88 PROPAGATE_ERROR(module->
stop());
103 : m_initialized(false)
105 , m_guiContainerConfig(NULL)
122 PROPAGATE_ERROR(options.addOption(
123 Options::Option(
"video",
'v',
"DURATION", Options::Option::TYPE_ACTION,
124 "record video for DURATION seconds and save to a file.",
video,
this)));
126 PROPAGATE_ERROR(options.addOption(
127 createValueOption(
"videobitrate", 0,
"RATE",
128 "set the video bit rate mode to RATE. If RATE is zero a reasonable default "
130 PROPAGATE_ERROR(options.addOption(
131 createValueOption(
"videoformat", 0,
"FORMAT",
132 "set the video format. Jetson-tx1 doesn't support vp9, use other "
134 PROPAGATE_ERROR(options.addOption(
135 createValueOption(
"videofiletype", 0,
"TYPE",
136 "set the video file type. For video format 'h265/vp9' set the file type as 'mkv' "
137 "since 'h265 & vp9' are only supported by the 'mkv' container.",
150 PROPAGATE_ERROR_CONTINUE(
stop());
165 Window::IGuiContainer *iGuiContainerConfig)
171 PROPAGATE_ERROR(Window::getInstance().registerObserver(
this));
179 PROPAGATE_ERROR(Window::IGuiContainerGrid::create(&
m_guiConfig));
182 UniquePointer<Window::IGuiElement> element;
185 Window::IGuiContainerGrid::BuildHelper buildHelper(
m_guiConfig);
187 #define CREATE_GUI_ELEMENT(_NAME, _VALUE) \
188 PROPAGATE_ERROR(Window::IGuiElement::createValue(&dispatcher._VALUE, &element));\
189 PROPAGATE_ERROR(buildHelper.append(_NAME, element.get())); \
192 #define CREATE_GUI_ELEMENT_COMBO_BOX(_NAME, _VALUE, _FROMTYPE, _TOTYPE) \
193 assert(sizeof(_FROMTYPE) == sizeof(_TOTYPE)); \
194 PROPAGATE_ERROR(Window::IGuiElement::createValue(reinterpret_cast< \
195 Value<_TOTYPE>*>(&dispatcher._VALUE), &element)); \
196 PROPAGATE_ERROR(buildHelper.append(_NAME, element.get())); \
206 #undef CREATE_GUI_ELEMENT
207 #undef CREATE_GUI_ELEMENT_COMBO_BOX
209 PROPAGATE_ERROR(Window::IGuiElement::createAction(
"Toggle Recording",
211 Window::IGuiElement::ICON_MEDIA_RECORD, &element));
212 PROPAGATE_ERROR(buildHelper.append(element.get(), 2));
239 PROPAGATE_ERROR(Window::getInstance().unregisterObserver(
this));
248 if (key == Key(
"space"))