Commit de1720a7 authored by Nate Chapin's avatar Nate Chapin Committed by Commit Bot

Revert "media/gpu/BUILD.gn: restrict image_processor, video_frame_mapper to CrOs, Chromecast"

This reverts commit ad602416.

Reason for revert: Compile breaks: https://ci.chromium.org/p/chromium/builders/ci/ChromiumOS%20ASAN%20Release/104250

Original change's description:
> media/gpu/BUILD.gn: restrict image_processor, video_frame_mapper to CrOs, Chromecast
> 
> This CL restricts //media/gpu:image_processor and :video_frame_mapper
> to ChromeOS and ChromeCast, since they are only implemented for these
> platforms.  Same for image_processor_test.
> 
> video_frame_file_writer.cc sandwiched some uses of |video_frame_mapper_|
> in an OS_LINUX and left others unprotected, which confused OS_WIN
> builds. This CL changes those to if defined(OS_CHROMEOS), since I
> don't think this file is meant to be compiled nor run on OS_LINUX.
> 
> Change-Id: I8098d55859c50a752b40a63955684e558db3582a
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1787467
> Commit-Queue: Miguel Casas <mcasas@chromium.org>
> Reviewed-by: Hirokazu Honda <hiroh@chromium.org>
> Reviewed-by: Yuchen Liu <yucliu@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#698566}

TBR=deanliao@chromium.org,mcasas@chromium.org,akahuang@chromium.org,hiroh@chromium.org,acourbot@chromium.org,yucliu@chromium.org,dstaessens@chromium.org

