def main(): gobject.threads_init() gtk.gdk.threads_init() parser = argparse.ArgumentParser(description='Plays audio/video stream.', add_help=False) parser.add_argument('--player-help', action="help", help="show this help message and exit") parser.add_argument('-l', '--live', action="store_true", help='play in live mode') parser.add_argument('URI', help='URI of the video stream') cmd_args = parser.parse_args() # name = player.get_latest_version(cmd_args.URI) if name is None: print "No content found at %s" % cmd_args.URI return 1 name = name w = player_gui.PlayerWindow(GstPlayer, cmd_args) w.load_file(str(name)) w.show_all() gtk.main() return 0
def main(args): gobject.threads_init() gtk.gdk.threads_init() parser = argparse.ArgumentParser(description = 'Plays audio stream.', add_help = False) parser.add_argument('--player-help', action="help", help = "show this help message and exit") parser.add_argument('-l', '--live', action="store_true", help = 'play in live mode') parser.add_argument('URI', help = 'URI of the audio stream') cmd_args = parser.parse_args() w = player_gui.PlayerWindow(GstPlayer, cmd_args) w.load_file(cmd_args.URI) w.show_all() gtk.main()
def main(): gobject.threads_init() gtk.gdk.threads_init() parser = argparse.ArgumentParser(description='Plays audio/video stream.', add_help=False) parser.add_argument('--player-help', action="help", help="show this help message and exit") parser.add_argument('-l', '--live', action="store_true", help='play in live mode') parser.add_argument('-d', '--disable-buffering', action="store_false", help='disable buffering') parser.add_argument('-t', '--max-time', default=500, type=float, help='maximum buffer time for multiqueue (in ms)') parser.add_argument( '-p', '--publisher-id', help='fetch data only from specific publisher (in base64)') parser.add_argument( '-r', '--retry-count', type=int, help='how many times retransmit an interest before giving up') parser.add_argument( '-v', '--video-pipeline-size', type=int, help='Maximum number of pending interests for video stream') parser.add_argument( '-a', '--audio-pipeline-size', type=int, help='Maximum number of pending interests for audio stream') parser.add_argument('URI', help='URI of the video stream') cmd_args = parser.parse_args() publisher_id = base64.b64decode( cmd_args.publisher_id) if cmd_args.publisher_id else None name, publisher_id = player.get_latest_version(cmd_args.URI, publisher_id) if name is None: print "No content found at %s" % cmd_args.URI return 1 print("Fetching data from publisher: %s" % base64.b64encode(publisher_id)) w = player_gui.PlayerWindow(GstPlayer, cmd_args) w.load_file(str(name), publisher_id) w.show_all() gtk.main() return 0