summaryrefslogtreecommitdiff
path: root/pjsip/include
diff options
context:
space:
mode:
authorLiong Sauw Ming <ming@teluu.com>2015-07-03 06:21:30 +0000
committerLiong Sauw Ming <ming@teluu.com>2015-07-03 06:21:30 +0000
commitb08aa5cd83bb7d435cb9b59ab3c4c197d353c40b (patch)
treeeee8c44809065d7166dd2ae21add0b5c56dbb41d /pjsip/include
parenta4bd5dd01062c3f5f78227f3da46d79d39d0e1df (diff)
Re #1861: Changed pjsua API for setting the orientation using a more generic API, pjsua_vid_dev_set_setting() instead
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@5125 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip/include')
-rw-r--r--pjsip/include/pjsua-lib/pjsua.h60
-rw-r--r--pjsip/include/pjsua-lib/pjsua_internal.h3
2 files changed, 54 insertions, 9 deletions
diff --git a/pjsip/include/pjsua-lib/pjsua.h b/pjsip/include/pjsua-lib/pjsua.h
index 8cc91f28..e6e0507c 100644
--- a/pjsip/include/pjsua-lib/pjsua.h
+++ b/pjsip/include/pjsua-lib/pjsua.h
@@ -6611,19 +6611,61 @@ PJ_DECL(pj_status_t) pjsua_vid_dev_get_info(pjmedia_vid_dev_index id,
PJ_DECL(pj_bool_t) pjsua_vid_dev_is_active(pjmedia_vid_dev_index id);
/**
- * Set the orientation of the video device. The function only works
- * for video capture device and if the device is currently active (i.e.
- * a video preview has been started or there is a video call using the device).
- * Application can check if a video device is active by calling
- * #pjsua_vid_dev_is_active().
+ * Configure the capability of a video capture device. If the device is
+ * currently active (i.e. if there is a video call using the device or
+ * a video preview has been started), the function will forward the setting
+ * to the video device instance to be applied immediately, if it supports it.
+ *
+ * The setting will be saved for future opening of the video device, if the
+ * "keep" argument is set to non-zero. If the video device is currently
+ * inactive, and the "keep" argument is false, this function will return
+ * error.
+ *
+ * Note: This function will only works for video capture devices. To
+ * configure the setting of video renderer device instances, use
+ * pjsua_vid_win API instead.
+ *
+ * Warning: If application refreshes the video device list, it needs to
+ * manually update the settings to reflect the newly updated video device
+ * indexes. See #pjmedia_vid_dev_refresh() for more information.
+ *
+ * See also #pjmedia_vid_stream_set_cap() for more information about setting
+ * a video device capability.
*
* @param id The video device index.
- * @param orient Video device orientation.
+ * @param cap The video device capability to change.
+ * @param pval Pointer to value. Please see #pjmedia_vid_dev_cap
+ * documentation about the type of value to be
+ * supplied for each setting.
*
- * @return PJ_SUCCESS on success, or the appropriate error code.
+ * @return PJ_SUCCESS on success or the appropriate error code.
+ */
+PJ_DECL(pj_status_t) pjsua_vid_dev_set_setting(pjmedia_vid_dev_index id,
+ pjmedia_vid_dev_cap cap,
+ const void *pval,
+ pj_bool_t keep);
+
+/**
+ * Retrieve the value of a video capture device setting. If the device is
+ * currently active (i.e. if there is a video call using the device or
+ * a video preview has been started), the function will forward the request
+ * to the video device. If video device is currently inactive, and if
+ * application had previously set the setting and mark the setting as kept,
+ * then that setting will be returned. Otherwise, this function will return
+ * error.
+ * The function only works for video capture device.
+ *
+ * @param id The video device index.
+ * @param cap The video device capability to retrieve.
+ * @param pval Pointer to receive the value.
+ * Please see #pjmedia_vid_dev_cap documentation about
+ * the type of value to be supplied for each setting.
+ *
+ * @return PJ_SUCCESS on success or the appropriate error code.
*/
-PJ_DECL(pj_status_t) pjsua_vid_dev_set_orient(pjmedia_vid_dev_index id,
- pjmedia_orient orient);
+PJ_DECL(pj_status_t) pjsua_vid_dev_get_setting(pjmedia_vid_dev_index id,
+ pjmedia_vid_dev_cap cap,
+ void *pval);
/**
* Enum all video devices installed in the system.
diff --git a/pjsip/include/pjsua-lib/pjsua_internal.h b/pjsip/include/pjsua-lib/pjsua_internal.h
index 91b68d50..91d1c646 100644
--- a/pjsip/include/pjsua-lib/pjsua_internal.h
+++ b/pjsip/include/pjsua-lib/pjsua_internal.h
@@ -482,6 +482,9 @@ struct pjsua_data
/* Video device */
pjmedia_vid_dev_index vcap_dev; /**< Capture device ID. */
pjmedia_vid_dev_index vrdr_dev; /**< Playback device ID. */
+ /* For keeping video device settings */
+ pj_uint32_t vid_caps[PJMEDIA_VID_DEV_MAX_DEVS];
+ pjmedia_vid_dev_param vid_param[PJMEDIA_VID_DEV_MAX_DEVS];
/* File players: */
unsigned player_cnt;/**< Number of file players. */