Change-Id: I1f70a99e52b6ca640e4f8c9fcc79ba71dbb7f5f0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1816972Reviewed-by: default avatarNate Chapin <japhet@chromium.org>
Commit-Queue: Nate Chapin <japhet@chromium.org>
Cr-Commit-Position: refs/heads/master@{#698595}
parent 611c2959
...@@ -65,6 +65,8 @@ component("gpu") { ...@@ -65,6 +65,8 @@ component("gpu") {
":buildflags", ":buildflags",
":command_buffer_helper", ":command_buffer_helper",
":common", ":common",
":image_processor",
":video_frame_mapper",
"//base", "//base",
"//gpu", "//gpu",
"//media", "//media",
...@@ -81,14 +83,12 @@ component("gpu") { ...@@ -81,14 +83,12 @@ component("gpu") {
libs = [] libs = []
ldflags = [] ldflags = []
# TODO(crbug.com/1006266): consider using |use_chromeos_video_acceleration|.
if (use_v4l2_codec || use_vaapi) { if (use_v4l2_codec || use_vaapi) {
public_deps += [ public_deps += [ "//media/gpu/linux:common" ]
":image_processor", }
":video_frame_mapper",
"//media/gpu/chromeos", if (is_chromeos) {
"//media/gpu/linux:common", public_deps += [ "//media/gpu/chromeos" ]
]
} }
if (is_mac) { if (is_mac) {
...@@ -260,8 +260,6 @@ source_set("common") { ...@@ -260,8 +260,6 @@ source_set("common") {
"vp9_reference_frame_vector.cc", "vp9_reference_frame_vector.cc",
"vp9_reference_frame_vector.h", "vp9_reference_frame_vector.h",
] ]
# TODO(crbug.com/1006266): consider using |use_chromeos_video_acceleration|.
if (use_v4l2_codec || use_vaapi) { if (use_v4l2_codec || use_vaapi) {
sources += [ sources += [
"decode_surface_handler.h", "decode_surface_handler.h",
...@@ -305,82 +303,79 @@ source_set("command_buffer_helper") { ...@@ -305,82 +303,79 @@ source_set("command_buffer_helper") {
] ]
} }
# TODO(crbug.com/1006266): consider using |use_chromeos_video_acceleration|. source_set("image_processor") {
if (use_v4l2_codec || use_vaapi) { defines = [ "MEDIA_GPU_IMPLEMENTATION" ]
source_set("image_processor") { sources = [
defines = [ "MEDIA_GPU_IMPLEMENTATION" ] "image_processor_factory.cc",
sources = [ "libyuv_image_processor.cc",
"image_processor_factory.cc", "libyuv_image_processor.h",
"libyuv_image_processor.cc", ]
"libyuv_image_processor.h",
]
public_deps = [ public_deps = [
":image_processor_common", ":image_processor_common",
] ]
deps = [ deps = [
":video_frame_mapper", ":video_frame_mapper",
"//third_party/libyuv", "//third_party/libyuv",
"//ui/gl", "//ui/gl",
] ]
if (use_v4l2_codec) { if (use_v4l2_codec) {
deps += [ "//media/gpu/v4l2" ] deps += [ "//media/gpu/v4l2" ]
}
} }
}
source_set("image_processor_common") { source_set("image_processor_common") {
defines = [ "MEDIA_GPU_IMPLEMENTATION" ] defines = [ "MEDIA_GPU_IMPLEMENTATION" ]
sources = [ sources = [
"image_processor.cc", "image_processor.cc",
"image_processor.h", "image_processor.h",
"image_processor_factory.h", "image_processor_factory.h",
] ]
public_deps = [ public_deps = [
":buildflags", ":buildflags",
":common", ":common",
"//base", "//base",
"//media", "//media",
"//ui/gfx/geometry", "//ui/gfx/geometry",
] ]
} }
source_set("video_frame_mapper") { source_set("video_frame_mapper") {
defines = [ "MEDIA_GPU_IMPLEMENTATION" ] defines = [ "MEDIA_GPU_IMPLEMENTATION" ]
sources = [ sources = [
"video_frame_mapper_factory.cc", "video_frame_mapper_factory.cc",
] ]
public_deps = [ public_deps = [
":video_frame_mapper_common", ":video_frame_mapper_common",
] ]
deps = [] deps = []
# generic_dmabuf_video_frame_mapper # generic_dmabuf_video_frame_mapper
if (use_v4l2_codec || use_vaapi) { if (use_v4l2_codec || use_vaapi) {
deps += [ "//media/gpu/linux:video_frame_mapper" ] deps += [ "//media/gpu/linux:video_frame_mapper" ]
} }
# vaapi_dmabuf_video_frame_mapper # vaapi_dmabuf_video_frame_mapper
if (use_vaapi) { if (use_vaapi) {
deps += [ "//media/gpu/vaapi" ] deps += [ "//media/gpu/vaapi" ]
}
} }
}
source_set("video_frame_mapper_common") { source_set("video_frame_mapper_common") {
defines = [ "MEDIA_GPU_IMPLEMENTATION" ] defines = [ "MEDIA_GPU_IMPLEMENTATION" ]
sources = [ sources = [
"video_frame_mapper.h", "video_frame_mapper.h",
"video_frame_mapper_factory.h", "video_frame_mapper_factory.h",
] ]
public_deps = [ public_deps = [
":buildflags", ":buildflags",
"//base", "//base",
"//media", "//media",
] ]
}
} }
# TODO(watk): Run this on bots. http://crbug.com/461437 # TODO(watk): Run this on bots. http://crbug.com/461437
...@@ -572,8 +567,6 @@ source_set("unit_tests") { ...@@ -572,8 +567,6 @@ source_set("unit_tests") {
if (use_v4l2_codec) { if (use_v4l2_codec) {
deps += [ "//media/gpu/v4l2:unit_test" ] deps += [ "//media/gpu/v4l2:unit_test" ]
} }
# TODO(crbug.com/1006266): consider using |use_chromeos_video_acceleration|.
if (use_v4l2_codec || use_vaapi) { if (use_v4l2_codec || use_vaapi) {
sources += [ "vp8_decoder_unittest.cc" ] sources += [ "vp8_decoder_unittest.cc" ]
} }
...@@ -591,60 +584,57 @@ source_set("unit_tests") { ...@@ -591,60 +584,57 @@ source_set("unit_tests") {
} }
} }
# TODO(crbug.com/1006266): consider using |use_chromeos_video_acceleration|. test("video_decode_accelerator_tests") {
if (use_v4l2_codec || use_vaapi) { sources = [
test("video_decode_accelerator_tests") { "video_decode_accelerator_tests.cc",
sources = [ ]
"video_decode_accelerator_tests.cc", data = [
] "//media/test/data/",
data = [ ]
"//media/test/data/", deps = [
] ":buildflags",
deps = [ "test:frame_file_writer",
":buildflags", "test:frame_validator",
"test:frame_file_writer", "test:helpers",
"test:frame_validator", "test:video_player",
"test:helpers", "test:video_player_test_environment",
"test:video_player", "test:video_player_thumbnail_renderer",
"test:video_player_test_environment", "//media:test_support",
"test:video_player_thumbnail_renderer", "//testing/gtest",
"//media:test_support", ]
"//testing/gtest", }
]
}
test("video_decode_accelerator_perf_tests") { test("video_decode_accelerator_perf_tests") {
sources = [ sources = [
"video_decode_accelerator_perf_tests.cc", "video_decode_accelerator_perf_tests.cc",
] ]
data = [ data = [
"//media/test/data/", "//media/test/data/",
] ]
deps = [ deps = [
":buildflags", ":buildflags",
"test:video_player", "test:video_player",
"test:video_player_test_environment", "test:video_player_test_environment",
"//media:test_support", "//media:test_support",
"//testing/gtest", "//testing/gtest",
] ]
} }
test("image_processor_test") { test("image_processor_test") {
sources = [ sources = [
"image_processor_test.cc", "image_processor_test.cc",
] ]
deps = [ deps = [
":buildflags", ":buildflags",
":gpu", ":gpu",
"test:frame_file_writer", "test:frame_file_writer",
"test:frame_validator", "test:frame_validator",
"test:helpers", "test:helpers",
"test:image_processor", "test:image_processor",
"test:render_helpers", "test:render_helpers",
"//base/test:test_support", "//base/test:test_support",
"//media:test_support", "//media:test_support",
"//mojo/core/embedder", "//mojo/core/embedder",
"//testing/gtest", "//testing/gtest",
] ]
}
} }
...@@ -4,8 +4,7 @@ ...@@ -4,8 +4,7 @@
import("//media/gpu/args.gni") import("//media/gpu/args.gni")
# TODO(crbug.com/1006266): consider using |use_chromeos_video_acceleration|. assert(is_chromeos)
assert(use_v4l2_codec || use_vaapi)
source_set("chromeos") { source_set("chromeos") {
defines = [ "MEDIA_GPU_IMPLEMENTATION" ] defines = [ "MEDIA_GPU_IMPLEMENTATION" ]
......
...@@ -109,7 +109,6 @@ void VideoFrameFileWriter::ProcessVideoFrameTask( ...@@ -109,7 +109,6 @@ void VideoFrameFileWriter::ProcessVideoFrameTask(
base::SStringPrintf(&filename, FILE_PATH_LITERAL("frame_%04zu_%dx%d"), base::SStringPrintf(&filename, FILE_PATH_LITERAL("frame_%04zu_%dx%d"),
frame_index, visible_size.width(), visible_size.height()); frame_index, visible_size.width(), visible_size.height());
#if defined(OS_CHROMEOS)
// Create VideoFrameMapper if not yet created. The decoder's output pixel // Create VideoFrameMapper if not yet created. The decoder's output pixel
// format is not known yet when creating the VideoFrameWriter. We can only // format is not known yet when creating the VideoFrameWriter. We can only
// create the VideoFrameMapper upon receiving the first video frame. // create the VideoFrameMapper upon receiving the first video frame.
...@@ -118,7 +117,6 @@ void VideoFrameFileWriter::ProcessVideoFrameTask( ...@@ -118,7 +117,6 @@ void VideoFrameFileWriter::ProcessVideoFrameTask(
VideoFrameMapperFactory::CreateMapper(video_frame->format()); VideoFrameMapperFactory::CreateMapper(video_frame->format());
LOG_ASSERT(video_frame_mapper_) << "Failed to create VideoFrameMapper"; LOG_ASSERT(video_frame_mapper_) << "Failed to create VideoFrameMapper";
} }
#endif
switch (output_format_) { switch (output_format_) {
case OutputFormat::kPNG: case OutputFormat::kPNG:
...@@ -141,7 +139,7 @@ void VideoFrameFileWriter::WriteVideoFramePNG( ...@@ -141,7 +139,7 @@ void VideoFrameFileWriter::WriteVideoFramePNG(
DCHECK(video_frame_mapper_); DCHECK(video_frame_mapper_);
auto mapped_frame = video_frame; auto mapped_frame = video_frame;
#if defined(OS_CHROMEOS) #if defined(OS_LINUX)
if (video_frame->storage_type() == VideoFrame::STORAGE_DMABUFS) if (video_frame->storage_type() == VideoFrame::STORAGE_DMABUFS)
mapped_frame = video_frame_mapper_->Map(std::move(video_frame)); mapped_frame = video_frame_mapper_->Map(std::move(video_frame));
#endif #endif
...@@ -183,7 +181,7 @@ void VideoFrameFileWriter::WriteVideoFrameYUV( ...@@ -183,7 +181,7 @@ void VideoFrameFileWriter::WriteVideoFrameYUV(
DCHECK(video_frame_mapper_); DCHECK(video_frame_mapper_);
auto mapped_frame = video_frame; auto mapped_frame = video_frame;
#if defined(OS_CHROMEOS) #if defined(OS_LINUX)
if (video_frame->storage_type() == VideoFrame::STORAGE_DMABUFS) if (video_frame->storage_type() == VideoFrame::STORAGE_DMABUFS)
mapped_frame = video_frame_mapper_->Map(std::move(video_frame)); mapped_frame = video_frame_mapper_->Map(std::move(video_frame));
#endif #endif
......
...@@ -80,7 +80,6 @@ ...@@ -80,7 +80,6 @@
#include "base/win/windows_version.h" #include "base/win/windows_version.h"
#include "media/gpu/windows/dxva_video_decode_accelerator_win.h" #include "media/gpu/windows/dxva_video_decode_accelerator_win.h"
#endif // defined(OS_WIN) #endif // defined(OS_WIN)
#if BUILDFLAG(USE_VAAPI) #if BUILDFLAG(USE_VAAPI)
#include "media/gpu/vaapi/vaapi_wrapper.h" #include "media/gpu/vaapi/vaapi_wrapper.h"
#endif // BUILDFLAG(USE_VAAPI) #endif // BUILDFLAG(USE_VAAPI)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment