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.
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
dmatveev
left a comment
There was a problem hiding this comment.
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.
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.
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.
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
| bool m_isPipelinePlaying = false; | ||
|
|
||
| int64_t m_frameId = 0L; | ||
| size_t m_type = 0; |
|
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? |
|
@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.
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.