| OLD | NEW |
| 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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 if (!frame->metadata()->GetDouble(media::VideoFrameMetadata::FRAME_RATE, | 204 if (!frame->metadata()->GetDouble(media::VideoFrameMetadata::FRAME_RATE, |
| 205 &frame_rate)) { | 205 &frame_rate)) { |
| 206 frame_rate = MediaStreamVideoSource::kUnknownFrameRate; | 206 frame_rate = MediaStreamVideoSource::kUnknownFrameRate; |
| 207 } | 207 } |
| 208 | 208 |
| 209 if (MaybeDropFrame(frame, frame_rate)) | 209 if (MaybeDropFrame(frame, frame_rate)) |
| 210 return; | 210 return; |
| 211 | 211 |
| 212 // TODO(perkj): Allow cropping / scaling of textures once | 212 // TODO(perkj): Allow cropping / scaling of textures once |
| 213 // http://crbug/362521 is fixed. | 213 // http://crbug/362521 is fixed. |
| 214 if (frame->format() == media::VideoFrame::NATIVE_TEXTURE) { | 214 if (frame->storage_type() == media::VideoFrame::STORAGE_TEXTURE) { |
| 215 DoDeliverFrame(frame, estimated_capture_time); | 215 DoDeliverFrame(frame, estimated_capture_time); |
| 216 return; | 216 return; |
| 217 } | 217 } |
| 218 scoped_refptr<media::VideoFrame> video_frame(frame); | 218 scoped_refptr<media::VideoFrame> video_frame(frame); |
| 219 double input_ratio = | 219 double input_ratio = |
| 220 static_cast<double>(frame->natural_size().width()) / | 220 static_cast<double>(frame->natural_size().width()) / |
| 221 frame->natural_size().height(); | 221 frame->natural_size().height(); |
| 222 | 222 |
| 223 // If |frame| has larger width or height than requested, or the aspect ratio | 223 // If |frame| has larger width or height than requested, or the aspect ratio |
| 224 // does not match the requested, we want to create a wrapped version of this | 224 // 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 Loading... |
| 507 } | 507 } |
| 508 | 508 |
| 509 io_task_runner_->PostDelayedTask( | 509 io_task_runner_->PostDelayedTask( |
| 510 FROM_HERE, base::Bind(&VideoTrackAdapter::CheckFramesReceivedOnIO, this, | 510 FROM_HERE, base::Bind(&VideoTrackAdapter::CheckFramesReceivedOnIO, this, |
| 511 set_muted_state_callback, frame_counter_), | 511 set_muted_state_callback, frame_counter_), |
| 512 base::TimeDelta::FromSecondsD(kNormalFrameTimeoutInFrameIntervals / | 512 base::TimeDelta::FromSecondsD(kNormalFrameTimeoutInFrameIntervals / |
| 513 source_frame_rate_)); | 513 source_frame_rate_)); |
| 514 } | 514 } |
| 515 | 515 |
| 516 } // namespace content | 516 } // namespace content |
| OLD | NEW |