Introduction to the principle of Android JB2 continuous shooting spin
Source: Internet
Author: User
<span id="Label3"></p>1. HAL Layer<br>(1) Alps\mediatek\platform\mt6589\hardware\camera\core\camshot\multishot\multishot.cpp Sleep to achieve spin down.<br>Handle Ecamshot_cmd_set_cshot_speed in Sendcommand. Ecamshot_cmd_set_cshot_speed defined in ALPS\MEDIATEK\PLATFORM\MT6589\HARDWARE\CAMERA\INC\CAMSHOT\_PARAMS.H.<br>Mbool<br>multishot::<br>SendCommand (MINT32 cmd, MINT32 arg1, MINT32 arg2, MINT32 arg3)<br>{<br>function_log_start;<br><br>Mbool ret = mtrue;<br>//<br>Switch (cmd)<br>{<br>Case Ecamshot_cmd_set_cshot_speed:<br>If (arg1 > 0)<br>{<br>Mu4shotspeed = arg1;<br>RET = mtrue;<br>}<br>Else<br>{<br>MY_LOGD ("set Invalid shot speed:%d", arg1);<br>RET = mfalse;<br>}<br>Break<br>Default<br>Break<br>}<br>//<br><br>function_log_end;<br>//<br>Return ret;<br>}<br><br>(2) the function of sending ecamshot_cmd_set_cshot_speed, in alps\mediatek\platform\mt6589\hardware\camera\hal\adapter\scenario\shot\ continuousshot\continuousshot.cpp,<br>bool<br>continuousshot::<br>Oncmd_setcshotspeed (uint32_t U4cshotspeed)<br>{<br>BOOL ret = true;<br><br>Mutex::autolock Lock (mshotstopmtx);<br>If (!mbshotstoped && Mpmultishot!=null)<br>{<br>MY_LOGD ("set continuous shot speed:%d", u4cshotspeed);<br>ret = Mpmultishot->sendcommand (nscamshot::ecamshot_cmd_set_cshot_speed, u4cshotspeed, 0, 0);<br>}<br><br>Return ret;<br>}<br>At the same time, the SendCommand function in the file handles the ecmd_setcshotspeed passed Adapter. Ecmd_setcshotspeed defined in Alps\mediatek\platform\mt6589\hardware\camera\hal\adapter\inc\scenario\shot\ishot.h<br>Case Ecmd_setcshotspeed:<br>ret = Oncmd_setcshotspeed (arg1);<br>Break<br><br>(3) Adapter sends Ecmd_setcshotspeed in the following File's function Setcshotspeed.<br>MtkPhotoCamAdapter.Capture.cpp (alps\mediatek\platform\mt6589\hardware\camera\hal\adapter\mtkphoto):<br>MtkZsdNccCamAdapter.Capture.cpp (alps\mediatek\platform\mt6589\hardware\camera\hal\adapter\mtkzsd\mtkzsdncc):<br>status_t<br>camadapter::<br>Setcshotspeed (int32_t I4cshotspeeed)<br>{<br>If (i4cshotspeeed <= 0)<br>{<br>My_loge ("can not set continuous shot speed as%d fps)", i4cshotspeeed);<br>Return bad_value;<br>}<br><br>sp<ishot> Pshot = mpshot;<br>If (pshot! = 0)<br>{<br>Pshot->sendcommand (ecmd_setcshotspeed, i4cshotspeeed, 0);<br>}<br><br>Return OK;<br>}<br><br>The Sendcommad function in the following file handles the camera_cmd_set_cshot_speed sent down by Jni.<br>MtkCamera.h (alps\mediatek\frameworks-ext\av\include\camera):<br>camera_cmd_set_cshot_speed,<br><br>MtkPhotoCamAdapter.cpp (alps\mediatek\platform\mt6589\hardware\camera\hal\adapter\mtkphoto):<br>MtkZsdCcCamAdapter.cpp (alps\mediatek\platform\mt6589\hardware\camera\hal\adapter\mtkzsd\mtkzsdcc):<br>MtkZsdNccCamAdapter.cpp (alps\mediatek\platform\mt6589\hardware\camera\hal\adapter\mtkzsd\mtkzsdncc):<br>Case Camera_cmd_set_cshot_speed:<br>return Setcshotspeed (arg1);<br><br>2. JNI Layer<br>(1) Android_hardware_camera.cpp (alps\frameworks\base\core\jni):<br>static void Android_hardware_camera_setcontinuousshotspeed (jnienv *env, jobject thiz, jint Value)<br>(2)<br>Static Jninativemethod cammethods[] = {<br>...<br>{"setcontinuousshotspeed",<br>"(I) V",<br>(void *) android_hardware_camera_setcontinuousshotspeed},<br>(3) Camera.java (alps\frameworks\base\core\java\android\hardware):<br>Public native void Setcontinuousshotspeed (int. speed);<br><p><p>Introduction to the principle of Android JB2 continuous shooting spin</p></p></span>
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service