summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2009-03-02 22:54:33 -0800
committerThe Android Open Source Project <initial-contribution@android.com>2009-03-02 22:54:33 -0800
commit3dec7d563a2f3e1eb967ce2054a00b6620e3558c (patch)
treeaa3b0365c47cb3c1607c0dc76c8d32b4046fc287 /include
parent15ab3eae2ec3d73b3e8aa60b33ae41445bf83f4b (diff)
downloadframeworks_base-3dec7d563a2f3e1eb967ce2054a00b6620e3558c.zip
frameworks_base-3dec7d563a2f3e1eb967ce2054a00b6620e3558c.tar.gz
frameworks_base-3dec7d563a2f3e1eb967ce2054a00b6620e3558c.tar.bz2
auto import from //depot/cupcake/@137055
Diffstat (limited to 'include')
-rw-r--r--include/media/AudioRecord.h9
-rw-r--r--include/media/IMediaRecorder.h2
-rw-r--r--include/media/PVMediaRecorder.h2
-rw-r--r--include/media/mediarecorder.h39
-rw-r--r--include/ui/CameraHardwareInterface.h3
-rw-r--r--include/utils/ResourceTypes.h16
6 files changed, 57 insertions, 14 deletions
diff --git a/include/media/AudioRecord.h b/include/media/AudioRecord.h
index dd585c9..ff64855 100644
--- a/include/media/AudioRecord.h
+++ b/include/media/AudioRecord.h
@@ -125,7 +125,8 @@ public:
* channelCount: Number of PCM channels (e.g 2 for stereo).
* frameCount: Total size of track PCM buffer in frames. This defines the
* latency of the track.
- * flags: Reserved for future use.
+ * flags: A bitmask of acoustic values from enum record_flags. It enables
+ * AGC, NS, and IIR.
* cbf: Callback function. If not null, this function is called periodically
* to provide new PCM data.
* notificationFrames: The callback function is called each time notificationFrames PCM
@@ -133,6 +134,12 @@ public:
* user Context for use by the callback receiver.
*/
+ enum record_flags {
+ RECORD_AGC_ENABLE = AudioSystem::AGC_ENABLE,
+ RECORD_NS_ENABLE = AudioSystem::NS_ENABLE,
+ RECORD_IIR_ENABLE = AudioSystem::TX_IIR_ENABLE
+ };
+
AudioRecord(int streamType,
uint32_t sampleRate = 0,
int format = 0,
diff --git a/include/media/IMediaRecorder.h b/include/media/IMediaRecorder.h
index 0dff84e..eace996 100644
--- a/include/media/IMediaRecorder.h
+++ b/include/media/IMediaRecorder.h
@@ -24,6 +24,7 @@ namespace android {
class ISurface;
class ICamera;
+class IMediaPlayerClient;
class IMediaRecorder: public IInterface
{
@@ -41,6 +42,7 @@ public:
virtual status_t setOutputFile(int fd, int64_t offset, int64_t length) = 0;
virtual status_t setVideoSize(int width, int height) = 0;
virtual status_t setVideoFrameRate(int frames_per_second) = 0;
+ virtual status_t setListener(const sp<IMediaPlayerClient>& listener) = 0;
virtual status_t prepare() = 0;
virtual status_t getMaxAmplitude(int* max) = 0;
virtual status_t start() = 0;
diff --git a/include/media/PVMediaRecorder.h b/include/media/PVMediaRecorder.h
index f795d04..3315c59 100644
--- a/include/media/PVMediaRecorder.h
+++ b/include/media/PVMediaRecorder.h
@@ -19,6 +19,7 @@
#define ANDROID_PVMEDIARECORDER_H
#include <media/mediarecorder.h>
+#include <media/IMediaPlayerClient.h>
namespace android {
@@ -44,6 +45,7 @@ public:
status_t setPreviewSurface(const sp<ISurface>& surface);
status_t setOutputFile(const char *path);
status_t setOutputFile(int fd, int64_t offset, int64_t length);
+ status_t setListener(const sp<IMediaPlayerClient>& listener);
status_t prepare();
status_t start();
status_t stop();
diff --git a/include/media/mediarecorder.h b/include/media/mediarecorder.h
index 436e8f1..8991f08 100644
--- a/include/media/mediarecorder.h
+++ b/include/media/mediarecorder.h
@@ -19,6 +19,7 @@
#define ANDROID_MEDIARECORDER_H
#include <utils.h>
+#include <media/IMediaPlayerClient.h>
namespace android {
@@ -87,7 +88,24 @@ enum media_recorder_states {
MEDIA_RECORDER_RECORDING = 1 << 4,
};
-class MediaRecorder
+// The "msg" code passed to the listener in notify.
+enum {
+ MEDIA_RECORDER_EVENT_ERROR = 1
+};
+
+enum {
+ MEDIA_RECORDER_ERROR_UNKNOWN = 1
+};
+
+// ----------------------------------------------------------------------------
+// ref-counted object for callbacks
+class MediaRecorderListener: virtual public RefBase
+{
+public:
+ virtual void notify(int msg, int ext1, int ext2) = 0;
+};
+
+class MediaRecorder : public BnMediaPlayerClient
{
public:
MediaRecorder();
@@ -105,6 +123,7 @@ public:
status_t setOutputFile(int fd, int64_t offset, int64_t length);
status_t setVideoSize(int width, int height);
status_t setVideoFrameRate(int frames_per_second);
+ status_t setListener(const sp<MediaRecorderListener>& listener);
status_t prepare();
status_t getMaxAmplitude(int* max);
status_t start();
@@ -113,18 +132,22 @@ public:
status_t init();
status_t close();
status_t release();
+ void notify(int msg, int ext1, int ext2);
private:
void doCleanUp();
status_t doReset();
- sp<IMediaRecorder> mMediaRecorder;
- media_recorder_states mCurrentState;
- bool mIsAudioSourceSet;
- bool mIsVideoSourceSet;
- bool mIsAudioEncoderSet;
- bool mIsVideoEncoderSet;
- bool mIsOutputFileSet;
+ sp<IMediaRecorder> mMediaRecorder;
+ sp<MediaRecorderListener> mListener;
+ media_recorder_states mCurrentState;
+ bool mIsAudioSourceSet;
+ bool mIsVideoSourceSet;
+ bool mIsAudioEncoderSet;
+ bool mIsVideoEncoderSet;
+ bool mIsOutputFileSet;
+ Mutex mLock;
+ Mutex mNotifyLock;
};
}; // namespace android
diff --git a/include/ui/CameraHardwareInterface.h b/include/ui/CameraHardwareInterface.h
index b068c52..73036f0 100644
--- a/include/ui/CameraHardwareInterface.h
+++ b/include/ui/CameraHardwareInterface.h
@@ -87,6 +87,9 @@ public:
/** Return the IMemoryHeap for the preview image heap */
virtual sp<IMemoryHeap> getPreviewHeap() const = 0;
+ /** Return the IMemoryHeap for the raw image heap */
+ virtual sp<IMemoryHeap> getRawHeap() const = 0;
+
/**
* Start preview mode. When a preview image is available
* preview_callback is called with the user parameter. The
diff --git a/include/utils/ResourceTypes.h b/include/utils/ResourceTypes.h
index d83a33c..7d3fcf2 100644
--- a/include/utils/ResourceTypes.h
+++ b/include/utils/ResourceTypes.h
@@ -1101,16 +1101,22 @@ struct ResTable_config
return false;
}
- // Return true if 'this' can be considered a match for the parameters in
+ // Return true if 'this' can be considered a match for the parameters in
// 'settings'.
+ // Note this is asymetric. A default piece of data will match every request
+ // but a request for the default should not match odd specifics
+ // (ie, request with no mcc should not match a particular mcc's data)
+ // settings is the requested settings
inline bool match(const ResTable_config& settings) const {
if (imsi != 0) {
- if (settings.mcc != 0 && mcc != 0
- && mcc != settings.mcc) {
+ if ((settings.mcc != 0 && mcc != 0
+ && mcc != settings.mcc) ||
+ (settings.mcc == 0 && mcc != 0)) {
return false;
}
- if (settings.mnc != 0 && mnc != 0
- && mnc != settings.mnc) {
+ if ((settings.mnc != 0 && mnc != 0
+ && mnc != settings.mnc) ||
+ (settings.mnc == 0 && mnc != 0)) {
return false;
}
}