1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<html>
3<head>
4<META http-equiv="Content-Type" content="text/html; charset=windows-1252">
5<META name="GENERATOR" content="IBM WebSphere Studio Homepage Builder Version 6.5.0.0 for Windows">
6<META http-equiv="Content-Style-Type" content="text/css">
7<LINK rel="stylesheet" type="text/css" href="../CSS/revolution.css">
8<title>DVDReadPrio</title>
9</head>
10
11<body>
12
13<h1>DVDReadPrio<BR>DVDReadAsyncPrio</h1>
14<h2>C Specification</h2>
15
16<dl>
17  <dd><pre><code>#include &lt;revolution/dvd.h&gt;</code></pre>
18<dd><pre><CODE>typedef void (*DVDCallback)(s32 result, DVDFileInfo* fileInfo);</CODE></pre>
19<dd><pre><CODE>s32  DVDReadPrio         ( DVDFileInfo* fileInfo, void* addr, s32 length,
20s32 offset, s32 prio );
21
22BOOL DVDReadAsyncPrio    ( DVDFileInfo* fileInfo, void* addr, s32 length,
23s32 offset,
24DVDCallback callback, s32 prio );</CODE></pre>
25</dl>
26<h2>Arguments</h2>
27<TABLE border="1" cellpadding="3" cellspacing="0.1">
28  <tr>
29<TD width="120" bgcolor="#ffffe8"><em><strong><code>fileInfo</code></strong></em></TD>
30<TD width="520">File information retrieved by calling the <A href="DVDOpen.html"><CODE>DVDOpen</CODE></A> function.</TD>
31    </tr>
32  <tr>
33<TD width="120" bgcolor="#ffffe8"><em><strong><code>addr</code></strong></em></TD>
34<TD width="520">Buffer address. Should be 32-byte aligned.</TD>
35    </tr>
36  <tr>
37<TD width="120" bgcolor="#ffffe8"><em><strong><code><STRONG><EM><CODE>length</CODE></EM></STRONG></code></strong></em></TD>
38<TD width="520">Number of bytes to read. Must be a multiple of 32.</TD>
39    </tr>
40  <tr>
41<TD width="120" bgcolor="#ffffe8"><em><strong><code><STRONG><EM><CODE>offset</CODE></EM></STRONG></code></strong></em></TD>
42<TD width="520">File position to start read from. Must be a multiple of 4.</TD>
43    </tr>
44  <tr>
45<TD width="120" bgcolor="#ffffe8"><em><strong><code>callback</code></strong></em></TD>
46<TD width="520">Address of callback function to notify about the read result (only for the <code>DVDReadAsyncPrio</code> function).</TD>
47    </tr>
48  <tr>
49<TD width="120" bgcolor="#ffffe8"><em><strong><code>prio</code></strong></em></TD>
50<TD width="520">Queue priority for entering a read request.</TD>
51    </tr>
52</TABLE>
53<h2>Return Values</h2>
54
55<P>The <CODE>DVDReadPrio</CODE> function returns the number of bytes read if the command completes successfully. Otherwise, returns a negative value.</P>
56<P>The <code>DVDReadAsyncPrio</code> function returns <CODE>TRUE</CODE> if the command is issued successfully and <CODE>FALSE</CODE> otherwise.</P>
57
58<H2>Description</H2>
59
60<P>The <A href="DVDReadAsync.html"><CODE>DVDReadAsync</CODE></A> and <CODE>DVDReadAsyncPrio</CODE> functions are essentially the same, but the <CODE>DVDReadAsyncPrio</CODE> function can specify the queue to use for entering read requests.</P>
61<P>Internally the DVD device driver manages four queues, queue 0 - 3; queue 0 has the highest priority and queue 3 has the lowest priority. Each queue is FIFO (First In First Out). The lead command of the queue with the highest priority is processed first.</P>
62<P>Normal DVD commands use queue 2.</P>
63<P>The <code>DVDSeekAsyncPrio</code> function lets you change the priority for read commands. In other words, you can specify the queue to use for a read request. </P>
64<P>For details, see the <A href="DVDReadAsync.html"><CODE>DVDReadAsync</CODE></A> function in the Function Reference.</P>
65<P>The <CODE>DVDReadPrio</CODE> function is the synchronous version of the <CODE>DVDReadAsyncPrio</CODE> function. For details, see the <A href="DVDRead.html"><CODE>DVDRead</CODE></A> function in the Function Reference.</P>
66<P><strong>Note:</strong>
67 Take care if you plan to use a&nbsp;synchronous function in a real game. Synchronous functions&nbsp;can only be used in a multithreaded game. In single thread games, synchronous functions can't be used because there is no way to check errors.</P>
68<h2>See Also</h2>
69
70<p><code><a href="DVDRead.html">DVDRead</a><BR> <a href="DVDReadAsync.html">DVDReadAsync</a><BR> <a href="DVDOpen.html">DVDOpen</a></code></p>
71<H2>Revision History</H2>
72<P>03/01/2006 Initial version.</P>
73</body>
74</html>
75