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

Side by Side Diff: content/renderer/media/video_track_adapter.cc

Issue 2395913003: Cleanup of passing GpuMemoryBuffer backed video frames (Closed)
Patch Set: Rebase Created 4 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/media/video_track_adapter.h" 5 #include "content/renderer/media/video_track_adapter.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 if (!frame->metadata()->GetDouble(media::VideoFrameMetadata::FRAME_RATE, 210 if (!frame->metadata()->GetDouble(media::VideoFrameMetadata::FRAME_RATE,
211 &frame_rate)) { 211 &frame_rate)) {
212 frame_rate = MediaStreamVideoSource::kUnknownFrameRate; 212 frame_rate = MediaStreamVideoSource::kUnknownFrameRate;
213 } 213 }
214 214
215 if (MaybeDropFrame(frame, frame_rate)) 215 if (MaybeDropFrame(frame, frame_rate))
216 return; 216 return;
217 217
218 // TODO(perkj): Allow cropping / scaling of textures once 218 // TODO(perkj): Allow cropping / scaling of textures once
219 // http://crbug/362521 is fixed. 219 // http://crbug/362521 is fixed.
220 if (frame->HasTextures() || 220 if (frame->HasTextures()) {
221 frame->storage_type() == media::VideoFrame::STORAGE_GPU_MEMORY_BUFFERS) {
222 DoDeliverFrame(frame, estimated_capture_time); 221 DoDeliverFrame(frame, estimated_capture_time);
223 return; 222 return;
224 } 223 }
225 scoped_refptr<media::VideoFrame> video_frame(frame); 224 scoped_refptr<media::VideoFrame> video_frame(frame);
226 const double input_ratio = 225 const double input_ratio =
227 static_cast<double>(frame->natural_size().width()) / 226 static_cast<double>(frame->natural_size().width()) /
228 frame->natural_size().height(); 227 frame->natural_size().height();
229 228
230 // If |frame| has larger width or height than requested, or the aspect ratio 229 // If |frame| has larger width or height than requested, or the aspect ratio
231 // does not match the requested, we want to create a wrapped version of this 230 // does not match the requested, we want to create a wrapped version of this
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 } 513 }
515 514
516 io_task_runner_->PostDelayedTask( 515 io_task_runner_->PostDelayedTask(
517 FROM_HERE, base::Bind(&VideoTrackAdapter::CheckFramesReceivedOnIO, this, 516 FROM_HERE, base::Bind(&VideoTrackAdapter::CheckFramesReceivedOnIO, this,
518 set_muted_state_callback, frame_counter_), 517 set_muted_state_callback, frame_counter_),
519 base::TimeDelta::FromSecondsD(kNormalFrameTimeoutInFrameIntervals / 518 base::TimeDelta::FromSecondsD(kNormalFrameTimeoutInFrameIntervals /
520 source_frame_rate_)); 519 source_frame_rate_));
521 } 520 }
522 521
523 } // namespace content 522 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698