ใน Extended View System (EVS) 1.0 รุ่นก่อนหน้า อุปกรณ์กล้อง ถือเป็นอุปกรณ์แบบอ่านอย่างเดียว ดังนั้นจึงไม่มีวิธีการใดๆ ที่จะทำให้ แอปเพื่อเปลี่ยนพารามิเตอร์การควบคุมกล้อง เช่น การซูมหรือความสว่าง
เนื่องจากการดำเนินการนี้อาจจำกัดความสามารถของแอป EVS ดังนั้น EVS 1.1 ใหม่
แนะนำวิธีการใหม่ๆ และอนุญาตให้แอปตั้งโปรแกรมสำหรับกล้องหลายตัว
พารามิเตอร์ควบคุม ซึ่งทั้งหมดนี้ระบุไว้ใน enum CameraParam
:
/**
* EVS Camera Parameter
*/
enum CameraParam : uint32_t {
/**
* The brightness of image frames
*/
BRIGHTNESS,
/**
* The contrast of image frames
*/
CONTRAST,
/**
* Automatic gain/exposure control
*/
AUTOGAIN,
/**
* Gain control
*/
GAIN,
/**
* Automatic Whitebalance
*/
AUTO_WHITE_BALANCE,
/**
* Manual white balance setting as a color temperature in Kelvin.
*/
WHITE_BALANCE_TEMPERATURE,
/**
* Image sharpness adjustment
*/
SHARPNESS,
/**
* Auto Exposure Control modes; auto, manual, shutter priority, or
* aperture priority.
*/
AUTO_EXPOSURE,
/**
* Manual exposure time of the camera
*/
ABSOLUTE_EXPOSURE,
/**
* Set the focal point of the camera to the specified position. This
* parameter may not be effective when auto focus is enabled.
*/
ABSOLUTE_FOCUS,
/**
* Enables continuous automatic focus adjustments.
*/
AUTO_FOCUS,
/**
* Specify the objective lens focal length as an absolute value.
*/
ABSOLUTE_ZOOM,
};
โดยวิธีการมีคำจำกัดความดังนี้
/**
* Requests to be a master client.
*
* When multiple clients subscribe to a single camera hardware and one of
* them adjusts a camera parameter such as the contrast, it may disturb
* other clients' operations. Therefore, the client must call this method
* to be a master client. When it becomes a master, it can
* change camera parameters until either it dies or explicitly gives up the
* role.
*
* @return result EvsResult::OK if a master role is granted.
* EvsResult::OWNERSHIP_LOST if there is already a
* master client.
*/
setMaster() generates (EvsResult result);
/**
* Sets to be a master client forcibly.
*
* The client, which owns the display, has a high priority and can take over
* a master role from other clients without the display.
*
* @param display IEvsDisplay handle. If this is valid, the calling client
* is considered as the high priority client and therefore
* it would take over a master role.
*
* @return result EvsResult::OK if a master role is granted.
* EvsResult::OWNERSHIP_LOST if there is already a
* master client with the display.
*/
forceMaster(IEvsDisplay display) generates (EvsResult result);
/**
* Retires from a master client role.
*
* @return result EvsResult::OK if this call is successful.
* EvsResult::INVALID_ARG if the caller client is not a
* master client.
*/
unsetMaster() generates (EvsResult result);
/**
* Retrieves a list of parameters this camera supports.
*
* @return params A list of CameraParam that this camera supports.
*/
getParameterList() generates (vec<CameraParam> params);
/**
* Requests a valid value range of a camera parameter
*
* @param id The identifier of camera parameter, CameraParam enum.
*
* @return min The lower bound of the valid parameter value range.
* @return max The upper bound of the valid parameter value range.
* @return step The resolution of values in valid range.
*/
getIntParameterRange(CameraParam id)
generates (int32_t min, int32_t max, int32_t step);
/**
* Requests to set a camera parameter.
*
* @param id The identifier of camera parameter,
* CameraParam enum.
* value A desired parameter value.
* @return result EvsResult::OK if it succeeds to set a parameter.
* EvsResult::INVALID_ARG if either a requested
* parameter is not supported or a given value is out
* of bounds.
* effectiveValue A programmed parameter value. This may differ
* from what the client gives if, for example, the
* driver does not support a target parameter.
*/
setIntParameter(CameraParam id, int32_t value)
generates (EvsResult result, int32_t effectiveValue);
/**
* Retrieves a value of given camera parameter.
*
* @param id The identifier of camera parameter, CameraParam enum.
* @return result EvsResult::OK if it succeeds to read a parameter.
* EvsResult::INVALID_ARG if either a requested parameter is
* not supported.
* value A value of requested camera parameter.
*/
getIntParameter(CameraParam id) generates(EvsResult result, int32_t value);
getParameterList()
แสดงผลรายการพารามิเตอร์
(CameraParam
enum) ที่ไคลเอ็นต์จะอ่านและเขียนได้ (หากไคลเอ็นต์เป็น Master)
และ getIntParameterRange()
จะส่งต่อช่วงค่าและความละเอียดที่ถูกต้อง
เมื่อไคลเอ็นต์หลักเปลี่ยนพารามิเตอร์ของกล้อง ไคลเอ็นต์อื่นๆ ทั้งหมดในกล้องเดียวกัน
ฮาร์ดแวร์จะได้รับการแจ้งเตือนเมื่อเกิดเหตุการณ์ PARAMETER_CHANGED
ที่มี
พารามิเตอร์และค่าใหม่
หมายเหตุ: ไดรเวอร์เซ็นเซอร์อาจจัดการพารามิเตอร์ที่ไม่ถูกต้อง
แตกต่างกันไป อาจเพียงแค่ส่งคืนรหัสข้อผิดพลาดหรือตัดค่าใน
ช่วงที่ถูกต้องและนำไปใช้ ดังนั้น เมธอด setIntParameter()
จึงแสดงผล
ค่าที่มีผล และลูกค้าสามารถใช้ค่านี้เพื่อยืนยันการทำงานของคำขอ
มีการจัดการ
ส่งคำขอการชี้ขาดระหว่างไคลเอ็นต์กล้องหลายราย
เนื่องจากการออกแบบ EVS ก่อนหน้านี้ทำให้แอปหลายแอปสามารถ ฮาร์ดแวร์กล้องตัวเดียว อาจเป็นไปได้ว่าแอปเดียวสามารถ รบกวนการทำงานของแอปอื่นๆ ด้วยการเปลี่ยนพารามิเตอร์กล้อง และ ไคลเอ็นต์หลายรายอาจต้องการปรับพารามิเตอร์เดียวกันให้แตกต่างกัน จึงทำให้ ทำให้เกิดลักษณะการทำงานที่ไม่คาดคิดในการเรียกใช้บริการกล้อง
เพื่อหลีกเลี่ยงปัญหาดังกล่าว ผู้จัดการ EVS อนุญาตเฉพาะลูกค้าหลักเท่านั้น
เพื่อตั้งโปรแกรมพารามิเตอร์กล้อง ก่อนที่จะปรับพารามิเตอร์กล้อง
ต้องเป็นไคลเอ็นต์หลักโดยการเรียกใช้ setMaster()
หากการดำเนินการนี้ไม่สำเร็จ แสดงว่ามีไคลเอ็นต์หลักที่ใช้งานอยู่แล้ว
เกี่ยวกับฮาร์ดแวร์กล้อง จนกว่าไคลเอ็นต์หลักปัจจุบันจะเสียชีวิต หรือโดยชัดแจ้ง
มอบบทบาทหลักผ่าน unsetMaster()
ไม่มีไคลเอ็นต์อื่น
ได้รับอนุญาตให้เปลี่ยนพารามิเตอร์กล้อง เมื่อลูกค้าหลักส่งสิทธิ์กลับมา
แอปอื่นๆ ทั้งหมดได้รับแจ้งจากเหตุการณ์ MASTER_RELEASED
ลูกค้าที่มีลำดับความสำคัญสูง
ผู้จัดการ EVS ดูแลลูกค้าที่เป็นเจ้าของจอแสดงผล ลำดับความสำคัญและอนุญาตให้ ขโมยบทบาทหลักจากต้นแบบปัจจุบันได้ เนื่องจาก EVS การเป็นเจ้าของเครือข่ายดิสเพลย์นั้นพิจารณาจากความใหม่ ลูกค้าใหม่ยังสามารถรับช่วงจาก ไคลเอ็นต์ปัจจุบันกับจอแสดงผล
ไคลเอ็นต์ที่มีลำดับความสำคัญสูงจะต้องเรียกใช้ IEvsCamera::forceMaster(sp<IEvsDisplay>& display)
เพื่อรับบทบาทหลัก ผู้จัดการ EVS ตรวจสอบสถานะของจอแสดงผลที่ระบุ
แฮนเดิล และถ้า (และเฉพาะในกรณีที่) สถานะของแฮนเดิลนั้นถูกต้องและไม่ใช่ทั้ง 2 สถานะ
DisplayState::NOT_OPEN
หรือ DisplayState::DEAD
แทนที่ต้นฉบับ ไคลเอ็นต์ที่เพิ่งเสียบทบาทหลักไป
แจ้งเตือนโดยเหตุการณ์ MASTER_RELEASED
และต้องจัดการ
อย่างเหมาะสม