1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2<html xml:lang="en-US" lang="en-US" xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 5 <meta http-equiv="Content-Style-Type" content="text/css" /> 6 <link rel="stylesheet" href="../../../../css/manpage.css" type="text/css" /> 7 <title>StopDecoder</title> 8 </head> 9 <body> 10 <h1><CODE>nn::jpeg::CTR::JpegMpDecoder::StopDecoder</CODE> Member Function</h1> 11 <h2>Syntax</h2> 12 <div class="section"> 13 <pre class="definition">#include <nn/jpeg.h> 14 15void StopDecoder(); 16</pre> 17 </div> 18 <h2>Arguments</h2> 19 <div class="section"> 20 <p>None.</p> 21 </div> 22 <h2>Return Values</h2> 23 <div class="section"> 24 None. 25 </div> 26 <h2>Description</h2> 27 <div class="section"> 28 <p>Makes a request from another thread to stop the decoding process. </p><p>This function sets a "stop request flag" inside the decoder object. The decoding functions (<CODE><a href="../../../../nn/jpeg/CTR/JpegMpDecoder/StartJpegDecoder.html">StartJpegDecoder</a></CODE>, <CODE><a href="../../../../nn/jpeg/CTR/JpegMpDecoder/StartJpegDecoderShrink.html">StartJpegDecoderShrink</a></CODE> and <CODE><a href="../../../../nn/jpeg/CTR/JpegMpDecoder/StartMpDecoderLR.html">StartMpDecoderLR</a></CODE>) monitor for this flag and stop decoding. </p><p>Since the decoder object is not thread-safe, multiple threads basically cannot access the same decoder object. </p><p>However, during the periods of time when the application can check whether the decoder object exists (i.e., has been initialized and has not been ended) , this function can be called for the same decoder object from other threads. </p><p>In general, it takes time to decode a JPEG image. There is a separate decode-use thread that the application uses in order to maintain the response speed of the main thread.</p><p>Consider the example of a screen that shows a compendium of images, and you want to stop the decoding that has already begun for a certain image. To do this, you can call this function from a different thread (the main thread or an alarm handler) that has a higher priority than the decode-use thread. </p><p>The decode function internally clears the stop request prior to the main process. There is no certainty that simply calling this function will lead to the stopping of the decoding process. The following restrictions apply:</p><p>1. The decode-use thread cannot stop before the call to the decode function, or before the arrival of the main internal decoding process.<br /> 2. Decoding cannot stop after the completion of the main internal decoding process. (If some other error has not occurred, the decoding will be successful)<br />3. <a href="../../../../nn/jpeg/CTR/JpegMpDecoder/StartMpDecoderLR.html">StartMpDecoderLR</a> clears the flags after the decoding of every other image. Decoding cannot be stopped during the period between the completion of decoding of the first image and the commencement of decoding of the second image. </p><p>To deal with situations 1. and 3. above, you should continue to call this function (for example, in every game frame) until you have verified that decoding has been stopped, or has ended, whether in success or failure. </p><p>When a decode function has received the request to stop it will return 0, which is the same value returned when decoding has failed. (If no other error has occurred, the error code returned by <CODE><a href="../../../../nn/jpeg/CTR/JpegMpDecoder/GetLastError.html">GetLastError</a></CODE>will be <CODE>JPEG_DECODER_ERROR_STOPPED</CODE>.) </p><p>The stop request cannot be canceled. Moreover, once decoding has stropped it cannot be restarted.</p></div> 29 <hr><p>CONFIDENTIAL</p></body> 30</html>