I am working on Custom Camera using Surface view in my application, also recording Video with screen Capture.
I am looking to implement Zoom Control in my Camera Code but not getting success.
Getting this log while Zooming:
E/Adreno200-ES20(12756): <qgl2DrvAPI_glBufferSubData:709>: GL_INVALID_OPERATION
I am using below code:
/** * setZoomControl * @param params */
public void setZoomControl(Camera.Parameters params) {
paramtrs = params;
ZoomControls zoomControls = (ZoomControls) findViewById(R.id.zoomcontrols);
if (params.isZoomSupported()) {
final int maxZoomLevel = paramtrs.getMaxZoom();
Log.i("max ZOOM ", "is " + maxZoomLevel);
zoomControls.setIsZoomInEnabled(true);
zoomControls.setIsZoomOutEnabled(true);
zoomControls.setOnZoomInClickListener(new OnClickListener() {
public void onClick(View v) {
int currentZoomLevel = 0;
if (currentZoomLevel < maxZoomLevel) {
currentZoomLevel++;
camera.startSmoothZoom(currentZoomLevel);
}
}
});
zoomControls.setOnZoomOutClickListener(new OnClickListener() {
public void onClick(View v) {
int currentZoomLevel = 0;
if (currentZoomLevel > 0) {
currentZoomLevel--;
camera.startSmoothZoom(currentZoomLevel);
}
}
});
} else
zoomControls.setVisibility(View.GONE);
}
Please suggest me whats happening in my code.