-
Notifications
You must be signed in to change notification settings - Fork 548
[CoreMedia] Improve CMFormatDescription.SubType properties. Fixes #23217. #23262
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
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I'd expect the macios projection of The reason for the initial bug report is that I'd also expect there to be some projection of the values of MediaSubType so that it's possible to write code that's a closer match to the Apple API. e.g. AVCaptureDeviceFormat desc = <something>;
if (desc.MediaSubType == MediaSubType.PixelFormat_32BGRA)
... I think it's more difficult to find things in the dotnet API the further they are from the upstream definition. So, this PR is kind of the opposite of what I was intending to achieve in opening #23217. As Rolf pointed out, all the constants from MediaSubType are actually available in other types (despite the difficultly in actually reasoning that that's the case). Just adding an extra convenience property would be more helpful IMHO: public CVPixelFormatType PixelFormatType {
get {
return MediaType == CMMediaType.Video ? (CVPixelFormatType) MediaSubType : 0;
}
} However, the trouble is with it being a video mediatype is that you don't know whether it is compressed or not, so either the existing Obsoleting CAC3 I think is a good change though, since I'd expect to find it from the usptream identifier |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
LGTM now. Nice one, thanks! |
This comment has been minimized.
This comment has been minimized.
✅ [CI Build #9a5848b] Build passed (Build packages) ✅Pipeline on Agent |
✅ [PR Build #9a5848b] Build passed (Detect API changes) ✅Pipeline on Agent |
✅ API diff for current PR / commitNET (empty diffs)✅ API diff vs stableNET (empty diffs)ℹ️ Generator diffGenerator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes) Pipeline on Agent |
✅ [CI Build #9a5848b] Build passed (Build macOS tests) ✅Pipeline on Agent |
💻 [CI Build #9a5848b] Tests on macOS X64 - Mac Sonoma (14) passed 💻✅ All tests on macOS X64 - Mac Sonoma (14) passed. Pipeline on Agent |
💻 [CI Build #9a5848b] Tests on macOS M1 - Mac Ventura (13) passed 💻✅ All tests on macOS M1 - Mac Ventura (13) passed. Pipeline on Agent |
💻 [CI Build #9a5848b] Tests on macOS M1 - Mac Monterey (12) passed 💻✅ All tests on macOS M1 - Mac Monterey (12) passed. Pipeline on Agent |
💻 [CI Build #9a5848b] Tests on macOS arm64 - Mac Tahoe (26) passed 💻✅ All tests on macOS arm64 - Mac Tahoe (26) passed. Pipeline on Agent |
💻 [CI Build #9a5848b] Tests on macOS arm64 - Mac Sequoia (15) passed 💻✅ All tests on macOS arm64 - Mac Sequoia (15) passed. Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
🚀 [CI Build #9a5848b] Test results 🚀Test results✅ All tests passed on VSTS: test results. 🎉 All 117 tests passed 🎉 Tests counts✅ cecil: All 1 tests passed. Html Report (VSDrops) Download Pipeline on Agent |
Any CMPixelFormat value is also a valid CMVideoCodecType value, so duplicate
the values in CMPixelFormat into CMVideoCodecType.
This helps discovery/intellisense.
Also add a CMMediaSubType enum that mirrors the Swift type with the same name, which can be used to improve discovery/intellisense as well.
Additionally, fix a few other issues as well.
Fixes #23217.