DVDCancelAll
DVDCancelAllAsync

Syntax

#include <revolution/dvd.h>

typedef void (*DVDCBCallback)(s32 result, DVDCommandBlock* block);

s32 DVDCancelAll(void);

BOOL DVDCancelAllAsync(DVDCBCallback callback);

Arguments

callback Callback function that indicates completion. If a callback is unnecessary, specify NULL.

Return Values

DVDCancelAll: 0 if cancel succeeds; -1 if cancel fails.

DVDCancelAllAsync: TRUE if cancel succeeds; FALSE if cancel fails.

Description

The DVDCancelAllAsync function cancels all DVD commands in the DVD queue and executing command. When the command has completed, the callback function is called unless callback is specified as NULL. In the callback function, 0 is passed as result and the command block of the command that executes when DVDCancelAllAsync is called is passed as block. (If no DVD command is being processed when the function is called, NULL is passed as block.))

DVD_RESULT_CANCELED will be passed to all canceled functions. In other words, canceled synchronous functions return DVD_RESULT_CANCELED. If a callback is specified for canceled asynchronous functions, DVD_RESULT_CANCELED will be passed as result to the callback function. The order callback functions are called in doesn’t match the order that requests are processed in. Because the executing request can take time, its callback could be called last.

If the issued cancel succeeds, DVDCancelAllAsync returns TRUE. Otherwise, FALSE is returned. FALSE can be returned if the DVD library is currently processing a cancel. In this case, a cancel is not performed.

The DVDCancelAll function is the synchronous version of the DVDCancelAllAsync function. This function doesn't return until cancel completes. This function returns 0 if cancel succeeds and -1 if cancel fails. The conditions for a cancel to fail are the same as for the DVDCancelAllAsync function.

You can issue the DVDCancelAll(Async) function if no DVD commands are processing.

This function may put the current thread to sleep. Refer to Interrupts and Callback Functions.

See Also

DVDCancel(Async)
Interrupts and Callback Functions

Revision History

2007/09/25 Added an explanation of thread behavior.
2006/03/01 Initial version.


CONFIDENTIAL