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

Unified Diff: media/base/pipeline_impl.cc

Issue 2622803002: Clean-up: media::PipelineMetadata stores the rotated video size. (Closed)
Patch Set: Addressed comments. Created 3 years, 11 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 | « no previous file | media/base/pipeline_metadata.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/pipeline_impl.cc
diff --git a/media/base/pipeline_impl.cc b/media/base/pipeline_impl.cc
index 85b54ec6a274af7867d7cff74ea3ec45a72dbea5..a588bc3d067091c5d8a92ab9f092f7f9f7dc6b27 100644
--- a/media/base/pipeline_impl.cc
+++ b/media/base/pipeline_impl.cc
@@ -34,6 +34,16 @@ static const float kDefaultVolume = 1.0f;
namespace media {
+namespace {
+
+gfx::Size GetRotatedVideoSize(VideoRotation rotation, gfx::Size natural_size) {
+ if (rotation == VIDEO_ROTATION_90 || rotation == VIDEO_ROTATION_270)
+ return gfx::Size(natural_size.height(), natural_size.width());
+ return natural_size;
+}
+
+} // namespace
+
class PipelineImpl::RendererWrapper : public DemuxerHost,
public RendererClient {
public:
@@ -894,7 +904,9 @@ void PipelineImpl::RendererWrapper::ReportMetadata() {
stream = demuxer_->GetStream(DemuxerStream::VIDEO);
if (stream) {
metadata.has_video = true;
- metadata.natural_size = stream->video_decoder_config().natural_size();
+ metadata.natural_size =
+ GetRotatedVideoSize(stream->video_rotation(),
+ stream->video_decoder_config().natural_size());
metadata.video_rotation = stream->video_rotation();
metadata.video_decoder_config = stream->video_decoder_config();
}
« no previous file with comments | « no previous file | media/base/pipeline_metadata.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698