summaryrefslogtreecommitdiff
path: root/pjsip
diff options
context:
space:
mode:
authorLiong Sauw Ming <ming@teluu.com>2015-07-30 06:23:35 +0000
committerLiong Sauw Ming <ming@teluu.com>2015-07-30 06:23:35 +0000
commitdbaa384af07319b4f7bffe6909e3d470a0e0b672 (patch)
treed3bd5fbac5e39c32ff291040ecc4792d91bef8ef /pjsip
parent4bf98126d927c55fbfbfec3d76798cd5e14543cc (diff)
Fixed #1861: Add support for video capture orientation on Android
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@5138 74dad513-b988-da41-8d7b-12977e46ad98
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()
{
}