| OLD | NEW |
| (Empty) |
| 1 #!/usr/bin/env python | |
| 2 # Copyright 2015 The Chromium Authors. All rights reserved. | |
| 3 # Use of this source code is governed by a BSD-style license that can be | |
| 4 # found in the LICENSE file. | |
| 5 # | |
| 6 # The script launches mandoline to test the mojo media renderer. | |
| 7 | |
| 8 import argparse | |
| 9 import os | |
| 10 import subprocess | |
| 11 import sys | |
| 12 | |
| 13 | |
| 14 root_path = os.path.realpath( | |
| 15 os.path.join( | |
| 16 os.path.dirname( | |
| 17 os.path.realpath(__file__)), | |
| 18 os.pardir, | |
| 19 os.pardir, | |
| 20 os.pardir)) | |
| 21 | |
| 22 | |
| 23 def _BuildCommand(args): | |
| 24 build_dir = os.path.join(root_path, args.build_dir) | |
| 25 | |
| 26 runner = [os.path.join(build_dir, "mandoline")] | |
| 27 | |
| 28 options = ["--enable-mojo-media-renderer"] | |
| 29 if args.verbose: | |
| 30 options.append("--vmodule=pipeline*=3,*renderer_impl*=3," | |
| 31 "*mojo_demuxer*=3,mojo*service=3") | |
| 32 | |
| 33 full_command = runner + options + [args.url] | |
| 34 | |
| 35 if args.verbose: | |
| 36 print full_command | |
| 37 | |
| 38 return full_command | |
| 39 | |
| 40 | |
| 41 def main(): | |
| 42 parser = argparse.ArgumentParser( | |
| 43 description="View a URL with Mandoline with mojo media renderer. " | |
| 44 "You must have built //mandoline, //components/html_viewer, " | |
| 45 "//mojo, //mojo/services/network and //media/mojo/services " | |
| 46 "first.") | |
| 47 parser.add_argument( | |
| 48 "--build-dir", | |
| 49 help="Path to the dir containing the linux-x64 binaries relative to the " | |
| 50 "repo root (default: %(default)s)", | |
| 51 default="out/Release") | |
| 52 parser.add_argument("--verbose", help="Increase output verbosity.", | |
| 53 action="store_true") | |
| 54 parser.add_argument("url", help="The URL to be viewed") | |
| 55 | |
| 56 args = parser.parse_args() | |
| 57 return subprocess.call(_BuildCommand(args)) | |
| 58 | |
| 59 if __name__ == '__main__': | |
| 60 sys.exit(main()) | |
| OLD | NEW |