Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1580)

Unified Diff: content/renderer/media/capture_video_decoder.cc

Issue 7932005: Reland r101418: Fix aspect ratio and clarify video frame dimensions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/media/capture_video_decoder.h ('k') | content/renderer/media/rtc_video_decoder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/capture_video_decoder.cc
diff --git a/content/renderer/media/capture_video_decoder.cc b/content/renderer/media/capture_video_decoder.cc
index 0ceb1ac035acd0b13f7e910b96c2d98b81f47bec..74652f31ab9f55051fdb7c74b60ea6f940ce33ce 100644
--- a/content/renderer/media/capture_video_decoder.cc
+++ b/content/renderer/media/capture_video_decoder.cc
@@ -50,12 +50,8 @@ void CaptureVideoDecoder::ProduceVideoFrame(
&CaptureVideoDecoder::ProduceVideoFrameOnDecoderThread, video_frame));
}
-int CaptureVideoDecoder::width() {
- return capability_.width;
-}
-
-int CaptureVideoDecoder::height() {
- return capability_.height;
+gfx::Size CaptureVideoDecoder::natural_size() {
+ return gfx::Size(capability_.width, capability_.height);
}
void CaptureVideoDecoder::Play(media::FilterCallback* callback) {
@@ -223,7 +219,8 @@ void CaptureVideoDecoder::OnBufferReadyOnDecoderThread(
if (buf->width != capability_.width || buf->height != capability_.height) {
capability_.width = buf->width;
capability_.height = buf->height;
- host()->SetVideoSize(capability_.width, capability_.height);
+ host()->SetNaturalVideoSize(
+ gfx::Size(capability_.width, capability_.height));
}
// Check if there's a size change.
@@ -242,6 +239,9 @@ void CaptureVideoDecoder::OnBufferReadyOnDecoderThread(
uint8* buffer = buf->memory_pointer;
+ // Assume YV12 format.
+ // TODO(vrk): This DCHECK fails in content_unittests ... it should not!
+ // DCHECK(capability_.raw_type == media::VideoFrame::YV12);
int y_width = capability_.width;
int y_height = capability_.height;
int uv_width = capability_.width / 2;
« no previous file with comments | « content/renderer/media/capture_video_decoder.h ('k') | content/renderer/media/rtc_video_decoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698