-
-
Notifications
You must be signed in to change notification settings - Fork 55.6k
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
changed order of cap in order to work with jetson orin #25557
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1034,24 +1034,6 @@ bool GStreamerCapture::retrieveVideoFrame(int, OutputArray dst) | |
src.copyTo(dst); | ||
return true; | ||
} | ||
else if (format == "GRAY8") | ||
{ | ||
CV_CheckEQ((int)n_planes, 1, ""); | ||
size_t step = GST_VIDEO_FRAME_PLANE_STRIDE(&frame, 0); | ||
CV_CheckGE(step, (size_t)frame_width, ""); | ||
Mat src(sz, CV_8UC1, GST_VIDEO_FRAME_PLANE_DATA(&frame, 0), step); | ||
src.copyTo(dst); | ||
return true; | ||
} | ||
else if (format == "GRAY16_LE" || format == "GRAY16_BE") | ||
{ | ||
CV_CheckEQ((int)n_planes, 1, ""); | ||
size_t step = GST_VIDEO_FRAME_PLANE_STRIDE(&frame, 0); | ||
CV_CheckGE(step, (size_t)frame_width, ""); | ||
Mat src(sz, CV_16UC1, GST_VIDEO_FRAME_PLANE_DATA(&frame, 0), step); | ||
src.copyTo(dst); | ||
return true; | ||
} | ||
else if (format == "BGRA" || format == "RGBA" || format == "BGRX" || format == "RGBX") | ||
{ | ||
CV_CheckEQ((int)n_planes, 1, ""); | ||
|
@@ -1107,6 +1089,24 @@ bool GStreamerCapture::retrieveVideoFrame(int, OutputArray dst) | |
src2.copyTo(Mat(sz2, CV_8UC1, dst_.ptr<uchar>(frame_height) + src1.total())); | ||
return true; | ||
} | ||
else if (format == "GRAY8") | ||
{ | ||
CV_CheckEQ((int)n_planes, 1, ""); | ||
size_t step = GST_VIDEO_FRAME_PLANE_STRIDE(&frame, 0); | ||
CV_CheckGE(step, (size_t)frame_width, ""); | ||
Mat src(sz, CV_8UC1, GST_VIDEO_FRAME_PLANE_DATA(&frame, 0), step); | ||
src.copyTo(dst); | ||
return true; | ||
} | ||
else if (format == "GRAY16_LE" || format == "GRAY16_BE") | ||
{ | ||
CV_CheckEQ((int)n_planes, 1, ""); | ||
size_t step = GST_VIDEO_FRAME_PLANE_STRIDE(&frame, 0); | ||
CV_CheckGE(step, (size_t)frame_width, ""); | ||
Mat src(sz, CV_16UC1, GST_VIDEO_FRAME_PLANE_DATA(&frame, 0), step); | ||
src.copyTo(dst); | ||
return true; | ||
} | ||
else | ||
{ | ||
CV_Error_(Error::StsNotImplemented, ("Unsupported GStreamer 'video/x-raw' format: %s", format.c_str())); | ||
|
@@ -1618,7 +1618,7 @@ bool GStreamerCapture::open(const String &filename_, const cv::VideoCaptureParam | |
{ | ||
//do not emit signals: all calls will be synchronous and blocking | ||
gst_app_sink_set_emit_signals (GST_APP_SINK(sink.get()), FALSE); | ||
caps.attach(gst_caps_from_string("video/x-raw, format=(string){BGR, GRAY8}; video/x-bayer,format=(string){rggb,bggr,grbg,gbrg}; image/jpeg")); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It breaks grayscale streams. I propose to try:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually I tried that first, but with these caps it will always connect GRAY8. Which is why I changed the order above to GRAY8 behind BGRx ;-) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I submitted PR with alternative solution: #25602 |
||
caps.attach(gst_caps_from_string("video/x-raw, format=(string){BGR, BGRx}; video/x-bayer,format=(string){rggb,bggr,grbg,gbrg}; image/jpeg")); | ||
} | ||
if (audioStream >= 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.
format
isstd::string
. The order change in if-else-if-else chain does not change logic. I propose to revert it.