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 to RATE. If RATE is zero a reasonable default "
130 PROPAGATE_ERROR(options.addOption(
131 createValueOption(
"videocontrolrate", 0,
"MODE",
132 "set the video bit-rate control method.",
134 PROPAGATE_ERROR(options.addOption(
135 createValueOption(
"videotwopassCBR", 0,
"ENABLE",
136 "set this flag to enable two pass CBR method for encoding.",
138 PROPAGATE_ERROR(options.addOption(
139 createValueOption(
"videoformat", 0,
"FORMAT",
140 "set the video format. Jetson-tx1 doesn't support vp9, use other "
142 PROPAGATE_ERROR(options.addOption(
143 createValueOption(
"videofiletype", 0,
"TYPE",
144 "set the video file type. For video format 'h265/vp9' set the file type as 'mkv' "
145 "since 'h265 & vp9' are only supported by the 'mkv' container.",
158 PROPAGATE_ERROR_CONTINUE(
stop());
173 Window::IGuiContainer *iGuiContainerConfig)
179 PROPAGATE_ERROR(Window::getInstance().registerObserver(
this));
187 PROPAGATE_ERROR(Window::IGuiContainerGrid::create(&
m_guiConfig));
190 UniquePointer<Window::IGuiElement> element;
193 Window::IGuiContainerGrid::BuildHelper buildHelper(
m_guiConfig);
195 #define CREATE_GUI_ELEMENT(_NAME, _VALUE) \
196 PROPAGATE_ERROR(Window::IGuiElement::createValue(&dispatcher._VALUE, &element));\
197 PROPAGATE_ERROR(buildHelper.append(_NAME, element.get())); \
200 #define CREATE_GUI_ELEMENT_COMBO_BOX(_NAME, _VALUE, _FROMTYPE, _TOTYPE) \
201 assert(sizeof(_FROMTYPE) == sizeof(_TOTYPE)); \
202 PROPAGATE_ERROR(Window::IGuiElement::createValue(reinterpret_cast< \
203 Value<_TOTYPE>*>(&dispatcher._VALUE), &element)); \
204 PROPAGATE_ERROR(buildHelper.append(_NAME, element.get())); \
216 #undef CREATE_GUI_ELEMENT
217 #undef CREATE_GUI_ELEMENT_COMBO_BOX
219 PROPAGATE_ERROR(Window::IGuiElement::createAction(
"Toggle Recording",
221 Window::IGuiElement::ICON_MEDIA_RECORD, &element));
222 PROPAGATE_ERROR(buildHelper.append(element.get(), 2));
249 PROPAGATE_ERROR(Window::getInstance().unregisterObserver(
this));
258 if (key == Key(
"space"))