| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/webmediaplayer_ms.h" | 5 #include "content/renderer/media/webmediaplayer_ms.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 TRACE_EVENT1("webrtc", "WebMediaPlayerMS::OnFrameAvailable", | 77 TRACE_EVENT1("webrtc", "WebMediaPlayerMS::OnFrameAvailable", |
| 78 "Ideal Render Instant", render_time.ToInternalValue()); | 78 "Ideal Render Instant", render_time.ToInternalValue()); |
| 79 } else { | 79 } else { |
| 80 TRACE_EVENT0("webrtc", "WebMediaPlayerMS::OnFrameAvailable"); | 80 TRACE_EVENT0("webrtc", "WebMediaPlayerMS::OnFrameAvailable"); |
| 81 } | 81 } |
| 82 const bool is_opaque = media::IsOpaque(frame->format()); | 82 const bool is_opaque = media::IsOpaque(frame->format()); |
| 83 | 83 |
| 84 if (!received_first_frame_) { | 84 if (!received_first_frame_) { |
| 85 received_first_frame_ = true; | 85 received_first_frame_ = true; |
| 86 last_frame_opaque_ = is_opaque; | 86 last_frame_opaque_ = is_opaque; |
| 87 media::VideoRotation video_rotation; | 87 media::VideoRotation video_rotation = media::VIDEO_ROTATION_0; |
| 88 ignore_result(frame->metadata()->GetRotation( | 88 ignore_result(frame->metadata()->GetRotation( |
| 89 media::VideoFrameMetadata::ROTATION, &video_rotation)); | 89 media::VideoFrameMetadata::ROTATION, &video_rotation)); |
| 90 main_task_runner_->PostTask( | 90 main_task_runner_->PostTask( |
| 91 FROM_HERE, base::Bind(&WebMediaPlayerMS::OnFirstFrameReceived, | 91 FROM_HERE, base::Bind(&WebMediaPlayerMS::OnFirstFrameReceived, |
| 92 player_, video_rotation, is_opaque)); | 92 player_, video_rotation, is_opaque)); |
| 93 } | 93 } |
| 94 | 94 |
| 95 if (last_frame_opaque_ != is_opaque) { | 95 if (last_frame_opaque_ != is_opaque) { |
| 96 last_frame_opaque_ = is_opaque; | 96 last_frame_opaque_ = is_opaque; |
| 97 main_task_runner_->PostTask( | 97 main_task_runner_->PostTask( |
| (...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 655 void WebMediaPlayerMS::ResetCanvasCache() { | 655 void WebMediaPlayerMS::ResetCanvasCache() { |
| 656 DCHECK(thread_checker_.CalledOnValidThread()); | 656 DCHECK(thread_checker_.CalledOnValidThread()); |
| 657 video_renderer_.ResetCache(); | 657 video_renderer_.ResetCache(); |
| 658 } | 658 } |
| 659 | 659 |
| 660 void WebMediaPlayerMS::TriggerResize() { | 660 void WebMediaPlayerMS::TriggerResize() { |
| 661 get_client()->sizeChanged(); | 661 get_client()->sizeChanged(); |
| 662 } | 662 } |
| 663 | 663 |
| 664 } // namespace content | 664 } // namespace content |
| OLD | NEW |