summaryrefslogtreecommitdiff
path: root/pjsip
diff options
context:
space:
mode:
Diffstat (limited to 'pjsip')
-rw-r--r--pjsip/include/pjsua2/media.hpp33
-rw-r--r--pjsip/src/pjsua2/media.cpp22
2 files changed, 55 insertions, 0 deletions
diff --git a/pjsip/include/pjsua2/media.hpp b/pjsip/include/pjsua2/media.hpp
index c3bf6e2d..1f45e54e 100644
--- a/pjsip/include/pjsua2/media.hpp
+++ b/pjsip/include/pjsua2/media.hpp
@@ -1673,6 +1673,39 @@ public:
*/
const VideoDevInfoVector &enumDev() throw(Error);
+ /**
+ * Check whether the video capture device is currently active, i.e. if
+ * a video preview has been started or there is a video call using
+ * the device.
+ *
+ * @param dev_id The video device id
+ *
+ * @return True if it's active.
+ */
+ bool isCaptureActive(int dev_id) const;
+
+ /**
+ * This will configure video orientation of the 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 method
+ * 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 true. If the video device is
+ * currently inactive, and the "keep" argument is false, this method
+ * will throw Error.
+ *
+ * @param dev_id The video device id
+ * @param orient The video orientation.
+ * @param keep Specify whether the setting is to be kept for
+ * future use.
+ *
+ */
+ void setCaptureOrient(pjmedia_vid_dev_index dev_id,
+ pjmedia_orient orient,
+ bool keep=true) throw(Error);
+
private:
VideoDevInfoVector videoDevList;
diff --git a/pjsip/src/pjsua2/media.cpp b/pjsip/src/pjsua2/media.cpp
index 46c60a46..6c8dbf0e 100644
--- a/pjsip/src/pjsua2/media.cpp
+++ b/pjsip/src/pjsua2/media.cpp
@@ -1306,6 +1306,28 @@ void VidDevManager::clearVideoDevList()
#endif
}
+bool VidDevManager::isCaptureActive(int dev_id) const
+{
+#if PJSUA_HAS_VIDEO
+ return (pjsua_vid_dev_is_active(dev_id) == PJ_TRUE? true: false);
+#else
+ PJ_UNUSED_ARG(dev_id);
+
+ return false;
+#endif
+}
+
+void VidDevManager::setCaptureOrient(pjmedia_vid_dev_index dev_id,
+ pjmedia_orient orient,
+ bool keep) throw(Error)
+{
+#if PJSUA_HAS_VIDEO
+ PJSUA2_CHECK_EXPR(pjsua_vid_dev_set_setting(dev_id,
+ PJMEDIA_VID_DEV_CAP_ORIENTATION, &orient, keep));
+#endif
+}
+
+
VidDevManager::VidDevManager()
{
}