/** * Parse the media asynchronously with a flag. This Media should be alive (not released). * * To track when this is over you can listen to {@link Event#ParsedChanged} * event (only if this methods returned true). * * @param flags see {@link Parse} * @param timeout maximum time allowed to preparse the media. If -1, the * default "preparse-timeout" option will be used as a timeout. If 0, it will * wait indefinitely.如果小于0, the timeout will be used (in milliseconds). * @return true in case of success, false otherwise. */ public boolean parseAsync(int flags, int timeout) { boolean parse = false; synchronized (this) { if ((mParseStatus & (PARSE_STATUS_PARSED | PARSE_STATUS_PARSING)) == 0) { mParseStatus |= PARSE_STATUS_PARSING; parse = true; } } return parse && nativeParseAsync(flags, timeout); }
/** * Parse the media asynchronously with a flag. This Media should be alive (not released). * * To track when this is over you can listen to {@link Event#ParsedChanged} * event (only if this methods returned true). * * @param flags see {@link Parse} * @param timeout maximum time allowed to preparse the media. If -1, the * default "preparse-timeout" option will be used as a timeout. If 0, it will * wait indefinitely. If > 0, the timeout will be used (in milliseconds). * @return true in case of success, false otherwise. */ public boolean parseAsync(int flags, int timeout) { boolean parse = false; synchronized (this) { if ((mParseStatus & (PARSE_STATUS_PARSED | PARSE_STATUS_PARSING)) == 0) { mParseStatus |= PARSE_STATUS_PARSING; parse = true; } } return parse && nativeParseAsync(flags, timeout); }
/** * Parse the media asynchronously with a flag. This Media should be alive (not released). * * To track when this is over you can listen to {@link Event#ParsedChanged} * event (only if this methods returned true). * * @param flags see {@link Parse} * @param timeout maximum time allowed to preparse the media. If -1, the * default "preparse-timeout" option will be used as a timeout. If 0, it will * wait indefinitely. If > 0, the timeout will be used (in milliseconds). * @return true in case of success, false otherwise. */ public boolean parseAsync(int flags, int timeout) { boolean parse = false; synchronized (this) { if ((mParseStatus & (PARSE_STATUS_PARSED | PARSE_STATUS_PARSING)) == 0) { mParseStatus |= PARSE_STATUS_PARSING; parse = true; } } return parse && nativeParseAsync(flags, timeout); }
/** * Parse the media asynchronously with a flag. This Media should be alive (not released). * * To track when this is over you can listen to {@link Event#ParsedChanged} * event (only if this methods returned true). * * @param flags see {@link Parse} * @param timeout maximum time allowed to preparse the media. If -1, the * default "preparse-timeout" option will be used as a timeout. If 0, it will * wait indefinitely. If > 0, the timeout will be used (in milliseconds). * @return true in case of success, false otherwise. */ public boolean parseAsync(int flags, int timeout) { boolean parse = false; synchronized (this) { if ((mParseStatus & (PARSE_STATUS_PARSED | PARSE_STATUS_PARSING)) == 0) { mParseStatus |= PARSE_STATUS_PARSING; parse = true; } } return parse && nativeParseAsync(flags, timeout); }
/** * Parse the media asynchronously with a flag. This Media should be alive (not released). * * To track when this is over you can listen to {@link Event#ParsedChanged} * event (only if this methods returned true). * * @param flags see {@link Parse} * @param imeout maximum time allowed to preparse the media. If -1, the * default "preparse-timeout" option will be used as a timeout. If 0, it will * wait indefinitely. If > 0, the timeout will be used (in milliseconds). * @return true in case of success, false otherwise. */ public boolean parseAsync(int flags, int timeout) { boolean parse = false; synchronized (this) { if ((mParseStatus & (PARSE_STATUS_PARSED | PARSE_STATUS_PARSING)) == 0) { mParseStatus |= PARSE_STATUS_PARSING; parse = true; } } return parse && nativeParseAsync(flags, timeout); }