在上一版擴充觀看系統 (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
列舉) 用戶端可讀取及寫入 (如果用戶端是主要執行個體),
和 getIntParameterRange()
會轉發有效值範圍和解析度。
當主用戶端變更相機參數時,同一部攝影機上的所有其他用戶端都會
就會收到相應的 PARAMETER_CHANGED
事件通知,
參數 ID 和新值
注意: 感應器驅動程式可能會處理無效參數
值不同。它可能只會傳回錯誤代碼或
有效的範圍因此,setIntParameter()
方法會傳回
有效值,而用戶端可以使用這個值確認要求
互動。
要求多個相機用戶端之間進行仲裁
先前的 EVS 設計允許多個應用程式同時運作 可能會遇到單一應用程式 變更相機參數,幹擾其他應用程式的運作。另外, 多個客戶可能希望以不同方式調整同一個參數, 導致執行中的相機服務出現非預期的行為。
為避免這類問題,EVS 管理員僅允許該「主要」用戶端
來編寫相機參數。用戶端在嘗試調整任何相機參數之前
必須呼叫 setMaster()
成為主要用戶端
方法。如果操作失敗,表示已有使用中的主要用戶端
該相機硬體的其他部分直到目前主要用戶端終止或明確部署為止
透過 unsetMaster()
建立主角色,但沒有其他用戶端
變更相機參數當主用戶端傳回其權限時,
其餘所有應用程式都會收到 MASTER_RELEASED
事件通知。
優先順序高的客戶
EVS 經理會處理擁有高額顯示器的用戶端 優先順序,並能讓該主體從目前的主要執行個體中竊取主角色。因為 EVS 新客戶甚至可以接管 用戶端和 IP 位置
高優先順序用戶端必須呼叫 IEvsCamera::forceMaster(sp<IEvsDisplay>& display)
取得主要角色EVS 管理工具會檢查特定螢幕的狀態
處理,且 (僅限) 狀態有效且
DisplayState::NOT_OPEN
,或DisplayState::DEAD
主節點。用戶端就會失去主要角色
由 MASTER_RELEASED
事件通知且必須控制代碼
這些資訊