Title: [287158] trunk/Source/WebCore
- Revision
- 287158
- Author
- [email protected]
- Date
- 2021-12-16 14:18:46 -0800 (Thu, 16 Dec 2021)
Log Message
Add an experimental VideoTrackConfiguration class and accessor on VideoTrack
https://bugs.webkit.org/show_bug.cgi?id=230841
<rdar://problem/83837876>
Reviewed by Eric Carlson.
Follow up patch to address post-review comments.
Darin pointed out that CFStringCompare() is likely more expensive than
CFEqual() as the former determines order as well as equality, and a
safeCFEqual() already exists. And while safeCFEqual() has different
behavior than the safeCFStringEquals() lambda when passed two null values,
in every case where safeCFStringEquals() is used, the first parameter has
already been nil-checked. So safeCFStringEquals() is unnecessary and
safeCFEqual() should be used instead.
* platform/graphics/avfoundation/FormatDescriptionUtilities.cpp:
(WebCore::colorSpaceFromFormatDescription):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (287157 => 287158)
--- trunk/Source/WebCore/ChangeLog 2021-12-16 22:02:54 UTC (rev 287157)
+++ trunk/Source/WebCore/ChangeLog 2021-12-16 22:18:46 UTC (rev 287158)
@@ -1,3 +1,24 @@
+2021-12-16 Jer Noble <[email protected]>
+
+ Add an experimental VideoTrackConfiguration class and accessor on VideoTrack
+ https://bugs.webkit.org/show_bug.cgi?id=230841
+ <rdar://problem/83837876>
+
+ Reviewed by Eric Carlson.
+
+ Follow up patch to address post-review comments.
+
+ Darin pointed out that CFStringCompare() is likely more expensive than
+ CFEqual() as the former determines order as well as equality, and a
+ safeCFEqual() already exists. And while safeCFEqual() has different
+ behavior than the safeCFStringEquals() lambda when passed two null values,
+ in every case where safeCFStringEquals() is used, the first parameter has
+ already been nil-checked. So safeCFStringEquals() is unnecessary and
+ safeCFEqual() should be used instead.
+
+ * platform/graphics/avfoundation/FormatDescriptionUtilities.cpp:
+ (WebCore::colorSpaceFromFormatDescription):
+
2021-12-16 Youenn Fablet <[email protected]>
Allow AudioSampleDataSource to increase/decrease buffered data progressively
Modified: trunk/Source/WebCore/platform/graphics/avfoundation/FormatDescriptionUtilities.cpp (287157 => 287158)
--- trunk/Source/WebCore/platform/graphics/avfoundation/FormatDescriptionUtilities.cpp 2021-12-16 22:02:54 UTC (rev 287157)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/FormatDescriptionUtilities.cpp 2021-12-16 22:18:46 UTC (rev 287158)
@@ -58,35 +58,29 @@
if (!formatDescription)
return std::nullopt;
- auto safeCFStringEquals = [] (CFStringRef one, CFStringRef two) -> bool {
- if (!one || !two)
- return false;
- return CFStringCompare(one, two, 0) == kCFCompareEqualTo;
- };
-
PlatformVideoColorSpace colorSpace;
if (auto primaries = static_cast<CFStringRef>(PAL::CMFormatDescriptionGetExtension(formatDescription, PAL::get_CoreMedia_kCMFormatDescriptionExtension_ColorPrimaries()))) {
- if (safeCFStringEquals(primaries, PAL::get_CoreMedia_kCMFormatDescriptionColorPrimaries_ITU_R_709_2()))
+ if (safeCFEqual(primaries, PAL::get_CoreMedia_kCMFormatDescriptionColorPrimaries_ITU_R_709_2()))
colorSpace.primaries = PlatformVideoColorPrimaries::Bt709;
- else if (safeCFStringEquals(primaries, PAL::get_CoreMedia_kCMFormatDescriptionColorPrimaries_EBU_3213()))
+ else if (safeCFEqual(primaries, PAL::get_CoreMedia_kCMFormatDescriptionColorPrimaries_EBU_3213()))
colorSpace.primaries = PlatformVideoColorPrimaries::Bt470bg;
- else if (safeCFStringEquals(primaries, PAL::get_CoreMedia_kCMFormatDescriptionColorPrimaries_SMPTE_C()))
+ else if (safeCFEqual(primaries, PAL::get_CoreMedia_kCMFormatDescriptionColorPrimaries_SMPTE_C()))
colorSpace.primaries = PlatformVideoColorPrimaries::Smpte170m;
}
if (auto transfer = static_cast<CFStringRef>(PAL::CMFormatDescriptionGetExtension(formatDescription, PAL::get_CoreMedia_kCMFormatDescriptionExtension_TransferFunction()))) {
- if (safeCFStringEquals(transfer, PAL::get_CoreMedia_kCMFormatDescriptionTransferFunction_ITU_R_709_2()))
+ if (safeCFEqual(transfer, PAL::get_CoreMedia_kCMFormatDescriptionTransferFunction_ITU_R_709_2()))
colorSpace.transfer = PlatformVideoTransferCharacteristics::Bt709;
- else if (safeCFStringEquals(transfer, PAL::get_CoreMedia_kCMFormatDescriptionTransferFunction_sRGB()))
+ else if (safeCFEqual(transfer, PAL::get_CoreMedia_kCMFormatDescriptionTransferFunction_sRGB()))
colorSpace.transfer = PlatformVideoTransferCharacteristics::Iec6196621;
}
if (auto matrix = static_cast<CFStringRef>(PAL::CMFormatDescriptionGetExtension(formatDescription, PAL::get_CoreMedia_kCMFormatDescriptionExtension_YCbCrMatrix()))) {
- if (safeCFStringEquals(matrix, PAL::get_CoreMedia_kCVImageBufferYCbCrMatrix_ITU_R_709_2()))
+ if (safeCFEqual(matrix, PAL::get_CoreMedia_kCVImageBufferYCbCrMatrix_ITU_R_709_2()))
colorSpace.matrix = PlatformVideoMatrixCoefficients::Bt709;
- else if (safeCFStringEquals(matrix, PAL::get_CoreMedia_kCVImageBufferYCbCrMatrix_ITU_R_601_4()))
+ else if (safeCFEqual(matrix, PAL::get_CoreMedia_kCVImageBufferYCbCrMatrix_ITU_R_601_4()))
colorSpace.matrix = PlatformVideoMatrixCoefficients::Bt470bg;
- else if (safeCFStringEquals(matrix, PAL::get_CoreMedia_kCMFormatDescriptionYCbCrMatrix_SMPTE_240M_1995()))
+ else if (safeCFEqual(matrix, PAL::get_CoreMedia_kCMFormatDescriptionYCbCrMatrix_SMPTE_240M_1995()))
colorSpace.matrix = PlatformVideoMatrixCoefficients::Smpte170m;
}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes