修改名字

serial
Matthew 1 year ago
parent f70d1f90ea
commit e5443c6040

@ -931,19 +931,19 @@ bool CPhoneDevice::TakePhoto(const IDevice::PHOTO_INFO& photoInfo, const vector<
params.autoExposure = mPhotoInfo.autoExposure; params.autoExposure = mPhotoInfo.autoExposure;
params.focusTimeout = mPhotoInfo.focusTimeout * 1000; params.focusTimeout = mPhotoInfo.focusTimeout * 1000;
params.exposureTime = mPhotoInfo.exposureTime; params.exposureTime = mPhotoInfo.exposureTime;
params.sensibility = mPhotoInfo.sensibility; params.sensitivity = mPhotoInfo.sensitivity;
params.compensation = mPhotoInfo.compensation; params.compensation = mPhotoInfo.compensation;
params.orientation = mPhotoInfo.orientation; params.orientation = mPhotoInfo.orientation;
params.zoom = mPhotoInfo.zoom; params.zoom = mPhotoInfo.zoom;
params.zoomRatio = mPhotoInfo.zoomRatio; params.zoomRatio = mPhotoInfo.zoomRatio;
if (photoInfo.channel == 2 || photoInfo.channel == 3) if (photoInfo.ldrEnabled)
{ {
if (GpioControl::getLightAdc() > 1400) if (GpioControl::getLightAdc() > 1400)
{ {
params.autoExposure = 0; params.autoExposure = 0;
params.exposureTime = 1200; params.exposureTime = 1200;
params.sensibility = 1200; params.sensitivity = 1200;
} }
} }

@ -534,9 +534,9 @@ int NdkCamera::open(const std::string& cameraId) {
uint8_t aeMode = ACAMERA_CONTROL_AE_MODE_OFF; uint8_t aeMode = ACAMERA_CONTROL_AE_MODE_OFF;
status = ACaptureRequest_setEntry_u8(capture_request, ACAMERA_CONTROL_AE_MODE, 1, &aeMode); status = ACaptureRequest_setEntry_u8(capture_request, ACAMERA_CONTROL_AE_MODE, 1, &aeMode);
if (m_params.sensibility > 0) if (m_params.sensitivity > 0)
{ {
int32_t sensitivity = m_params.sensibility; int32_t sensitivity = m_params.sensitivity;
status = ACaptureRequest_setEntry_i32(capture_request, ACAMERA_SENSOR_SENSITIVITY, 1, &sensitivity); status = ACaptureRequest_setEntry_i32(capture_request, ACAMERA_SENSOR_SENSITIVITY, 1, &sensitivity);
} }
if (m_params.exposureTime > 0) if (m_params.exposureTime > 0)

@ -77,7 +77,7 @@ public:
unsigned int zoom; unsigned int zoom;
unsigned int reserved : 7; unsigned int reserved : 7;
unsigned int exposureTime; // ms unsigned int exposureTime; // ms
unsigned int sensibility; unsigned int sensitivity;
int compensation; int compensation;
float zoomRatio; float zoomRatio;
}; };

@ -150,6 +150,7 @@ public class ChannelActivity extends AppCompatActivity {
binding.btnUsbCamera.setChecked(jsonObject.optInt("usbCamera", 0) == 1); binding.btnUsbCamera.setChecked(jsonObject.optInt("usbCamera", 0) == 1);
binding.btnAutoExplosure.setChecked(jsonObject.optInt("autoExposure", 1) == 1); binding.btnAutoExplosure.setChecked(jsonObject.optInt("autoExposure", 1) == 1);
binding.btnAutoFocus.setChecked(jsonObject.optInt("autoFocus", 1) == 1); binding.btnAutoFocus.setChecked(jsonObject.optInt("autoFocus", 1) == 1);
binding.ldrEnabled.setChecked(jsonObject.optInt("ldrEnabled", 0) == 1);
// binding.btnHdrMode.setChecked(jsonObject.optInt("hdrMode", 0) == 1); // binding.btnHdrMode.setChecked(jsonObject.optInt("hdrMode", 0) == 1);
// binding.btnNightMode.setChecked(jsonObject.optInt("nightMode", 0) == 1); // binding.btnNightMode.setChecked(jsonObject.optInt("nightMode", 0) == 1);
int sceneMode = jsonObject.optInt("sceneMode", 0); int sceneMode = jsonObject.optInt("sceneMode", 0);
@ -162,7 +163,7 @@ public class ChannelActivity extends AppCompatActivity {
} }
} }
binding.exposuretime.setText(Integer.toString(jsonObject.optInt("exposureTime", 0))); binding.exposuretime.setText(Integer.toString(jsonObject.optInt("exposureTime", 0)));
binding.sensitivity.setText(Integer.toString(jsonObject.optInt("sensibility", 0))); binding.sensitivity.setText(Integer.toString(jsonObject.optInt("sensitivity", 0)));
binding.btnZoom.setChecked(jsonObject.optInt("zoom", 0) == 1); binding.btnZoom.setChecked(jsonObject.optInt("zoom", 0) == 1);
if (jsonObject.has("compensation")) { if (jsonObject.has("compensation")) {
binding.compensation.setText(Integer.toString(jsonObject.optInt("compensation", 0))); binding.compensation.setText(Integer.toString(jsonObject.optInt("compensation", 0)));
@ -254,6 +255,7 @@ public class ChannelActivity extends AppCompatActivity {
jsonObject.put("usbCamera", binding.btnUsbCamera.isChecked() ? 1 : 0); jsonObject.put("usbCamera", binding.btnUsbCamera.isChecked() ? 1 : 0);
jsonObject.put("autoExposure", binding.btnAutoExplosure.isChecked() ? 1 : 0); jsonObject.put("autoExposure", binding.btnAutoExplosure.isChecked() ? 1 : 0);
jsonObject.put("autoFocus", binding.btnAutoFocus.isChecked() ? 1 : 0); jsonObject.put("autoFocus", binding.btnAutoFocus.isChecked() ? 1 : 0);
jsonObject.put("ldrEnabled", binding.ldrEnabled.isChecked() ? 1 : 0);
// jsonObject.put("hdrMode", binding.btnHdrMode.isChecked() ? 1 : 0); // jsonObject.put("hdrMode", binding.btnHdrMode.isChecked() ? 1 : 0);
// jsonObject.put("nightMode", binding.btnNightMode.isChecked() ? 1 : 0); // jsonObject.put("nightMode", binding.btnNightMode.isChecked() ? 1 : 0);
int sceneMode = 0; int sceneMode = 0;
@ -262,7 +264,7 @@ public class ChannelActivity extends AppCompatActivity {
sceneMode = Integer.parseInt(sceneModeText); sceneMode = Integer.parseInt(sceneModeText);
jsonObject.put("sceneMode", sceneMode); jsonObject.put("sceneMode", sceneMode);
jsonObject.put("exposureTime", Integer.parseInt(binding.exposuretime.getText().toString())); jsonObject.put("exposureTime", Integer.parseInt(binding.exposuretime.getText().toString()));
jsonObject.put("sensibility", Integer.parseInt(binding.sensitivity.getText().toString())); jsonObject.put("sensitivity", Integer.parseInt(binding.sensitivity.getText().toString()));
jsonObject.put("zoom", binding.btnZoom.isChecked() ? 1 : 0); jsonObject.put("zoom", binding.btnZoom.isChecked() ? 1 : 0);
jsonObject.put("orientation", binding.orientations.getSelectedItemPosition()); jsonObject.put("orientation", binding.orientations.getSelectedItemPosition());
jsonObject.put("recognization", binding.recognization.getSelectedItemPosition()); jsonObject.put("recognization", binding.recognization.getSelectedItemPosition());

@ -267,6 +267,16 @@
app:layout_constraintTop_toTopOf="@+id/textViewCompensation" app:layout_constraintTop_toTopOf="@+id/textViewCompensation"
app:layout_constraintBottom_toBottomOf="@+id/textViewCompensation" /> app:layout_constraintBottom_toBottomOf="@+id/textViewCompensation" />
<Switch
android:id="@+id/ldrEnabled"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/activity_horizontal_margin"
android:text="@string/channel_cfg_ldr"
app:layout_constraintStart_toEndOf="@+id/compensation"
app:layout_constraintTop_toTopOf="@+id/compensation" />
<EditText <EditText
android:id="@+id/osdLeftTop" android:id="@+id/osdLeftTop"
android:layout_width="match_parent" android:layout_width="match_parent"

@ -47,6 +47,7 @@
<string name="channel_cfg_usb_camera">USB Camera</string> <string name="channel_cfg_usb_camera">USB Camera</string>
<string name="channel_cfg_video_duration">短视频时长(秒)</string> <string name="channel_cfg_video_duration">短视频时长(秒)</string>
<string name="channel_cfg_compensation">曝光补偿</string> <string name="channel_cfg_compensation">曝光补偿</string>
<string name="channel_cfg_ldr">光敏控制</string>
<!-- TODO: Remove or change this placeholder text --> <!-- TODO: Remove or change this placeholder text -->
<string name="hello_blank_fragment">Hello blank fragment</string> <string name="hello_blank_fragment">Hello blank fragment</string>
<string name="record">Record</string> <string name="record">Record</string>

Loading…
Cancel
Save