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>SynchronizeVsyncTiming</title> 8 </head> 9 <body> 10<h1><CODE>nn::camera::CTR::SynchronizeVsyncTiming</CODE> Function</h1> 11<h2>Syntax</h2> 12 <div class="section"> 13 <pre class="definition"> 14<a href="../../../nn/Result/Overview.html">nn::Result</a> SynchronizeVsyncTiming( 15<a href="../../../nn/camera/CTR/CameraSelect.html">CameraSelect</a> select1, 16<a href="../../../nn/camera/CTR/CameraSelect.html">CameraSelect</a> select2 17); 18</pre> 19 </div> 20<h2>Arguments</h2> 21 <div class="section"> 22 <table class="arguments"> 23 <thead> 24 <tr> 25 <td width="15" /> 26<th>Name</th> 27<td>Description</td> 28 </tr> 29 </thead> 30 <tr> 31<td>in</td> 32<th>select1</th> 33<td>Specifies the camera to synchronize.</td> 34 </tr> 35 <tr> 36<td>in</td> 37<th>select2</th> 38<td>Specifies the camera to synchronize.</td> 39 </tr> </table> 40 </div> 41<h2>Return Values</h2> 42<div class="section">Returns the function's execution result. Returns one of the <a href="../../../../nn/Result/Overview.html"><CODE>Result</CODE></a> values listed below. <br /> 43 <table class="arguments"> 44 <thead> 45 <tr> 46<th>Value</th> 47<td>Description</td> 48 </tr> 49 </thead> 50 <tr> 51<th><CODE>ResultSuccess</CODE></th> 52<td>Process was successful.</td> 53 </tr> 54 <tr> 55<th><CODE>ResultIsSleeping</CODE></th> 56<td>Unusable because the system is closed.</td> 57 </tr> 58 <tr> 59<th><CODE>ResultFatalError</CODE></th> 60<td>There may be something physically wrong with the camera.</td> 61 </tr> 62 </table> </div> 63<h2>Description</h2> 64 <div class="section"> 65<p>Synchronizes the camera V-Sync signal timing. However, this can never perfectly synchronize timing so that there is absolutely no discrepancy.</p><p><B>Note:</B> When the brightness of the two specified camera images differs, the first three frames of image data obtained after this function is called are sometimes extremely bright. In such cases, auto-exposure sometimes takes up to 12 frames to stabilize.</p><P> 66Even if the same framerate and image size are set for the CTR stereo cameras, the left and right cameras send images at slightly different times. This function attempts to synchronize the V-Sync timing between the left and right cameras. 67 </P><P> 68Although this function attempts to synchronize the camera V-Sync timing when it is called, the camera V-Sync timing does not continue to stay synchronized indefinitely. When the V-Sync timing diverges, you must call this function again to reduce the discrepancy. Even after this function is run, there still exists a discrepancy on the order of several hundred microseconds. 69 </P><P> 70The camera V-Sync timing diverges at the following times. 71 </P><P> 72·When the left and right cameras have different image sizes or framerates, their camera V-Sync periods differ and therefore the camera V-Sync timings always diverge even after this function is called. 73 </P><P> 74·When a variable framerate is set, the camera V-Sync period changes depending on the characteristics of the left and right images and therefore the camera V-Sync timings always diverge even after this function is called. 75 </P><P> 76·Even when both the left and right cameras have the same image size and the same fixed framerate, if you call any of the following functions it causes the camera V-Sync timings to diverge. You can call this function again to reduce these discrepancies. 77</P><ul><li><CODE>nn::camera::Activate</CODE></li><li><CODE>nn::camera::SwitchContext</CODE></li><li><CODE>nn::camera::SetExposure</CODE></li><li><CODE>nn::camera::SetSharpness</CODE></li><li><CODE>nn::camera::SetAutoExposure</CODE></li><li><CODE>nn::camera::SetAutoWhiteBalance</CODE></li><li><CODE>nn::camera::SetFrameRate</CODE></li><li><CODE>nn::camera::SetPhotoMode</CODE></li><li><CODE>nn::camera::FlipImage</CODE></li><li><CODE>nn::camera::SetDetailSize</CODE></li><li><CODE>nn::camera::SetSize</CODE></li><li><CODE>nn::camera::SetEffect</CODE></li><li><CODE>nn::camera::SetAutoExposureWindow</CODE></li><li><CODE>nn::camera::SetAutoWhiteBalanceWindow</CODE></li></ul><P> 78Specify one camera each for the <SPAN class="argument">select1</SPAN> and <SPAN class="argument">select2</SPAN> arguments. Specifically, specify <CODE>SELECT_OUT1</CODE>, <CODE>SELECT_OUT2</CODE>, or <CODE>SELECT_IN1</CODE>. You cannot specify the same camera for both <SPAN class="argument">select1</SPAN> and <SPAN class="argument">select2</SPAN>. This function only performs its intended processing if the cameras specified in <SPAN class="argument">select1</SPAN> and <SPAN class="argument">select2</SPAN> are both active. 79</P><p><B>Note:</B> This function may block for an extended period if a camera is restarting.</p><p> 80Even if you call this function, there will be rare cases where you cannot adjust the V-Sync discrepancy to anything better than several hundred microseconds. To mitigate this problem, you will need to implement a workaround such as comparing the timing of events to get V-Sync signals and the timing of the completion of image transmission, and executing retries if the difference in time is large. 81 </p></div> 82<h2>Revision History</h2> 83 <div class="section"> 84 <dl class="history"> 85 <dt>2010/12/30</dt> 86<dd>Added an explanation regarding the point that sometimes V-Sync timing cannot be properly adjusted.<br /> 87 </dd> 88 <dt>2010/09/24</dt> 89<dd>Updated list of functions that cause discrepancies. 90 </dd> 91 <dt>2010/08/06</dt> 92<dd>Revised argument names. 93 </dd> 94 <dt>2010/07/17</dt> 95<dd>Explained operation during restart. 96 </dd> 97 <dt>2010/07/11</dt> 98<dd>Added description that each argument can only specify one camera. Added explanation of behavior when specified cameras are not active. 99 </dd> 100 <dt>2010/06/15</dt> 101<dd>Explained the conditions under which camera V-Syncs deviate from each other.<br /> 102 </dd> 103 <dt>2010/04/13</dt> 104<dd>Initial version.<br /> 105 </dd> 106 </dl> 107 </div> 108 <hr><p>CONFIDENTIAL</p></body> 109</html>