Commit ee35d239 authored by Keishi Hattori's avatar Keishi Hattori Committed by Commit Bot

Revert "Add media::GetFormatDescriptionColorSpace"

This reverts commit 6c5fa707.

Reason for revert: VTConfigUtil.FormatDescriptionBT709 and FormatDescriptionInvalid are failing on mac
https://ci.chromium.org/p/chromium/builders/ci/Mac10.10%20Tests/58972

Original change's description:
> Add media::GetFormatDescriptionColorSpace
>
> This function is nearly identical to media::GetImageBufferColorSpace,
> but instead operates on a CMFormatDescriptionRef.
>
> Add DCHECKs that the behavior of the two functions be the same, that is,
> the kCVImageBuffer-prefixed and  kCMFormatDescription-prefixed
> constants be equal.
>
> Use base::mac::CFCast instead of reinterpret_casts.
>
> The next patch in this sequence will move these two functions over
> to media/base/mac, because it will be accessed in capture.
>
> Bug: 959962
> Change-Id: I8a4d8468abc866a13cb6181cbd49d9ee04288124
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2436513
> Commit-Queue: ccameron <ccameron@chromium.org>
> Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#811829}

TBR=dalecurtis@chromium.org,ccameron@chromium.org

Change-Id: Iaa57cf20273eb0bcdace23a1ee9e588da15ea733
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 959962
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2438551Reviewed-by: default avatarKeishi Hattori <keishi@chromium.org>
Commit-Queue: Keishi Hattori <keishi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#811902}
parent ed1301fb
......@@ -26,9 +26,6 @@ CreateFormatExtensions(CMVideoCodecType codec_type,
MEDIA_GPU_EXPORT gfx::ColorSpace GetImageBufferColorSpace(
CVImageBufferRef image_buffer);
MEDIA_GPU_EXPORT gfx::ColorSpace GetFormatDescriptionColorSpace(
CMFormatDescriptionRef format_description);
} // namespace media
#endif // MEDIA_GPU_MAC_VT_CONFIG_UTIL_H_
This diff is collapsed.
......@@ -74,34 +74,6 @@ base::ScopedCFTypeRef<CVImageBufferRef> CreateCVImageBuffer(
return image_buffer;
}
base::ScopedCFTypeRef<CMFormatDescriptionRef> CreateFormatDescription(
CFStringRef primaries,
CFStringRef transfer,
CFStringRef matrix) {
base::ScopedCFTypeRef<CFMutableDictionaryRef> extensions(
CFDictionaryCreateMutable(kCFAllocatorDefault, 0,
&kCFTypeDictionaryKeyCallBacks,
&kCFTypeDictionaryValueCallBacks));
if (primaries) {
CFDictionarySetValue(
extensions, kCMFormatDescriptionExtension_ColorPrimaries, primaries);
}
if (transfer) {
CFDictionarySetValue(
extensions, kCMFormatDescriptionExtension_TransferFunction, transfer);
}
if (matrix) {
CFDictionarySetValue(extensions, kCMFormatDescriptionExtension_YCbCrMatrix,
matrix);
}
base::ScopedCFTypeRef<CMFormatDescriptionRef> result;
CMFormatDescriptionCreate(nullptr, kCMMediaType_Video,
kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange,
extensions.get(), result.InitializeInto());
return result;
}
gfx::ColorSpace ToBT709_APPLE(gfx::ColorSpace cs) {
return gfx::ColorSpace(cs.GetPrimaryID(),
gfx::ColorSpace::TransferID::BT709_APPLE,
......@@ -392,22 +364,4 @@ TEST(VTConfigUtil, GetImageBufferColorSpace_BT2020_HLG) {
}
}
TEST(VTConfigUtil, FormatDescriptionInvalid) {
auto format_descriptor =
CreateFormatDescription(CFSTR("Cows"), CFSTR("Go"), CFSTR("Moo"));
ASSERT_TRUE(format_descriptor);
auto cs = GetFormatDescriptionColorSpace(format_descriptor);
EXPECT_EQ(gfx::ColorSpace::CreateREC709(), cs);
}
TEST(VTConfigUtil, FormatDescriptionBT709) {
auto format_descriptor =
CreateFormatDescription(kCMFormatDescriptionColorPrimaries_ITU_R_709_2,
kCMFormatDescriptionTransferFunction_ITU_R_709_2,
kCMFormatDescriptionYCbCrMatrix_ITU_R_709_2);
ASSERT_TRUE(format_descriptor);
auto cs = GetFormatDescriptionColorSpace(format_descriptor);
EXPECT_EQ(ToBT709_APPLE(gfx::ColorSpace::CreateREC709()), cs);
}
} // namespace media
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment