DVDCancelAll
DVDCancelAllAsync

C Specification

#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 and -1 if cancel fails.

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

Description

The DVDCancelAllAsync function cancels all DVD commands in the DVD queue and the executing command. When the command is completed, the callback function is called unless NULL is specified for callback. In the callback function, 0 is passed as result, and the command block of the command that executes when the DVDCancelAllAsync function is called is passed as block. (If no DVD command is 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 in which callback functions are called doesn’t match the order in which requests are processed. Because the executing request can take time, its callback could be called last.

If an issued cancel is successful, the DVDCancelAllAsync function 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 otherwise. The conditions for a cancel to fail are the same as the conditions for the DVDCancelAllAsync function.

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

The DVDCancelAll 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 explanation on thread behavior.
2006/03/01 Initial version.


CONFIDENTIAL