-
Notifications
You must be signed in to change notification settings - Fork 169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Common] util function to handle tensors #3546
Conversation
📝 TAOS-CI Version: 1.5.20200925. Thank you for submitting PR #3546. Please a submit 1commit/1PR (one commit per one PR) policy to get comments quickly from reviewers. Your PR must pass all verificiation processes of cibot before starting a review process from reviewers. If you are new member to join this project, please read manuals in documentation folder and wiki page. In order to monitor a progress status of your PR in more detail, visit http://nnstreamer.mooo.com/. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jaeyun-jung, 💯 All CI checkers are successfully verified. Thanks.
gboolean configured = FALSE; | ||
|
||
if (!GST_IS_BUFFER (in) || !gst_tensors_config_validate (config)) | ||
goto error; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about just returning NULL? gst_buffer_unref
can be called when in
is a non-buffer instance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, updated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have started writing more elaborated error messages for exceptions.
Please describe the error and how the user should correct the error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jaeyun-jung, 💯 All CI checkers are successfully verified. Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jaeyun-jung, 💯 All CI checkers are successfully verified. Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
} | ||
|
||
if (!gst_buffer_map (in, &map, GST_MAP_READ)) | ||
goto error; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same for this error.
for (i = 0; i < num; i++) { | ||
/* invalid memory size */ | ||
if (offset + mem_size[i] > total) | ||
goto error; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here, too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add "useful" error messages (what's wrong & how to fix it) for all error/exceptions.
With gstreamer plugins, nnstreamer element may receive gst-buffer with invalid memory chunks. nnstreamer internally checks the number of tensors using the mem blocks in gst-buffer. To handle multi tensors, add util function to separate memories in gst-buffer. Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jaeyun-jung, 💯 All CI checkers are successfully verified. Thanks.
With gstreamer plugins, nnstreamer element may receive gst-buffer with invalid memory chunks.
nnstreamer internally checks the number of tensors using the mem blocks in gst-buffer.
To handle multi tensors, add util function to separate memories in gst-buffer.
Signed-off-by: Jaeyun jy1210.jung@samsung.com