diff options
author | watk <watk@chromium.org> | 2015-07-09 12:16:21 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-07-09 19:17:00 +0000 |
commit | 4dc6c2ad0e595a5e0b543e8e1b8961ee0d742a32 (patch) | |
tree | 2ab38408a1d91b51da57533a1f876900155fcbfb /media/base/video_decoder_config.h | |
parent | 27f3df6a40d985dddfae6c06ceaf305a9203432c (diff) | |
download | chromium_src-4dc6c2ad0e595a5e0b543e8e1b8961ee0d742a32.zip chromium_src-4dc6c2ad0e595a5e0b543e8e1b8961ee0d742a32.tar.gz chromium_src-4dc6c2ad0e595a5e0b543e8e1b8961ee0d742a32.tar.bz2 |
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
Review URL: https://codereview.chromium.org/1221903003
Cr-Commit-Position: refs/heads/master@{#338110}
Diffstat (limited to 'media/base/video_decoder_config.h')
-rw-r--r-- | media/base/video_decoder_config.h | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/media/base/video_decoder_config.h b/media/base/video_decoder_config.h index 00de84e..d586a78 100644 --- a/media/base/video_decoder_config.h +++ b/media/base/video_decoder_config.h @@ -78,6 +78,7 @@ 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, @@ -112,38 +113,44 @@ class MEDIA_EXPORT VideoDecoderConfig { std::string GetHumanReadableCodecName() const; - VideoCodec codec() const; - VideoCodecProfile profile() const; + VideoCodec codec() const { return codec_; } + VideoCodecProfile profile() const { return profile_; } // Video format used to determine YUV buffer sizes. - VideoFrame::Format format() const; + 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_; } // Width and height of video frame immediately post-decode. Not all pixels // in this region are valid. - gfx::Size coded_size() const; + gfx::Size coded_size() const { return coded_size_; } // Region of |coded_size_| that is visible. - gfx::Rect visible_rect() const; + gfx::Rect visible_rect() const { return visible_rect_; } // Final visible width and height of a video frame with aspect ratio taken // into account. - gfx::Size natural_size() const; + gfx::Size natural_size() const { return natural_size_; } // 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; + size_t extra_data_size() const { return extra_data_.size(); } // 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; + bool is_encrypted() const { return is_encrypted_; } private: VideoCodec codec_; VideoCodecProfile profile_; VideoFrame::Format format_; + VideoFrame::ColorSpace color_space_; gfx::Size coded_size_; gfx::Rect visible_rect_; |