Custom a Capturerequest option

122 views
Skip to first unread message

yang tian

unread,
Jan 14, 2021, 3:35:12 AM1/14/21
to Android CameraX Discussion Group
Hi   CameraX Development Team!

Now I'm trying to create a cameraX based app.

// CameraX core library
def camerax_version = '1.0.0-rc01'
implementation "androidx.camera:camera-core:$camerax_version"

// CameraX Camera2 extensions
implementation "androidx.camera:camera-camera2:$camerax_version"

// CameraX Lifecycle library
implementation "androidx.camera:camera-lifecycle:$camerax_version"

// CameraX View class
implementation 'androidx.camera:camera-view:1.0.0-alpha20'


I know now we can setCaptureRequestOption to custom some options for capture request, such as CONTROL_AWB_MODE and  CONTROL_AE_EXPOSURE_COMPENSATION

So if we also can create a custom CaptureRequest to set an un-default CaptureRequest ?

 

Thanks!

tonyt...@google.com

unread,
Jan 14, 2021, 4:48:07 AM1/14/21
to Android CameraX Discussion Group, yang...@nxp.com
Hi,
Thanks for the question. By un-default CaptureRequest, do you mean submit a whole customized CaptureRequest or add OEM customized capture request options? I suppose it's the former and unfortunately it's not supported. May we know what do you want to control with the CaptureRequest (other than capture request options)?

yang tian

unread,
Jan 14, 2021, 6:14:25 AM1/14/21
to Android CameraX Discussion Group, tonyt...@google.com, yang tian
Thanks for quick response!

Here I'm dev on some FLIP output features, which we added several VendorTagSection for Camera HAL, so we also need to add our own custom CaptureRequest

val VFLIP_ENABLE = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
CaptureRequest.Key("vsi.vflip.enable", Int::class.java)
} else {
TODO("VERSION.SDK_INT < Q")
}


And then I  added a  mCapReqOptions
val mCapReqOptions = CaptureRequestOptions.Builder()
  .setCaptureRequestOption(VFLIP_ENABLE, enable)

after bindToLifecycle I try to setCaptureRequestOptions with mCapReqOptions.
Camera2CameraControl.from(camera!!.cameraControl).setCaptureRequestOptions(mCapReqOptions)

But it did not work. While I also try to override  CaptureRequest.CONTROL_AWB_MODE with below for  mCapReqOptions, and it worked.
  .setCaptureRequestOption(CaptureRequest.CONTROL_AWB_MODE, awbState)

Seems the customed  CaptureRequest  is not working as I wanted. 
That's why I posted here for help.

yang tian

unread,
Jan 14, 2021, 6:22:52 AM1/14/21
to Android CameraX Discussion Group, tonyt...@google.com, yang tian
Sorry, Please ignore this Q,  I made a  silly mistake...

It worked as wanted after correcting my code.

Thanks anyway.
在2021年1月14日星期四 UTC+8 下午5:48:07<tonyt...@google.com> 写道:
Reply all
Reply to author
Forward
0 new messages