Used JMMAPI Package version: 36.4.7-20250918154033 600
I noticed that in the Jetson multimedia API sample program 00_video_decode, setFrameInputMode() is called twice with the same value in an if-else statement. Is this supposed to be the case? What is the purpose of this? The code can be found starting at line 2145 in the file video_decode_main.cpp, but I have also posted it below:
/* Configure for frame input mode for decoder.
Refer V4L2_CID_MPEG_VIDEO_DISABLE_COMPLETE_FRAME_INPUT */
if (ctx.input_nalu)
{
/* Input to the decoder will be nal units. */
nalu_parse_buffer = new char[CHUNK_SIZE];
printf("Setting frame input mode to 1 \n");
ret = ctx.dec->setFrameInputMode(1);
TEST_ERROR(ret < 0,
"Error in decoder setFrameInputMode", cleanup);
}
else
{
/* Input to the decoder will be a chunk of bytes.
NOTE: Set V4L2_CID_MPEG_VIDEO_DISABLE_COMPLETE_FRAME_INPUT control to
false so that application can send chunks of encoded data instead
of forming complete frames. */
printf("Setting frame input mode to 1 \n");
ret = ctx.dec->setFrameInputMode(1);
TEST_ERROR(ret < 0,
"Error in decoder setFrameInputMode", cleanup);
}
*** Please note that this reply is generated by LLM automatically ***
The question is not directly related to the provided context, but rather a separate inquiry about the Jetson Multimedia API sample program. However, I’ll provide a comprehensive answer based on the context.
The context revolves around a discussion between toho, aaron2222, and JerryChang regarding issues with capturing images from a custom sensor using a NVIDIA Jetson Orin NX System. The conversation touches on topics such as:
Camera connector specifications for the Jetson Orin Nano Developer Kit Carrier Board.
Power management features of the Jetson Orin series.
Configuration files for flashing Jetson modules.
Device tree settings for camera configurations.
However, the question posed at the end is unrelated to these topics. It appears to be a separate inquiry about the Jetson Multimedia API sample program, specifically regarding the setFrameInputMode function being called twice with the same value in an if-else statement.
To address this question, I would need more information about the context in which this code is being used. Nevertheless, I can provide some general insights.
The setFrameInputMode function is likely used to set the input mode for video decoding. Calling this function twice with the same value in an if-else statement might seem redundant, but it could be used to ensure that the input mode is set correctly under different conditions.
Without more information about the specific code and its purpose, it’s difficult to provide a definitive answer. If you could provide more context or clarify the question, I’d be happy to try and assist further.
In summary, the provided context does not directly relate to the question posed, and more information is needed to provide a comprehensive answer.
*** Please give the thumbs up if you get answers you like. Or provide feedback to help us improve the answer. ***
Hi,
We have checked it and confirmed it is correct. We send data in chunks or NAL units to the decoder, and neither contains a complete frame. Therefore, we set setFrameInputMode(1) for both cases.
setFrameInputMode(0) should be set only when complete frames (AU units) are sent.
Hi,
It is a bit difficult to feed whole frame data in h264 stream level. Generally if the stream are multiplexed into a mp4 or avi, the size of each frame is stored in container and you can enable the mode to feed the whole frameby parsing container.