Skip to content

Commit 488ccc2

Browse files
committed
args: force proprietary_codecs + ffmpeg_branding=Chrome via args/common.gn
The chromium_linux-x64x11 config ships proprietary_codecs=false / ffmpeg_branding="Chromium" (verified via 'gn args --list'), so YouTube's H.264/AAC fallback fails with DEMUXER_ERROR_NO_SUPPORTED_STREAMS. Add a shared args/common.gn (layered onto every preset by gen.sh, and by release.sh for the gold build) that forces the doc-mandated proprietary_codecs=true + ffmpeg_branding="Chrome". VA-API HW decode (use_vaapi=true) is already on in the stock config. Corrects the earlier finding/comment that claimed the platform config sets proprietary_codecs=true. Updates the CI gn-args guard to allow codec overrides (reject only true platform/build_type base args).
1 parent 347d497 commit 488ccc2

6 files changed

Lines changed: 35 additions & 18 deletions

File tree

.github/workflows/lint.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,12 @@ jobs:
4040
- uses: actions/checkout@v4
4141
- name: gn args sanity
4242
run: |
43-
# args/*.gn are EXTRAS layered on Cobalt's chromium_linux-x64x11 config (which already sets
44-
# proprietary_codecs=true; see cobalt/build/configs/common.gn), not standalone arg sets.
45-
# Guard against re-introducing conflicting full-config args here.
43+
# args/*.gn are EXTRAS layered on Cobalt's chromium_linux-x64x11 config (gen.sh), not
44+
# standalone arg sets. Codec overrides (proprietary_codecs/ffmpeg_branding) legitimately
45+
# live in args/common.gn. Guard only against re-introducing platform/build_type base args,
46+
# which come from gn.py -p/-c and must not be hand-set here.
4647
for f in args/*.gn; do
47-
if grep -qE '^\s*(target_os|target_cpu|is_debug|ffmpeg_branding)\b' "$f"; then
48-
echo "$f sets a base-config arg; args/*.gn must contain only overrides"; exit 1
48+
if grep -qE '^\s*(target_os|target_cpu|is_debug|is_official_build)\b' "$f"; then
49+
echo "$f sets a platform/build_type base arg; args/*.gn must contain only overrides"; exit 1
4950
fi
5051
done

.internal/findings/milestones/m114.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,13 @@ hermetic clang (llvmorg-17) + Debian bullseye sysroot + Rust. Full checkout ≈
4949
(unstripped, component build), ~43.9k ninja targets, cold build ~1 h on 32c/64G (no sccache yet).
5050
- **Blocker RESOLVED:** the in-tree depot_tools python3 bootstrap is now baked into the image
5151
(`bootstrap_python3` RUN in `docker/Dockerfile`) + an idempotent guard in `bootstrap.sh`.
52-
- Our `args/{dev,deck,asan}.gn` are now **extras-only** layers (the platform config already sets
53-
`proprietary_codecs=true`, target_os/cpu, is_debug); dev/deck are intentionally empty for CI parity.
52+
- Our `args/{common,dev,deck,asan}.gn` are **extras-only** layers (gen.sh appends common.gn then the
53+
preset). **Codec correction (verified via `gn args out/dev --list`):** the platform config ships
54+
`proprietary_codecs=false`, `ffmpeg_branding="Chromium"`, `media_use_ffmpeg=true`, `use_vaapi=true`,
55+
`use_vaapi_x11=true`, HEVC/Dolby/AC3 off. So YT's H.264/AAC fallback fails
56+
(`DEMUXER_ERROR_NO_SUPPORTED_STREAMS`) until we override — `args/common.gn` forces
57+
`proprietary_codecs=true` + `ffmpeg_branding="Chrome"` (doc hard constraint). VA-API HW decode is
58+
already on in the stock config (good for the Deck).
5459

5560
## Boot / headless smoke (S0.1) — verified 2026-07-08
5661
`just smoke dev` passes: `content_shell` boots under Xvfb and serves CDP on :9222. Requirements

args/common.gn

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# GN args layered ON TOP OF Cobalt's `chromium_linux-x64x11` config for EVERY preset (see gen.sh).
2+
# Only deckback-wide OVERRIDES belong here; per-preset extras live in args/{dev,deck,asan}.gn.
3+
#
4+
# Codec steering (doc hard constraint): the chromium_linux-x64x11 config ships proprietary_codecs=false
5+
# + ffmpeg_branding="Chromium", which makes YouTube's H.264/AAC fallback formats fail with
6+
# "DEMUXER_ERROR_NO_SUPPORTED_STREAMS". YT Leanback needs H.264/AAC (and we steer AV1 -> VP9/H.264 in a
7+
# MediaCapabilities patch, not here), so force the Chrome-branded ffmpeg + proprietary codecs on.
8+
proprietary_codecs = true
9+
ffmpeg_branding = "Chrome"

args/dev.gn

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
# Extra GN args layered ON TOP OF Cobalt's `chromium_linux-x64x11` + `devel` config (via
2-
# cobalt/build/gn.py). This is NOT a standalone arg set — the platform config already provides
3-
# target_os/cpu, is_debug, symbol_level, proprietary_codecs=true, media_use_ffmpeg=false, etc.
4-
# (see cobalt/build/configs/common.gn). Put only deckback-specific OVERRIDES here.
1+
# Extra GN args layered ON TOP OF Cobalt's `chromium_linux-x64x11` + `devel` config AND args/common.gn
2+
# (via gen.sh). NOT a standalone arg set — the platform config provides target_os/cpu, is_debug,
3+
# symbol_level, media_use_ffmpeg=true, use_vaapi=true, etc. (verified via `gn args --list`); note it
4+
# ships proprietary_codecs=FALSE / ffmpeg_branding="Chromium", which args/common.gn overrides.
5+
# Put only dev-preset-specific OVERRIDES here.
56
#
6-
# Kept empty for the first bring-up build so it matches Cobalt CI exactly. Candidates once the stock
7-
# build is green: cc_wrapper = "sccache" (faster incremental) and any remote-debugging / codec
8-
# steering flags we find we need in S0.1/S0.5.
7+
# Kept empty for now. Candidate: cc_wrapper = "sccache" (faster incremental) once proven.

scripts/gen.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@ bt="$(preset_buildtype "$preset")"
1111
info "gn.py -p ${COBALT_PLATFORM} -c ${bt} -> out/${preset} ..."
1212
in_container bash -c "cd ${CTR_TREE} && python3 cobalt/build/gn.py --no-rbe -p ${COBALT_PLATFORM} -c ${bt} out/${preset}"
1313

14-
extra="$(grep -vE '^\s*#|^\s*$' "args/${preset}.gn" || true)"
14+
# Layer deckback overrides: args/common.gn (all presets) first, then the preset's own args/<preset>.gn.
15+
# Both hold only OVERRIDES on top of Cobalt's platform+build_type config — not full standalone sets.
16+
extra="$( { cat args/common.gn args/"${preset}".gn 2>/dev/null; } | grep -vE '^\s*#|^\s*$' || true)"
1517
if [ -n "$extra" ]; then
16-
info "Layering extra args from args/${preset}.gn ..."
17-
printf '\n# --- extra args from deckback args/%s.gn ---\n%s\n' "$preset" "$extra" \
18+
info "Layering extra args from args/common.gn + args/${preset}.gn ..."
19+
printf '\n# --- deckback extra args (common + %s) ---\n%s\n' "$preset" "$extra" \
1820
>> "${COBALT_TREE}/out/${preset}/args.gn"
1921
in_container bash -c "cd ${CTR_TREE} && gn gen out/${preset}"
2022
fi

scripts/release.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ tag="${1:?usage: release.sh <tag>}"
44

55
info "Release build (gold + ThinLTO) ..."
66
in_container bash -c "cd $CTR_TREE && python3 cobalt/build/gn.py --no-rbe -p $COBALT_PLATFORM -c gold out/release"
7-
{ grep -vE '^\s*#|^\s*$' args/deck.gn 2>/dev/null || true; echo 'use_thin_lto = true'; } \
7+
# Same layering as gen.sh (common.gn + deck.gn) plus ThinLTO for the tagged build.
8+
{ cat args/common.gn args/deck.gn 2>/dev/null | grep -vE '^\s*#|^\s*$'; echo 'use_thin_lto = true'; } \
89
>> "$COBALT_TREE/out/release/args.gn"
910
in_container bash -c "cd $CTR_TREE && gn gen out/release && autoninja -C out/release $COBALT_TARGET"
1011

0 commit comments

Comments
 (0)