-
Notifications
You must be signed in to change notification settings - Fork 67
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
Handle single plane frames #101
base: master
Are you sure you want to change the base?
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 |
---|---|---|
|
@@ -513,15 +513,11 @@ HRESULT VideoCaptureWinRTInternal::FrameArrived( | |
hr = bitmap_buffer->GetPlaneCount(&plane_count); | ||
} | ||
|
||
if (SUCCEEDED(hr)) { | ||
hr = plane_count == 2 ? S_OK : E_FAIL; | ||
} | ||
|
||
if (SUCCEEDED(hr)) { | ||
if (SUCCEEDED(hr) && plane_count >= 1) { | ||
hr = bitmap_buffer->GetPlaneDescription(0, &bitmap_plane_description_y); | ||
} | ||
|
||
if (SUCCEEDED(hr)) { | ||
if (SUCCEEDED(hr) && plane_count == 2) { | ||
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. Previously, plane_count == 3 would have set hr to E_FAIL. Is there a guarantee that plane_count is never any value other than 0, 1, or 2? 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. You're right. It probably makes sense to fail if |
||
hr = bitmap_buffer->GetPlaneDescription(1, &bitmap_plane_description_uv); | ||
} | ||
|
||
|
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.
This change treats 1 plane and 2 plane frames identically. Is that intentional or is there any different work that needs to be done in the 1 plane case?
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's intentional:
pfn_incoming_frame_
is able to figure out the data format and to decode it correctly.