| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_recorder/video_track_recorder.h" | 5 #include "content/renderer/media_recorder/video_track_recorder.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 // Cache the thread sending frames on first frame arrival. | 185 // Cache the thread sending frames on first frame arrival. |
| 186 if (!origin_task_runner_.get()) | 186 if (!origin_task_runner_.get()) |
| 187 origin_task_runner_ = base::ThreadTaskRunnerHandle::Get(); | 187 origin_task_runner_ = base::ThreadTaskRunnerHandle::Get(); |
| 188 DCHECK(origin_task_runner_->BelongsToCurrentThread()); | 188 DCHECK(origin_task_runner_->BelongsToCurrentThread()); |
| 189 if (paused_) | 189 if (paused_) |
| 190 return; | 190 return; |
| 191 | 191 |
| 192 if (!(video_frame->format() == media::PIXEL_FORMAT_I420 || | 192 if (!(video_frame->format() == media::PIXEL_FORMAT_I420 || |
| 193 video_frame->format() == media::PIXEL_FORMAT_YV12 || | 193 video_frame->format() == media::PIXEL_FORMAT_YV12 || |
| 194 video_frame->format() == media::PIXEL_FORMAT_ARGB || | 194 video_frame->format() == media::PIXEL_FORMAT_ARGB || |
| 195 video_frame->format() == media::PIXEL_FORMAT_YV12A)) { | 195 video_frame->format() == media::PIXEL_FORMAT_YV12A || |
| 196 video_frame->format() == media::PIXEL_FORMAT_NV12)) { |
| 196 NOTREACHED() << media::VideoPixelFormatToString(video_frame->format()); | 197 NOTREACHED() << media::VideoPixelFormatToString(video_frame->format()); |
| 197 return; | 198 return; |
| 198 } | 199 } |
| 199 | 200 |
| 200 if (video_frame->HasTextures()) { | 201 if (video_frame->HasTextures()) { |
| 201 main_task_runner_->PostTask( | 202 main_task_runner_->PostTask( |
| 202 FROM_HERE, base::Bind(&Encoder::RetrieveFrameOnMainThread, this, | 203 FROM_HERE, base::Bind(&Encoder::RetrieveFrameOnMainThread, this, |
| 203 video_frame, capture_timestamp)); | 204 video_frame, capture_timestamp)); |
| 204 return; | 205 return; |
| 205 } | 206 } |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 458 MediaStreamVideoSink::DisconnectFromTrack(); | 459 MediaStreamVideoSink::DisconnectFromTrack(); |
| 459 encoder_ = nullptr; | 460 encoder_ = nullptr; |
| 460 MediaStreamVideoSink::ConnectToTrack( | 461 MediaStreamVideoSink::ConnectToTrack( |
| 461 track_, | 462 track_, |
| 462 media::BindToCurrentLoop(base::Bind(initialize_encoder_callback_, | 463 media::BindToCurrentLoop(base::Bind(initialize_encoder_callback_, |
| 463 false /*allow_vea_encoder*/)), | 464 false /*allow_vea_encoder*/)), |
| 464 false); | 465 false); |
| 465 } | 466 } |
| 466 | 467 |
| 467 } // namespace content | 468 } // namespace content |
| OLD | NEW |