summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authoramineer <amineer@google.com>2015-07-09 13:20:34 -0700
committerCommit bot <commit-bot@chromium.org>2015-07-09 20:20:59 +0000
commite735fb0c4b13b72561b8f9931a8788e97deced33 (patch)
treeb1835de9888be97bf730c4be243e30ab0ef91cbe /media
parente08618ef94f9f536c3fa548abfae85211632dedf (diff)
downloadchromium_src-e735fb0c4b13b72561b8f9931a8788e97deced33.zip
chromium_src-e735fb0c4b13b72561b8f9931a8788e97deced33.tar.gz
chromium_src-e735fb0c4b13b72561b8f9931a8788e97deced33.tar.bz2
Revert of Change the video color space default. (patchset #4 id:60001 of https://codereview.chromium.org/1221903003/)
Reason for revert: Causing official continuous builds to fail with the following: ../../media/cast/sender/h264_vt_encoder_unittest.cc:308:22: error: no matching constructor for initialization of 'media::VideoDecoderConfig' VideoDecoderConfig config(kCodecH264, H264PROFILE_MAIN, frame_->format(), ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../media/base/video_decoder_config.h:78:3: note: candidate constructor not viable: requires 10 arguments, but 9 were provided VideoDecoderConfig(VideoCodec codec, ^ ../../media/base/video_decoder_config.h:70:20: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 9 were provided class MEDIA_EXPORT VideoDecoderConfig { ^ ../../media/base/video_decoder_config.h:74:3: note: candidate constructor not viable: requires 0 arguments, but 9 were provided VideoDecoderConfig(); ^ 1 error generated. Original issue's description: > Change the video color space default. > > Previously video without color space metadata was assumed to be in > Rec601. Now the default depends on the kind of playback. Normal src= > defaults to Rec601 for SD sized video (<720 pixels high), and Rec709 for > HD. MSE will always default to Rec709. Using a size based heuristic > doesn't make sense for MSE where it is common for the resolution to > change mid playback. > > This CL doesn't change the meaning of COLOR_SPACE_UNSPECIFIED. Instead, > it adds a color space field to VideoDecoderConfig, and updates the video > decoders to use this as the default if they don't find a more > authoritative value in the bitstream. > > This also fixes a (year old!) bug causing the blackwhite > tests to always succeed, renames the rec709 blackwhite test > file to match the name in blackwhite.html, and re-encodes it > to contain the color space metadata (previously it had none). > > BUG=333619 > > Committed: https://crrev.com/4dc6c2ad0e595a5e0b543e8e1b8961ee0d742a32 > Cr-Commit-Position: refs/heads/master@{#338110} TBR=dalecurtis@chromium.org,bbudge@chromium.org,codebythepound@gmail.com,gunsch@chromium.org,lcwu@chromium.org,watk@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=333619 Review URL: https://codereview.chromium.org/1228843003 Cr-Commit-Position: refs/heads/master@{#338124}
Diffstat (limited to 'media')
-rw-r--r--media/base/test_helpers.cc5
-rw-r--r--media/base/video_decoder_config.cc36
-rw-r--r--media/base/video_decoder_config.h23
-rw-r--r--media/base/video_frame.h6
-rw-r--r--media/ffmpeg/ffmpeg_common.cc40
-rw-r--r--media/ffmpeg/ffmpeg_common.h7
-rw-r--r--media/filters/decrypting_demuxer_stream.cc2
-rw-r--r--media/filters/ffmpeg_video_decoder.cc13
-rw-r--r--media/filters/ffmpeg_video_decoder_unittest.cc12
-rw-r--r--media/filters/vpx_video_decoder.cc7
-rw-r--r--media/formats/mp2t/es_adapter_video_unittest.cc11
-rw-r--r--media/formats/mp2t/es_parser_h264.cc1
-rw-r--r--media/formats/mp4/mp4_stream_parser.cc4
-rw-r--r--media/formats/webm/webm_video_client.cc2
-rw-r--r--media/mojo/interfaces/media_types.mojom10
-rw-r--r--media/mojo/services/media_type_converters.cc20
-rw-r--r--media/test/data/blackwhite_yuv420p_rec709.mp4bin2147 -> 0 bytes
17 files changed, 79 insertions, 120 deletions
diff --git a/media/base/test_helpers.cc b/media/base/test_helpers.cc
index 2b108ff..f4ba991 100644
--- a/media/base/test_helpers.cc
+++ b/media/base/test_helpers.cc
@@ -126,9 +126,8 @@ static VideoDecoderConfig GetTestConfig(VideoCodec codec,
gfx::Size natural_size = coded_size;
return VideoDecoderConfig(codec, VIDEO_CODEC_PROFILE_UNKNOWN,
- VideoFrame::YV12,
- VideoFrame::COLOR_SPACE_UNSPECIFIED, coded_size,
- visible_rect, natural_size, NULL, 0, is_encrypted);
+ VideoFrame::YV12, coded_size, visible_rect, natural_size,
+ NULL, 0, is_encrypted);
}
static const gfx::Size kNormalSize(320, 240);
diff --git a/media/base/video_decoder_config.cc b/media/base/video_decoder_config.cc
index fd57933..8825e2d 100644
--- a/media/base/video_decoder_config.cc
+++ b/media/base/video_decoder_config.cc
@@ -19,14 +19,13 @@ VideoDecoderConfig::VideoDecoderConfig()
VideoDecoderConfig::VideoDecoderConfig(VideoCodec codec,
VideoCodecProfile profile,
VideoFrame::Format format,
- VideoFrame::ColorSpace color_space,
const gfx::Size& coded_size,
const gfx::Rect& visible_rect,
const gfx::Size& natural_size,
const uint8* extra_data,
size_t extra_data_size,
bool is_encrypted) {
- Initialize(codec, profile, format, color_space,
+ Initialize(codec, profile, format, VideoFrame::COLOR_SPACE_UNSPECIFIED,
coded_size, visible_rect, natural_size, extra_data,
extra_data_size, is_encrypted, true);
}
@@ -88,7 +87,6 @@ void VideoDecoderConfig::Initialize(VideoCodec codec,
codec_ = codec;
profile_ = profile;
format_ = format;
- color_space_ = color_space;
coded_size_ = coded_size;
visible_rect_ = visible_rect;
natural_size_ = natural_size;
@@ -159,10 +157,42 @@ std::string VideoDecoderConfig::GetHumanReadableCodecName() const {
return "";
}
+VideoCodec VideoDecoderConfig::codec() const {
+ return codec_;
+}
+
+VideoCodecProfile VideoDecoderConfig::profile() const {
+ return profile_;
+}
+
+VideoFrame::Format VideoDecoderConfig::format() const {
+ return format_;
+}
+
+gfx::Size VideoDecoderConfig::coded_size() const {
+ return coded_size_;
+}
+
+gfx::Rect VideoDecoderConfig::visible_rect() const {
+ return visible_rect_;
+}
+
+gfx::Size VideoDecoderConfig::natural_size() const {
+ return natural_size_;
+}
+
const uint8* VideoDecoderConfig::extra_data() const {
if (extra_data_.empty())
return NULL;
return &extra_data_[0];
}
+size_t VideoDecoderConfig::extra_data_size() const {
+ return extra_data_.size();
+}
+
+bool VideoDecoderConfig::is_encrypted() const {
+ return is_encrypted_;
+}
+
} // namespace media
diff --git a/media/base/video_decoder_config.h b/media/base/video_decoder_config.h
index d586a78..00de84e 100644
--- a/media/base/video_decoder_config.h
+++ b/media/base/video_decoder_config.h
@@ -78,7 +78,6 @@ class MEDIA_EXPORT VideoDecoderConfig {
VideoDecoderConfig(VideoCodec codec,
VideoCodecProfile profile,
VideoFrame::Format format,
- VideoFrame::ColorSpace color_space,
const gfx::Size& coded_size,
const gfx::Rect& visible_rect,
const gfx::Size& natural_size,
@@ -113,44 +112,38 @@ class MEDIA_EXPORT VideoDecoderConfig {
std::string GetHumanReadableCodecName() const;
- VideoCodec codec() const { return codec_; }
- VideoCodecProfile profile() const { return profile_; }
+ VideoCodec codec() const;
+ VideoCodecProfile profile() const;
// Video format used to determine YUV buffer sizes.
- VideoFrame::Format format() const { return format_; }
-
- // The default color space of the decoded frames. Decoders should output
- // frames tagged with this color space unless they find a different value in
- // the bitstream.
- VideoFrame::ColorSpace color_space() const { return color_space_; }
+ VideoFrame::Format format() const;
// Width and height of video frame immediately post-decode. Not all pixels
// in this region are valid.
- gfx::Size coded_size() const { return coded_size_; }
+ gfx::Size coded_size() const;
// Region of |coded_size_| that is visible.
- gfx::Rect visible_rect() const { return visible_rect_; }
+ gfx::Rect visible_rect() const;
// Final visible width and height of a video frame with aspect ratio taken
// into account.
- gfx::Size natural_size() const { return natural_size_; }
+ gfx::Size natural_size() const;
// Optional byte data required to initialize video decoders, such as H.264
// AAVC data.
const uint8* extra_data() const;
- size_t extra_data_size() const { return extra_data_.size(); }
+ size_t extra_data_size() const;
// Whether the video stream is potentially encrypted.
// Note that in a potentially encrypted video stream, individual buffers
// can be encrypted or not encrypted.
- bool is_encrypted() const { return is_encrypted_; }
+ bool is_encrypted() const;
private:
VideoCodec codec_;
VideoCodecProfile profile_;
VideoFrame::Format format_;
- VideoFrame::ColorSpace color_space_;
gfx::Size coded_size_;
gfx::Rect visible_rect_;
diff --git a/media/base/video_frame.h b/media/base/video_frame.h
index b97ee1b..2588e46 100644
--- a/media/base/video_frame.h
+++ b/media/base/video_frame.h
@@ -62,14 +62,14 @@ class MEDIA_EXPORT VideoFrame : public base::RefCountedThreadSafe<VideoFrame> {
FORMAT_MAX = XRGB, // Must always be equal to largest entry logged.
};
- // Color space or color range used for the pixels.
+ // Color space or color range used for the pixels, in general this is left
+ // unspecified, meaning Rec601 (SD) is assumed.
// Logged to UMA, so never reuse values. Leave gaps if necessary.
enum ColorSpace {
COLOR_SPACE_UNSPECIFIED = 0, // In general this is Rec601.
COLOR_SPACE_JPEG = 1, // JPEG color range.
COLOR_SPACE_HD_REC709 = 2, // Rec709 "HD" color space.
- COLOR_SPACE_SD_REC601 = 3, // Rec601 "SD" color space.
- COLOR_SPACE_MAX = COLOR_SPACE_SD_REC601,
+ COLOR_SPACE_MAX = COLOR_SPACE_HD_REC709,
};
// Defines the pixel storage type. Differentiates between directly accessible
diff --git a/media/ffmpeg/ffmpeg_common.cc b/media/ffmpeg/ffmpeg_common.cc
index ba01afd..cb806c7 100644
--- a/media/ffmpeg/ffmpeg_common.cc
+++ b/media/ffmpeg/ffmpeg_common.cc
@@ -431,20 +431,16 @@ void AVStreamToVideoDecoderConfig(
format = VideoFrame::YV12A;
}
- // Prefer the color space found by libavcodec if available.
- VideoFrame::ColorSpace color_space =
- AVColorSpaceToVideoFrameColorSpace(stream->codec->colorspace);
- if (color_space == VideoFrame::COLOR_SPACE_UNSPECIFIED) {
- // Otherwise, assume that SD video is usually Rec.601, and HD is usually
- // Rec.709.
- color_space = (natural_size.height() < 720)
- ? VideoFrame::COLOR_SPACE_SD_REC601
- : VideoFrame::COLOR_SPACE_HD_REC709;
- }
-
- config->Initialize(codec, profile, format, color_space, coded_size,
- visible_rect, natural_size, stream->codec->extradata,
- stream->codec->extradata_size, is_encrypted, record_stats);
+ config->Initialize(codec,
+ profile,
+ format,
+ (stream->codec->colorspace == AVCOL_SPC_BT709)
+ ? VideoFrame::COLOR_SPACE_HD_REC709
+ : VideoFrame::COLOR_SPACE_UNSPECIFIED,
+ coded_size, visible_rect, natural_size,
+ stream->codec->extradata, stream->codec->extradata_size,
+ is_encrypted,
+ record_stats);
}
void VideoDecoderConfigToAVCodecContext(
@@ -568,22 +564,6 @@ PixelFormat VideoFormatToPixelFormat(VideoFrame::Format video_format) {
return PIX_FMT_NONE;
}
-VideoFrame::ColorSpace AVColorSpaceToVideoFrameColorSpace(
- AVColorSpace color_space) {
- switch (color_space) {
- case AVCOL_SPC_BT709:
- return VideoFrame::COLOR_SPACE_HD_REC709;
- case AVCOL_SPC_SMPTE170M:
- case AVCOL_SPC_BT470BG:
- return VideoFrame::COLOR_SPACE_SD_REC601;
- case AVCOL_SPC_UNSPECIFIED:
- break;
- default:
- DVLOG(1) << "Unknown AVColorSpace: " << color_space;
- }
- return VideoFrame::COLOR_SPACE_UNSPECIFIED;
-}
-
bool FFmpegUTCDateToTime(const char* date_utc, base::Time* out) {
DCHECK(date_utc);
DCHECK(out);
diff --git a/media/ffmpeg/ffmpeg_common.h b/media/ffmpeg/ffmpeg_common.h
index 86e0742..a73fddd 100644
--- a/media/ffmpeg/ffmpeg_common.h
+++ b/media/ffmpeg/ffmpeg_common.h
@@ -117,16 +117,13 @@ MEDIA_EXPORT ChannelLayout ChannelLayoutToChromeChannelLayout(int64_t layout,
MEDIA_EXPORT SampleFormat
AVSampleFormatToSampleFormat(AVSampleFormat sample_format);
-// Converts FFmpeg's pixel format to its corresponding supported video format.
+// Converts FFmpeg's pixel formats to its corresponding supported video format.
MEDIA_EXPORT VideoFrame::Format PixelFormatToVideoFormat(
PixelFormat pixel_format);
-// Converts video formats to its corresponding FFmpeg pixel formats.
+// Converts video formats to its corresponding FFmpeg's pixel formats.
PixelFormat VideoFormatToPixelFormat(VideoFrame::Format video_format);
-VideoFrame::ColorSpace AVColorSpaceToVideoFrameColorSpace(
- AVColorSpace color_space);
-
// Convert FFmpeg UTC representation (YYYY-MM-DD HH:MM:SS) to base::Time.
// Returns true and sets |*out| if |date_utc| contains a valid
// date string. Otherwise returns fals and timeline_offset is unmodified.
diff --git a/media/filters/decrypting_demuxer_stream.cc b/media/filters/decrypting_demuxer_stream.cc
index 458d688..435a8fb 100644
--- a/media/filters/decrypting_demuxer_stream.cc
+++ b/media/filters/decrypting_demuxer_stream.cc
@@ -399,7 +399,7 @@ void DecryptingDemuxerStream::InitializeDecoderConfig() {
video_config_.Initialize(input_video_config.codec(),
input_video_config.profile(),
input_video_config.format(),
- input_video_config.color_space(),
+ VideoFrame::COLOR_SPACE_UNSPECIFIED,
input_video_config.coded_size(),
input_video_config.visible_rect(),
input_video_config.natural_size(),
diff --git a/media/filters/ffmpeg_video_decoder.cc b/media/filters/ffmpeg_video_decoder.cc
index 2c604f8..fdf8dc5 100644
--- a/media/filters/ffmpeg_video_decoder.cc
+++ b/media/filters/ffmpeg_video_decoder.cc
@@ -127,15 +127,10 @@ int FFmpegVideoDecoder::GetVideoBuffer(struct AVCodecContext* codec_context,
scoped_refptr<VideoFrame> video_frame = frame_pool_.CreateFrame(
format, coded_size, gfx::Rect(size), natural_size, kNoTimestamp());
-
- // Prefer the color space from the codec context. If it's not specified (or is
- // set to an unsupported value), fall back on the value from the config.
- VideoFrame::ColorSpace color_space =
- AVColorSpaceToVideoFrameColorSpace(codec_context->colorspace);
- if (color_space == VideoFrame::COLOR_SPACE_UNSPECIFIED)
- color_space = config_.color_space();
- video_frame->metadata()->SetInteger(VideoFrameMetadata::COLOR_SPACE,
- color_space);
+ if (codec_context->colorspace == AVCOL_SPC_BT709) {
+ video_frame->metadata()->SetInteger(VideoFrameMetadata::COLOR_SPACE,
+ VideoFrame::COLOR_SPACE_HD_REC709);
+ }
for (int i = 0; i < 3; i++) {
frame->data[i] = video_frame->data(i);
diff --git a/media/filters/ffmpeg_video_decoder_unittest.cc b/media/filters/ffmpeg_video_decoder_unittest.cc
index 271ce41..8ecc83d 100644
--- a/media/filters/ffmpeg_video_decoder_unittest.cc
+++ b/media/filters/ffmpeg_video_decoder_unittest.cc
@@ -224,15 +224,15 @@ TEST_F(FFmpegVideoDecoderTest, Initialize_UnsupportedPixelFormat) {
// Ensure decoder handles unsupported pixel formats without crashing.
VideoDecoderConfig config(kCodecVP8, VIDEO_CODEC_PROFILE_UNKNOWN,
VideoFrame::UNKNOWN,
- VideoFrame::COLOR_SPACE_UNSPECIFIED, kCodedSize,
- kVisibleRect, kNaturalSize, NULL, 0, false);
+ kCodedSize, kVisibleRect, kNaturalSize,
+ NULL, 0, false);
InitializeWithConfigWithResult(config, false);
}
TEST_F(FFmpegVideoDecoderTest, Initialize_OpenDecoderFails) {
// Specify Theora w/o extra data so that avcodec_open2() fails.
VideoDecoderConfig config(kCodecTheora, VIDEO_CODEC_PROFILE_UNKNOWN,
- kVideoFormat, VideoFrame::COLOR_SPACE_UNSPECIFIED,
+ kVideoFormat,
kCodedSize, kVisibleRect, kNaturalSize,
NULL, 0, false);
InitializeWithConfigWithResult(config, false);
@@ -243,7 +243,6 @@ TEST_F(FFmpegVideoDecoderTest, Initialize_AspectRatioNumeratorZero) {
VideoDecoderConfig config(kCodecVP8,
VP8PROFILE_ANY,
kVideoFormat,
- VideoFrame::COLOR_SPACE_UNSPECIFIED,
kCodedSize,
kVisibleRect,
natural_size,
@@ -258,7 +257,6 @@ TEST_F(FFmpegVideoDecoderTest, Initialize_AspectRatioDenominatorZero) {
VideoDecoderConfig config(kCodecVP8,
VP8PROFILE_ANY,
kVideoFormat,
- VideoFrame::COLOR_SPACE_UNSPECIFIED,
kCodedSize,
kVisibleRect,
natural_size,
@@ -273,7 +271,6 @@ TEST_F(FFmpegVideoDecoderTest, Initialize_AspectRatioNumeratorNegative) {
VideoDecoderConfig config(kCodecVP8,
VP8PROFILE_ANY,
kVideoFormat,
- VideoFrame::COLOR_SPACE_UNSPECIFIED,
kCodedSize,
kVisibleRect,
natural_size,
@@ -288,7 +285,6 @@ TEST_F(FFmpegVideoDecoderTest, Initialize_AspectRatioDenominatorNegative) {
VideoDecoderConfig config(kCodecVP8,
VP8PROFILE_ANY,
kVideoFormat,
- VideoFrame::COLOR_SPACE_UNSPECIFIED,
kCodedSize,
kVisibleRect,
natural_size,
@@ -305,7 +301,6 @@ TEST_F(FFmpegVideoDecoderTest, Initialize_AspectRatioNumeratorTooLarge) {
VideoDecoderConfig config(kCodecVP8,
VP8PROFILE_ANY,
kVideoFormat,
- VideoFrame::COLOR_SPACE_UNSPECIFIED,
kCodedSize,
kVisibleRect,
natural_size,
@@ -321,7 +316,6 @@ TEST_F(FFmpegVideoDecoderTest, Initialize_AspectRatioDenominatorTooLarge) {
VideoDecoderConfig config(kCodecVP8,
VP8PROFILE_ANY,
kVideoFormat,
- VideoFrame::COLOR_SPACE_UNSPECIFIED,
kCodedSize,
kVisibleRect,
natural_size,
diff --git a/media/filters/vpx_video_decoder.cc b/media/filters/vpx_video_decoder.cc
index d0c57f5..26b60fa 100644
--- a/media/filters/vpx_video_decoder.cc
+++ b/media/filters/vpx_video_decoder.cc
@@ -462,6 +462,7 @@ void VpxVideoDecoder::CopyVpxImageTo(const vpx_image* vpx_image,
VideoFrame::Format codec_format = VideoFrame::YV12;
int uv_rows = (vpx_image->d_h + 1) / 2;
+ VideoFrame::ColorSpace color_space = VideoFrame::COLOR_SPACE_UNSPECIFIED;
if (vpx_image->fmt == VPX_IMG_FMT_I444) {
CHECK(!vpx_codec_alpha_);
codec_format = VideoFrame::YV24;
@@ -469,14 +470,8 @@ void VpxVideoDecoder::CopyVpxImageTo(const vpx_image* vpx_image,
} else if (vpx_codec_alpha_) {
codec_format = VideoFrame::YV12A;
}
-
- // Default to the color space from the config, but if the bistream specifies
- // one, prefer that instead.
- VideoFrame::ColorSpace color_space = config_.color_space();
if (vpx_image->cs == VPX_CS_BT_709)
color_space = VideoFrame::COLOR_SPACE_HD_REC709;
- else if (vpx_image->cs == VPX_CS_BT_601)
- color_space = VideoFrame::COLOR_SPACE_SD_REC601;
// The mixed |w|/|d_h| in |coded_size| is intentional. Setting the correct
// coded width is necessary to allow coalesced memory access, which may avoid
diff --git a/media/formats/mp2t/es_adapter_video_unittest.cc b/media/formats/mp2t/es_adapter_video_unittest.cc
index 631126c..b601f7e 100644
--- a/media/formats/mp2t/es_adapter_video_unittest.cc
+++ b/media/formats/mp2t/es_adapter_video_unittest.cc
@@ -24,9 +24,14 @@ VideoDecoderConfig CreateFakeVideoConfig() {
gfx::Size coded_size(320, 240);
gfx::Rect visible_rect(0, 0, 320, 240);
gfx::Size natural_size(320, 240);
- return VideoDecoderConfig(kCodecH264, H264PROFILE_MAIN, VideoFrame::I420,
- VideoFrame::COLOR_SPACE_UNSPECIFIED, coded_size,
- visible_rect, natural_size, NULL, 0, false);
+ return VideoDecoderConfig(
+ kCodecH264,
+ H264PROFILE_MAIN,
+ VideoFrame::I420,
+ coded_size,
+ visible_rect,
+ natural_size,
+ NULL, 0, false);
}
StreamParserBuffer::BufferQueue
diff --git a/media/formats/mp2t/es_parser_h264.cc b/media/formats/mp2t/es_parser_h264.cc
index 5744cb6..830da34 100644
--- a/media/formats/mp2t/es_parser_h264.cc
+++ b/media/formats/mp2t/es_parser_h264.cc
@@ -282,7 +282,6 @@ bool EsParserH264::UpdateVideoDecoderConfig(const H264SPS* sps) {
kCodecH264,
VIDEO_CODEC_PROFILE_UNKNOWN,
VideoFrame::YV12,
- VideoFrame::COLOR_SPACE_HD_REC709,
coded_size,
visible_rect,
natural_size,
diff --git a/media/formats/mp4/mp4_stream_parser.cc b/media/formats/mp4/mp4_stream_parser.cc
index d8a6980..333f43e 100644
--- a/media/formats/mp4/mp4_stream_parser.cc
+++ b/media/formats/mp4/mp4_stream_parser.cc
@@ -293,8 +293,8 @@ bool MP4StreamParser::ParseMoov(BoxReader* reader) {
is_video_track_encrypted_ = entry.sinf.info.track_encryption.is_encrypted;
DVLOG(1) << "is_video_track_encrypted_: " << is_video_track_encrypted_;
video_config.Initialize(kCodecH264, H264PROFILE_MAIN, VideoFrame::YV12,
- VideoFrame::COLOR_SPACE_HD_REC709,
- coded_size, visible_rect, natural_size,
+ VideoFrame::COLOR_SPACE_UNSPECIFIED, coded_size,
+ visible_rect, natural_size,
// No decoder-specific buffer needed for AVC;
// SPS/PPS are embedded in the video stream
NULL, 0, is_video_track_encrypted_, false);
diff --git a/media/formats/webm/webm_video_client.cc b/media/formats/webm/webm_video_client.cc
index 22a03dd..07f0bfb 100644
--- a/media/formats/webm/webm_video_client.cc
+++ b/media/formats/webm/webm_video_client.cc
@@ -96,7 +96,7 @@ bool WebMVideoClient::InitializeConfig(
}
config->Initialize(video_codec, profile, format,
- VideoFrame::COLOR_SPACE_HD_REC709, coded_size,
+ VideoFrame::COLOR_SPACE_UNSPECIFIED, coded_size,
visible_rect, natural_size, extra_data, extra_data_size,
is_encrypted, true);
return config->IsValidConfig();
diff --git a/media/mojo/interfaces/media_types.mojom b/media/mojo/interfaces/media_types.mojom
index 6944a3a..ff87cec 100644
--- a/media/mojo/interfaces/media_types.mojom
+++ b/media/mojo/interfaces/media_types.mojom
@@ -104,15 +104,6 @@ enum VideoFormat {
FORMAT_MAX = XRGB,
};
-// Kept in sync with media::VideoFrame::ColorSpace via static_asserts.
-enum ColorSpace {
- UNSPECIFIED = 0,
- JPEG = 1,
- HD_REC709 = 2,
- SD_REC601 = 3,
- MAX = SD_REC601,
-};
-
// See media/base/video_decoder_config.h for descriptions.
// Kept in sync with media::VideoCodec via static_asserts.
enum VideoCodec {
@@ -173,7 +164,6 @@ struct VideoDecoderConfig {
VideoCodec codec;
VideoCodecProfile profile;
VideoFormat format;
- ColorSpace color_space;
Size coded_size;
Rect visible_rect;
Size natural_size;
diff --git a/media/mojo/services/media_type_converters.cc b/media/mojo/services/media_type_converters.cc
index 849739f..d1630df 100644
--- a/media/mojo/services/media_type_converters.cc
+++ b/media/mojo/services/media_type_converters.cc
@@ -143,23 +143,6 @@ ASSERT_ENUM_EQ_RAW(VideoFrame::Format,
VideoFrame::FORMAT_MAX,
VIDEO_FORMAT_FORMAT_MAX);
-// ColorSpace.
-ASSERT_ENUM_EQ_RAW(VideoFrame::ColorSpace,
- VideoFrame::COLOR_SPACE_UNSPECIFIED,
- COLOR_SPACE_UNSPECIFIED);
-ASSERT_ENUM_EQ_RAW(VideoFrame::ColorSpace,
- VideoFrame::COLOR_SPACE_JPEG,
- COLOR_SPACE_JPEG);
-ASSERT_ENUM_EQ_RAW(VideoFrame::ColorSpace,
- VideoFrame::COLOR_SPACE_HD_REC709,
- COLOR_SPACE_HD_REC709);
-ASSERT_ENUM_EQ_RAW(VideoFrame::ColorSpace,
- VideoFrame::COLOR_SPACE_SD_REC601,
- COLOR_SPACE_SD_REC601);
-ASSERT_ENUM_EQ_RAW(VideoFrame::ColorSpace,
- VideoFrame::COLOR_SPACE_MAX,
- COLOR_SPACE_MAX);
-
// VideoCodec
ASSERT_ENUM_EQ_RAW(VideoCodec, kUnknownVideoCodec, VIDEO_CODEC_UNKNOWN);
ASSERT_ENUM_EQ(VideoCodec, kCodec, VIDEO_CODEC_, H264);
@@ -443,7 +426,6 @@ TypeConverter<VideoDecoderConfigPtr, media::VideoDecoderConfig>::Convert(
config->codec = static_cast<VideoCodec>(input.codec());
config->profile = static_cast<VideoCodecProfile>(input.profile());
config->format = static_cast<VideoFormat>(input.format());
- config->color_space = static_cast<ColorSpace>(input.color_space());
config->coded_size = Size::From(input.coded_size());
config->visible_rect = Rect::From(input.visible_rect());
config->natural_size = Size::From(input.natural_size());
@@ -465,7 +447,7 @@ TypeConverter<media::VideoDecoderConfig, VideoDecoderConfigPtr>::Convert(
static_cast<media::VideoCodec>(input->codec),
static_cast<media::VideoCodecProfile>(input->profile),
static_cast<media::VideoFrame::Format>(input->format),
- static_cast<media::VideoFrame::ColorSpace>(input->color_space),
+ media::VideoFrame::COLOR_SPACE_UNSPECIFIED,
input->coded_size.To<gfx::Size>(),
input->visible_rect.To<gfx::Rect>(),
input->natural_size.To<gfx::Size>(),
diff --git a/media/test/data/blackwhite_yuv420p_rec709.mp4 b/media/test/data/blackwhite_yuv420p_rec709.mp4
deleted file mode 100644
index 46ff822..0000000
--- a/media/test/data/blackwhite_yuv420p_rec709.mp4
+++ /dev/null
Binary files differ