| 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 12 matching lines...) Expand all Loading... |
| 23 #include "media/base/bind_to_current_loop.h" | 23 #include "media/base/bind_to_current_loop.h" |
| 24 #include "media/base/video_frame.h" | 24 #include "media/base/video_frame.h" |
| 25 #include "media/base/video_util.h" | 25 #include "media/base/video_util.h" |
| 26 #include "media/filters/context_3d.h" | 26 #include "media/filters/context_3d.h" |
| 27 #include "media/renderers/skcanvas_video_renderer.h" | 27 #include "media/renderers/skcanvas_video_renderer.h" |
| 28 #include "services/ui/public/cpp/gpu/context_provider_command_buffer.h" | 28 #include "services/ui/public/cpp/gpu/context_provider_command_buffer.h" |
| 29 #include "skia/ext/platform_canvas.h" | 29 #include "skia/ext/platform_canvas.h" |
| 30 #include "third_party/libyuv/include/libyuv.h" | 30 #include "third_party/libyuv/include/libyuv.h" |
| 31 #include "ui/gfx/geometry/size.h" | 31 #include "ui/gfx/geometry/size.h" |
| 32 | 32 |
| 33 #if defined(OS_WIN) | |
| 34 #include "base/win/windows_version.h" | |
| 35 #endif | |
| 36 | |
| 37 #if BUILDFLAG(RTC_USE_H264) | 33 #if BUILDFLAG(RTC_USE_H264) |
| 38 #include "third_party/openh264/src/codec/api/svc/codec_api.h" | 34 #include "third_party/openh264/src/codec/api/svc/codec_api.h" |
| 39 #include "third_party/openh264/src/codec/api/svc/codec_app_def.h" | 35 #include "third_party/openh264/src/codec/api/svc/codec_app_def.h" |
| 40 #include "third_party/openh264/src/codec/api/svc/codec_def.h" | 36 #include "third_party/openh264/src/codec/api/svc/codec_def.h" |
| 41 #endif // #if BUILDFLAG(RTC_USE_H264) | 37 #endif // #if BUILDFLAG(RTC_USE_H264) |
| 42 | 38 |
| 43 extern "C" { | 39 extern "C" { |
| 44 // VPX_CODEC_DISABLE_COMPAT excludes parts of the libvpx API that provide | 40 // VPX_CODEC_DISABLE_COMPAT excludes parts of the libvpx API that provide |
| 45 // backwards compatibility for legacy applications using the library. | 41 // backwards compatibility for legacy applications using the library. |
| 46 #define VPX_CODEC_DISABLE_COMPAT 1 | 42 #define VPX_CODEC_DISABLE_COMPAT 1 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 #if defined(OS_CHROMEOS) | 110 #if defined(OS_CHROMEOS) |
| 115 // See https://crbug.com/616659. | 111 // See https://crbug.com/616659. |
| 116 return; | 112 return; |
| 117 #endif | 113 #endif |
| 118 | 114 |
| 119 #if defined(OS_ANDROID) | 115 #if defined(OS_ANDROID) |
| 120 // See https://crbug.com/653864. | 116 // See https://crbug.com/653864. |
| 121 return; | 117 return; |
| 122 #endif | 118 #endif |
| 123 | 119 |
| 124 #if defined(OS_WIN) | |
| 125 // See https://crbug.com/698441. | |
| 126 if (base::win::GetVersion() < base::win::VERSION_WIN10) | |
| 127 return; | |
| 128 #endif | |
| 129 | |
| 130 content::RenderThreadImpl* const render_thread_impl = | 120 content::RenderThreadImpl* const render_thread_impl = |
| 131 content::RenderThreadImpl::current(); | 121 content::RenderThreadImpl::current(); |
| 132 if (!render_thread_impl) { | 122 if (!render_thread_impl) { |
| 133 DVLOG(2) << "Couldn't access the render thread"; | 123 DVLOG(2) << "Couldn't access the render thread"; |
| 134 return; | 124 return; |
| 135 } | 125 } |
| 136 | 126 |
| 137 media::GpuVideoAcceleratorFactories* const gpu_factories = | 127 media::GpuVideoAcceleratorFactories* const gpu_factories = |
| 138 render_thread_impl->GetGpuFactories(); | 128 render_thread_impl->GetGpuFactories(); |
| 139 if (!gpu_factories || !gpu_factories->IsGpuVideoAcceleratorEnabled()) { | 129 if (!gpu_factories || !gpu_factories->IsGpuVideoAcceleratorEnabled()) { |
| (...skipping 1090 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1230 encoder_->SetPaused(paused_before_init_); | 1220 encoder_->SetPaused(paused_before_init_); |
| 1231 | 1221 |
| 1232 // StartFrameEncode() will be called on Render IO thread. | 1222 // StartFrameEncode() will be called on Render IO thread. |
| 1233 MediaStreamVideoSink::ConnectToTrack( | 1223 MediaStreamVideoSink::ConnectToTrack( |
| 1234 track_, | 1224 track_, |
| 1235 base::Bind(&VideoTrackRecorder::Encoder::StartFrameEncode, encoder_), | 1225 base::Bind(&VideoTrackRecorder::Encoder::StartFrameEncode, encoder_), |
| 1236 false); | 1226 false); |
| 1237 } | 1227 } |
| 1238 | 1228 |
| 1239 } // namespace content | 1229 } // namespace content |
| OLD | NEW |