Chromium Code Reviews| Index: media/mojo/scripts/run_mojo_media_renderer.py |
| diff --git a/mojo/services/html_viewer/view_url.py b/media/mojo/scripts/run_mojo_media_renderer.py |
| similarity index 55% |
| copy from mojo/services/html_viewer/view_url.py |
| copy to media/mojo/scripts/run_mojo_media_renderer.py |
| index a543385e5aea4c59531f350d30699165e9de9f68..738fa9dcb94d71bbc45803ce2b88bce26a318131 100755 |
| --- a/mojo/services/html_viewer/view_url.py |
| +++ b/media/mojo/scripts/run_mojo_media_renderer.py |
| @@ -2,6 +2,12 @@ |
| # Copyright 2015 The Chromium Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| +# |
| +# The script follows mojo/services/html_viewer/view_url.py and modified it for |
| +# test the mojo media renderer. The page will be rendered in a windowless mode. |
| +# |
| +# TODO(xhwang): Explore the possibility of running this with the Kiosk window |
| +# manager. |
| import argparse |
| import os |
| @@ -27,26 +33,35 @@ def _BuildShellCommand(args): |
| options.append( |
| "--origin=https://storage.googleapis.com/mojo/services/linux-x64/%s" % |
| sdk_version) |
| - options.append("--url-mappings=mojo:html_viewer=file://%s/html_viewer.mojo" % |
| - build_dir) |
| - options.append('--args-for=mojo:kiosk_wm %s' % args.url) |
| + options.append("--url-mappings=mojo:html_viewer=file://%s/html_viewer.mojo," |
| + "mojo:media=file://%s/media.mojo" % (build_dir, build_dir)) |
| + args_for_html_viewer = "--enable-mojo-media-renderer " |
| + if args.verbose: |
| + args_for_html_viewer += \ |
| + "--vmodule=pipeline*=3,*renderer_impl*=3,*mojo_demuxer*=3" |
| + options.append("--args-for=mojo:html_viewer %s" % args_for_html_viewer) |
| - app_to_run = "mojo:kiosk_wm" |
| + full_command = shell_command + options + [args.url] |
| - return shell_command + options + [app_to_run] |
| + if args.verbose: |
| + print full_command |
| + |
| + return full_command |
| def main(): |
| parser = argparse.ArgumentParser( |
| - description="View a URL with HTMLViewer in the Kiosk window manager. " |
| - "You must have built //mojo/services/html_viewer and " |
| - "//mojo/services/network first. Note that this will " |
| - "currently often fail spectacularly due to lack of binary " |
| - "stability in Mojo.") |
| + description="View a URL with HTMLViewer with mojo media renderer. " |
| + "You must have built //mojo/services/html_viewer, " |
| + "//mojo/services/network and //media/mojo/services first. " |
| + " Note that this will currently often fail spectacularly due " |
| + " to lack of binary stability in Mojo.") |
| parser.add_argument( |
| "--build-dir", |
| help="Path to the dir containing the linux-x64 binaries relative to the " |
| "repo root (default: %(default)s)", |
| default="out/Release") |
| + parser.add_argument("--verbose", help="Increase output verbosity.", |
| + action="store_true") |
|
DaleCurtis
2015/03/09 20:09:44
default=False? I forget if you need that.
xhwang
2015/03/09 20:18:40
I am still learning argparse so I am not sure eith
|
| parser.add_argument("url", |
| help="The URL to be viewed") |