-
-
Notifications
You must be signed in to change notification settings - Fork 56.2k
G-API gst source gray support #21560
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
G-API gst source gray support #21560
Conversation
…/opencv into dbudniko/gapi_media_format_gray
modules/gapi/src/streaming/gstreamer/gstreamer_media_adapter.cpp
Outdated
Show resolved
Hide resolved
GAPI_Assert(GST_VIDEO_INFO_FORMAT(m_videoInfo.get()) == GST_VIDEO_FORMAT_NV12); | ||
//GAPI_Assert(GST_VIDEO_INFO_N_PLANES(m_videoInfo.get()) == 2); | ||
GAPI_Assert(GST_VIDEO_INFO_FORMAT(m_videoInfo.get()) == GST_VIDEO_FORMAT_NV12 || | ||
GST_VIDEO_INFO_FORMAT(m_videoInfo.get()) == GST_VIDEO_FORMAT_GRAY8); |
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.
Maybe, these asserts above should be combined, like
GAPI_Assert((GST_VIDEO_INFO_N_PLANES(m_videoInfo.get()) == 2 &&
GST_VIDEO_INFO_FORMAT(m_videoInfo.get()) == GST_VIDEO_FORMAT_NV12)
||
(GST_VIDEO_INFO_N_PLANES(m_videoInfo.get()) == 1 &&
GST_VIDEO_INFO_FORMAT(m_videoInfo.get()) == GST_VIDEO_FORMAT_GRAY8));
But perhaps it looks too heavy
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.
68 commits is way too large, recommend to squash it before merge
break; | ||
} | ||
case GST_VIDEO_FORMAT_GRAY8: { | ||
m_mediaFrameMeta = GFrameDesc{ cv::MediaFormat::GRAY, cv::Size(width, height) }; |
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.
so is it GRAY
or GRAY8
? I believe I've seen GRAY8
somewhere in the doxygen comments (and I believe it is quite legit)
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.
There are different Gst gray formats. GRAY8 GRAY16. MediaFormat GRAY assumes 8-bit integer numbers. Should we align our naming approach with Gst. I have some doubts that 16 bit will be asked by someone.
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.
I have some doubts that 16 bit will be asked by someone.
It seem to be useful for some scenarios, see #18694. Furthermore, there are two variants of this format: GRAY16_LE and GRAY16_BE
@@ -59,6 +59,7 @@ class GStreamerSource::Priv | |||
bool m_isPipelinePlaying = false; | |||
|
|||
int64_t m_frameId = 0L; | |||
size_t m_type = 0; |
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.
What is this?
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.
Comment added.
68 commits is probably result of master merge with media format gray PR merged. I assume that these commits will be automatically squashed during PR final merge. Please correct me if I'm wrong. What is the right way to squash such commits in OpenCV GitHub? |
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!
@alalek could you please merge this PR? |
Combine(Values("videotestsrc pattern=colors num-buffers=10 ! " | ||
"videorate ! videoscale ! " | ||
"video/x-raw,width=640,height=420,framerate=3/1 ! " | ||
"video/x-raw,format=NV12,width=640,height=420,framerate=3/1 ! " | ||
"appsink", | ||
"videotestsrc pattern=colors num-buffers=10 ! " | ||
"videorate ! videoscale ! " | ||
"video/x-raw,format=GRAY8,width=640,height=420,framerate=3/1 ! " | ||
"appsink"), |
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.
It makes sense to add extra indentation for concatenated strings to improve readability of the code.
…mat_gray_plus_gst_source G-API gst source gray support
…mat_gray_plus_gst_source G-API gst source gray support
Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.