Skip to content

Commit

Permalink
Add use_v4l2_codec use flag to include v4l2 codec on x86 CrOS.
Browse files Browse the repository at this point in the history
Because some trybots such as linux chromeos ozone use old linux
header files, use this flag to workaround chromium:446088 issue
to skip those trybots. So we can re-submit
https://codereview.chromium.org/826663002/. After 446088 is
fixed, this CL should be reverted.

BUG=445016
TEST=build squawks with this flag

Review URL: https://codereview.chromium.org/799543005

Cr-Commit-Position: refs/heads/master@{#310715}
  • Loading branch information
henryhsu authored and Commit bot committed Jan 9, 2015
1 parent d209afa commit 4c80f15
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 9 deletions.
14 changes: 9 additions & 5 deletions content/common/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -281,12 +281,10 @@ source_set("common") {
}

if (is_chromeos) {
if (cpu_arch == "arm" && use_x11) {
if ((cpu_arch == "arm" && use_x11) || use_v4l2_codec) {
sources += [
"gpu/media/exynos_v4l2_video_device.cc",
"gpu/media/exynos_v4l2_video_device.h",
"gpu/media/tegra_v4l2_video_device.cc",
"gpu/media/tegra_v4l2_video_device.h",
"gpu/media/generic_v4l2_video_device.cc",
"gpu/media/generic_v4l2_video_device.h",
"gpu/media/v4l2_image_processor.cc",
"gpu/media/v4l2_image_processor.h",
"gpu/media/v4l2_video_decode_accelerator.cc",
Expand All @@ -300,6 +298,12 @@ source_set("common") {
"EGL",
"GLESv2",
]
if (cpu_arch == "arm") {
sources += [
"gpu/media/tegra_v4l2_video_device.cc",
"gpu/media/tegra_v4l2_video_device.h",
]
}
}
if (cpu_arch != "arm") {
sources += [
Expand Down
8 changes: 8 additions & 0 deletions content/common/common.gni
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,11 @@ content_common_gypi_values =
[ rebase_path("../content_common.gypi") ],
"scope",
[ "../content_common.gypi" ])

declare_args() {
# TODO(henryhsu): This flag should be removed after the linux header of
# trybot is updated.
# Indicates if Video4Linux2 codec is used. This is used for x86 CrOS
# platform which has v4l2 hardware encoder / decoder.
use_v4l2_codec = false
}
2 changes: 1 addition & 1 deletion content/common/gpu/media/v4l2_video_decode_accelerator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ struct V4L2VideoDecodeAccelerator::BitstreamBufferRef {
const scoped_refptr<base::MessageLoopProxy> client_message_loop_proxy;
const scoped_ptr<base::SharedMemory> shm;
const size_t size;
off_t bytes_used;
size_t bytes_used;
const int32 input_id;
};

Expand Down
13 changes: 10 additions & 3 deletions content/content_common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
],
'variables': {
'use_v4lplugin%': 0,
'use_v4l2_codec%': 0,
'public_common_sources': [
'public/common/appcache_info.h',
'public/common/bindings_policy.h',
Expand Down Expand Up @@ -804,15 +805,13 @@
},
],
}],
['target_arch=="arm" and chromeos == 1 and use_x11 == 1', {
['chromeos==1 and ((target_arch=="arm" and use_x11==1) or use_v4l2_codec==1)', {
'dependencies': [
'../media/media.gyp:media',
],
'sources': [
'common/gpu/media/generic_v4l2_video_device.cc',
'common/gpu/media/generic_v4l2_video_device.h',
'common/gpu/media/tegra_v4l2_video_device.cc',
'common/gpu/media/tegra_v4l2_video_device.h',
'common/gpu/media/v4l2_image_processor.cc',
'common/gpu/media/v4l2_image_processor.h',
'common/gpu/media/v4l2_video_decode_accelerator.cc',
Expand All @@ -825,6 +824,14 @@
'include_dirs': [
'<(DEPTH)/third_party/khronos',
],
'conditions': [
['target_arch == "arm"', {
'sources': [
'common/gpu/media/tegra_v4l2_video_device.cc',
'common/gpu/media/tegra_v4l2_video_device.h',
],
}],
],
}],
['target_arch != "arm" and chromeos == 1', {
'dependencies': [
Expand Down

0 comments on commit 4c80f15

Please sign in to comment.