summaryrefslogtreecommitdiffstats
path: root/include/media/stagefright/CameraSource.h
diff options
context:
space:
mode:
authorEino-Ville Talvala <etalvala@google.com>2013-02-19 10:40:14 -0800
committerEino-Ville Talvala <etalvala@google.com>2013-02-25 16:11:41 -0800
commitceb388d6c03c38b96dc41c0ea4804b749aa077c4 (patch)
tree0639ba70ce330094a9fa71ba4577eece6d4dadb1 /include/media/stagefright/CameraSource.h
parent0894bfb78b7872570b94d0b8d23ebbf6a8b51d35 (diff)
downloadframeworks_av-ceb388d6c03c38b96dc41c0ea4804b749aa077c4.zip
frameworks_av-ceb388d6c03c38b96dc41c0ea4804b749aa077c4.tar.gz
frameworks_av-ceb388d6c03c38b96dc41c0ea4804b749aa077c4.tar.bz2
CameraService and Stagefright: Support AppOps
Camera: - Signal to AppOpsService when camera usage starts and stops - Listen to permissions revocations and act on them - Currently just kill camera connection when permissions lost Stagefright: - Pass on client name, UID to camera as needed Bug: 8181262 Change-Id: I9e33c9d05e9daa77dbb2d795045d08eb887ec8f0
Diffstat (limited to 'include/media/stagefright/CameraSource.h')
-rw-r--r--include/media/stagefright/CameraSource.h28
1 files changed, 20 insertions, 8 deletions
diff --git a/include/media/stagefright/CameraSource.h b/include/media/stagefright/CameraSource.h
index 6d6b8a9..cf38b14 100644
--- a/include/media/stagefright/CameraSource.h
+++ b/include/media/stagefright/CameraSource.h
@@ -25,6 +25,7 @@
#include <camera/CameraParameters.h>
#include <utils/List.h>
#include <utils/RefBase.h>
+#include <utils/String16.h>
namespace android {
@@ -39,9 +40,11 @@ public:
* settings (such as video size, frame rate, color format, etc)
* from the default camera.
*
+ * @param clientName The package/process name of the client application.
+ * This is used for permissions checking.
* @return NULL on error.
*/
- static CameraSource *Create();
+ static CameraSource *Create(const String16 &clientName);
/**
* Factory method to create a new CameraSource.
@@ -52,7 +55,11 @@ public:
*
* @param cameraId the id of the camera that the source will connect
* to if camera is NULL; otherwise ignored.
- *
+ * @param clientName the package/process name of the camera-using
+ * application if camera is NULL; otherwise ignored. Used for
+ * permissions checking.
+ * @param clientUid the UID of the camera-using application if camera is
+ * NULL; otherwise ignored. Used for permissions checking.
* @param videoSize the dimension (in pixels) of the video frame
* @param frameRate the target frames per second
* @param surface the preview surface for display where preview
@@ -71,6 +78,8 @@ public:
static CameraSource *CreateFromCamera(const sp<ICamera> &camera,
const sp<ICameraRecordingProxy> &proxy,
int32_t cameraId,
+ const String16& clientName,
+ uid_t clientUid,
Size videoSize,
int32_t frameRate,
const sp<Surface>& surface,
@@ -158,7 +167,7 @@ protected:
int64_t mTimeBetweenFrameCaptureUs;
CameraSource(const sp<ICamera>& camera, const sp<ICameraRecordingProxy>& proxy,
- int32_t cameraId,
+ int32_t cameraId, const String16& clientName, uid_t clientUid,
Size videoSize, int32_t frameRate,
const sp<Surface>& surface,
bool storeMetaDataInVideoBuffers);
@@ -198,17 +207,20 @@ private:
status_t init(const sp<ICamera>& camera, const sp<ICameraRecordingProxy>& proxy,
- int32_t cameraId, Size videoSize, int32_t frameRate,
- bool storeMetaDataInVideoBuffers);
+ int32_t cameraId, const String16& clientName, uid_t clientUid,
+ Size videoSize, int32_t frameRate, bool storeMetaDataInVideoBuffers);
status_t initWithCameraAccess(
const sp<ICamera>& camera, const sp<ICameraRecordingProxy>& proxy,
- int32_t cameraId, Size videoSize, int32_t frameRate,
- bool storeMetaDataInVideoBuffers);
+ int32_t cameraId, const String16& clientName, uid_t clientUid,
+ Size videoSize, int32_t frameRate, bool storeMetaDataInVideoBuffers);
status_t isCameraAvailable(const sp<ICamera>& camera,
const sp<ICameraRecordingProxy>& proxy,
- int32_t cameraId);
+ int32_t cameraId,
+ const String16& clientName,
+ uid_t clientUid);
+
status_t isCameraColorFormatSupported(const CameraParameters& params);
status_t configureCamera(CameraParameters* params,
int32_t width, int32_t height,