summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/media/AudioRecord.h9
-rw-r--r--include/media/AudioSystem.h71
-rw-r--r--include/media/AudioTrack.h14
-rw-r--r--include/media/IAudioFlinger.h23
-rw-r--r--include/media/IAudioFlingerClient.h55
-rw-r--r--include/media/IMediaRecorder.h4
-rw-r--r--include/media/JetPlayer.h16
-rw-r--r--include/media/MediaPlayerInterface.h32
-rw-r--r--include/media/PVMediaRecorder.h4
-rw-r--r--include/media/PVPlayer.h18
-rw-r--r--include/media/ToneGenerator.h3
-rw-r--r--include/media/mediaplayer.h68
-rw-r--r--include/media/mediarecorder.h51
-rw-r--r--include/media/thread_init.h1
-rw-r--r--include/private/opengles/gl_context.h1
15 files changed, 281 insertions, 89 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/AudioSystem.h b/include/media/AudioSystem.h
index 77676bf..77c90ba 100644
--- a/include/media/AudioSystem.h
+++ b/include/media/AudioSystem.h
@@ -29,8 +29,27 @@ class AudioSystem
{
public:
+ enum stream_type {
+ DEFAULT =-1,
+ VOICE_CALL = 0,
+ SYSTEM = 1,
+ RING = 2,
+ MUSIC = 3,
+ ALARM = 4,
+ NOTIFICATION = 5,
+ BLUETOOTH_SCO = 6,
+ NUM_STREAM_TYPES
+ };
+
+ enum audio_output_type {
+ AUDIO_OUTPUT_DEFAULT =-1,
+ AUDIO_OUTPUT_HARDWARE = 0,
+ AUDIO_OUTPUT_A2DP = 1,
+ NUM_AUDIO_OUTPUT_TYPES
+ };
+
enum audio_format {
- DEFAULT = 0,
+ FORMAT_DEFAULT = 0,
PCM_16_BIT,
PCM_8_BIT,
INVALID_FORMAT
@@ -51,7 +70,16 @@ public:
ROUTE_BLUETOOTH_SCO = (1 << 2),
ROUTE_HEADSET = (1 << 3),
ROUTE_BLUETOOTH_A2DP = (1 << 4),
- ROUTE_ALL = 0xFFFFFFFF
+ ROUTE_ALL = -1UL,
+ };
+
+ enum audio_in_acoustics {
+ AGC_ENABLE = 0x0001,
+ AGC_DISABLE = 0,
+ NS_ENABLE = 0x0002,
+ NS_DISABLE = 0,
+ TX_IIR_ENABLE = 0x0004,
+ TX_DISABLE = 0
};
/* These are static methods to control the system-wide AudioFlinger
@@ -96,33 +124,52 @@ public:
static float linearToLog(int volume);
static int logToLinear(float volume);
- static status_t getOutputSamplingRate(int* samplingRate);
- static status_t getOutputFrameCount(int* frameCount);
- static status_t getOutputLatency(uint32_t* latency);
+ static status_t getOutputSamplingRate(int* samplingRate, int stream = DEFAULT);
+ static status_t getOutputFrameCount(int* frameCount, int stream = DEFAULT);
+ static status_t getOutputLatency(uint32_t* latency, int stream = DEFAULT);
+
+ static bool routedToA2dpOutput(int streamType);
+
+ static status_t getInputBufferSize(uint32_t sampleRate, int format, int channelCount,
+ size_t* buffSize);
// ----------------------------------------------------------------------------
private:
- class DeathNotifier: public IBinder::DeathRecipient
+ class AudioFlingerClient: public IBinder::DeathRecipient, public BnAudioFlingerClient
{
public:
- DeathNotifier() {
+ AudioFlingerClient() {
}
+ // DeathRecipient
virtual void binderDied(const wp<IBinder>& who);
+
+ // IAudioFlingerClient
+ virtual void a2dpEnabledChanged(bool enabled);
+
};
+ static int getOutput(int streamType);
- static sp<DeathNotifier> gDeathNotifier;
+ static sp<AudioFlingerClient> gAudioFlingerClient;
- friend class DeathNotifier;
+ friend class AudioFlingerClient;
static Mutex gLock;
static sp<IAudioFlinger> gAudioFlinger;
static audio_error_callback gAudioErrorCallback;
- static int gOutSamplingRate;
- static int gOutFrameCount;
- static uint32_t gOutLatency;
+ static int gOutSamplingRate[NUM_AUDIO_OUTPUT_TYPES];
+ static int gOutFrameCount[NUM_AUDIO_OUTPUT_TYPES];
+ static uint32_t gOutLatency[NUM_AUDIO_OUTPUT_TYPES];
+ static bool gA2dpEnabled;
+
+ static size_t gInBuffSize;
+ // previous parameters for recording buffer size queries
+ static uint32_t gPrevInSamplingRate;
+ static int gPrevInFormat;
+ static int gPrevInChannelCount;
+
};
}; // namespace android
diff --git a/include/media/AudioTrack.h b/include/media/AudioTrack.h
index fd62daa..659f5f8 100644
--- a/include/media/AudioTrack.h
+++ b/include/media/AudioTrack.h
@@ -42,18 +42,6 @@ class audio_track_cblk_t;
class AudioTrack
{
public:
-
- enum stream_type {
- DEFAULT =-1,
- VOICE_CALL = 0,
- SYSTEM = 1,
- RING = 2,
- MUSIC = 3,
- ALARM = 4,
- NOTIFICATION = 5,
- NUM_STREAM_TYPES
- };
-
enum channel_index {
MONO = 0,
LEFT = 0,
@@ -127,7 +115,7 @@ public:
* Parameters:
*
* streamType: Select the type of audio stream this track is attached to
- * (e.g. AudioTrack::MUSIC).
+ * (e.g. AudioSystem::MUSIC).
* sampleRate: Track sampling rate in Hz.
* format: PCM sample format (e.g AudioSystem::PCM_16_BIT for signed
* 16 bits per sample).
diff --git a/include/media/IAudioFlinger.h b/include/media/IAudioFlinger.h
index 69703b2..6f13fe0 100644
--- a/include/media/IAudioFlinger.h
+++ b/include/media/IAudioFlinger.h
@@ -26,6 +26,7 @@
#include <utils/IInterface.h>
#include <media/IAudioTrack.h>
#include <media/IAudioRecord.h>
+#include <media/IAudioFlingerClient.h>
namespace android {
@@ -64,11 +65,11 @@ public:
/* query the audio hardware state. This state never changes,
* and therefore can be cached.
*/
- virtual uint32_t sampleRate() const = 0;
- virtual int channelCount() const = 0;
- virtual int format() const = 0;
- virtual size_t frameCount() const = 0;
- virtual uint32_t latency() const = 0;
+ virtual uint32_t sampleRate(int output) const = 0;
+ virtual int channelCount(int output) const = 0;
+ virtual int format(int output) const = 0;
+ virtual size_t frameCount(int output) const = 0;
+ virtual uint32_t latency(int output) const = 0;
/* set/get the audio hardware state. This will probably be used by
* the preference panel, mostly.
@@ -107,6 +108,18 @@ public:
// Temporary interface, do not use
// TODO: Replace with a more generic key:value get/set mechanism
virtual status_t setParameter(const char* key, const char* value) = 0;
+
+ // register a current process for audio output change notifications
+ virtual void registerClient(const sp<IAudioFlingerClient>& client) = 0;
+
+ // retrieve the audio recording buffer size
+ virtual size_t getInputBufferSize(uint32_t sampleRate, int format, int channelCount) = 0;
+
+ // force AudioFlinger thread out of standby
+ virtual void wakeUp() = 0;
+
+ // is A2DP output enabled
+ virtual bool isA2dpEnabled() const = 0;
};
diff --git a/include/media/IAudioFlingerClient.h b/include/media/IAudioFlingerClient.h
new file mode 100644
index 0000000..c3deb0b
--- /dev/null
+++ b/include/media/IAudioFlingerClient.h
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2009 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ANDROID_IAUDIOFLINGERCLIENT_H
+#define ANDROID_IAUDIOFLINGERCLIENT_H
+
+
+#include <utils/RefBase.h>
+#include <utils/IInterface.h>
+
+
+namespace android {
+
+// ----------------------------------------------------------------------------
+
+class IAudioFlingerClient : public IInterface
+{
+public:
+ DECLARE_META_INTERFACE(AudioFlingerClient);
+
+ // Notifies a change of audio output from/to hardware to/from A2DP.
+ virtual void a2dpEnabledChanged(bool enabled) = 0;
+
+};
+
+
+// ----------------------------------------------------------------------------
+
+class BnAudioFlingerClient : public BnInterface<IAudioFlingerClient>
+{
+public:
+ virtual status_t onTransact( uint32_t code,
+ const Parcel& data,
+ Parcel* reply,
+ uint32_t flags = 0);
+};
+
+// ----------------------------------------------------------------------------
+
+}; // namespace android
+
+#endif // ANDROID_IAUDIOFLINGERCLIENT_H
diff --git a/include/media/IMediaRecorder.h b/include/media/IMediaRecorder.h
index 49e45d1..64d3a40 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
{
@@ -38,8 +39,11 @@ public:
virtual status_t setVideoEncoder(int ve) = 0;
virtual status_t setAudioEncoder(int ae) = 0;
virtual status_t setOutputFile(const char* path) = 0;
+ 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 setParameters(const String8& params) = 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/JetPlayer.h b/include/media/JetPlayer.h
index 4268170..16764a9 100644
--- a/include/media/JetPlayer.h
+++ b/include/media/JetPlayer.h
@@ -33,9 +33,12 @@ class JetPlayer {
public:
- static const int JET_USERID_UPDATE = 1;
- static const int JET_NUMQUEUEDSEGMENT_UPDATE = 2;
- static const int JET_PAUSE_UPDATE = 3;
+ // to keep in sync with the JetPlayer class constants
+ // defined in frameworks/base/media/java/android/media/JetPlayer.java
+ static const int JET_EVENT = 1;
+ static const int JET_USERID_UPDATE = 2;
+ static const int JET_NUMQUEUEDSEGMENT_UPDATE = 3;
+ static const int JET_PAUSE_UPDATE = 4;
JetPlayer(jobject javaJetPlayer,
int maxTracks = 32,
@@ -44,7 +47,8 @@ public:
int init();
int release();
- int openFile(const char* url);
+ int loadFromFile(const char* url);
+ int loadFromFD(const int fd, const long long offset, const long long length);
int closeFile();
int play();
int pause();
@@ -53,6 +57,7 @@ public:
int setMuteFlags(EAS_U32 muteFlags, bool sync);
int setMuteFlag(int trackNum, bool muteFlag, bool sync);
int triggerClip(int clipId);
+ int clearQueue();
void setEventCallback(jetevent_callback callback);
@@ -62,7 +67,8 @@ public:
private:
static int renderThread(void*);
int render();
- void fireEventOnStatusChange();
+ void fireUpdateOnStatusChange();
+ void fireEventsFromJetQueue();
JetPlayer() {} // no default constructor
void dump();
diff --git a/include/media/MediaPlayerInterface.h b/include/media/MediaPlayerInterface.h
index 30e4578..7f0e7b3 100644
--- a/include/media/MediaPlayerInterface.h
+++ b/include/media/MediaPlayerInterface.h
@@ -17,9 +17,6 @@
#ifndef ANDROID_MEDIAPLAYERINTERFACE_H
#define ANDROID_MEDIAPLAYERINTERFACE_H
-#include <pthread.h>
-#include <signal.h>
-
#ifdef __cplusplus
#include <ui/ISurface.h>
@@ -74,7 +71,6 @@ public:
virtual ~MediaPlayerBase() {}
virtual status_t initCheck() = 0;
virtual bool hardwareOutput() = 0;
- virtual status_t setSigBusHandlerStructTLSKey(pthread_key_t key) { return 0; }
virtual status_t setDataSource(const char *url) = 0;
virtual status_t setDataSource(int fd, int64_t offset, int64_t length) = 0;
virtual status_t setVideoSurface(const sp<ISurface>& surface) = 0;
@@ -125,34 +121,6 @@ public:
#endif // __cplusplus
-// A thread can set the thread local variable identified by the pthread_key_t
-// that was passed to the player using the setSigBusHandlerStructTLSKey()
-// method to the address of the following structure.
-// If 'handlesigbus' is non-NULL, the function it points to will be called,
-// and if it returns 0, the signal will be assumed to have been handled,
-// and no other action will be taken. If it returns non-zero, the old SIGBUS
-// handler will be called.
-// If 'handlesigbus is NULL, then sigbusvar must be non NULL. The system's
-// SIGBUS handler will map an accessible page filled with zeroes at the
-// location that caused the original fault, set the variable pointed to by
-// sigbusvar to a non-zero value, and exit (which causes the operation to
-// be retried, which should now succeed).
-// If base and len are non zero, which is strongly recommended, they will
-// be used as additional constraints on the signal handler. That is, when
-// specified, the fault address must be in the range specified by base and
-// len in order for handlesigbus() to be called or sigbusvar to be set.
-// If the fault address is outside of the range, the old SIGBUS handler
-// will be called.
-struct mediasigbushandler {
- int (*handlesigbus)(siginfo_t *, struct mediasigbushandler *);
- int *sigbusvar;
- char *base;
- int len;
- // these next two are free for application use
- struct mediasigbushandler *next;
- void *data;
-};
-
#endif // ANDROID_MEDIAPLAYERINTERFACE_H
diff --git a/include/media/PVMediaRecorder.h b/include/media/PVMediaRecorder.h
index 5fee0d6..0c71932 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 {
@@ -43,6 +44,9 @@ public:
status_t setCamera(const sp<ICamera>& camera);
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 setParameters(const String8& params);
+ status_t setListener(const sp<IMediaPlayerClient>& listener);
status_t prepare();
status_t start();
status_t stop();
diff --git a/include/media/PVPlayer.h b/include/media/PVPlayer.h
index 5f302ed..8122df6 100644
--- a/include/media/PVPlayer.h
+++ b/include/media/PVPlayer.h
@@ -20,6 +20,12 @@
#include <utils/Errors.h>
#include <media/MediaPlayerInterface.h>
+#define MAX_OPENCORE_INSTANCES 25
+
+#ifdef MAX_OPENCORE_INSTANCES
+#include <cutils/atomic.h>
+#endif
+
class PlayerDriver;
namespace android {
@@ -31,7 +37,6 @@ public:
virtual ~PVPlayer();
virtual status_t initCheck();
- virtual status_t setSigBusHandlerStructTLSKey(pthread_key_t key);
virtual status_t setDataSource(const char *url);
virtual status_t setDataSource(int fd, int64_t offset, int64_t length);
virtual status_t setVideoSurface(const sp<ISurface>& surface);
@@ -48,8 +53,8 @@ public:
virtual status_t setLooping(int loop);
virtual player_type playerType() { return PV_PLAYER; }
- // make available to PlayerDriver
- void sendEvent(int msg, int ext1=0, int ext2=0) { MediaPlayerBase::sendEvent(msg, ext1, ext2); }
+ // make available to PlayerDriver
+ void sendEvent(int msg, int ext1=0, int ext2=0) { MediaPlayerBase::sendEvent(msg, ext1, ext2); }
private:
static void do_nothing(status_t s, void *cookie, bool cancelled) { }
@@ -62,10 +67,13 @@ private:
char * mDataSourcePath;
bool mIsDataSourceSet;
sp<ISurface> mSurface;
- void * mMemBase;
- off_t mMemSize;
+ int mSharedFd;
status_t mInit;
int mDuration;
+
+#ifdef MAX_OPENCORE_INSTANCES
+ static volatile int32_t sNumInstances;
+#endif
};
}; // namespace android
diff --git a/include/media/ToneGenerator.h b/include/media/ToneGenerator.h
index 0cfdeec..ec64e4d 100644
--- a/include/media/ToneGenerator.h
+++ b/include/media/ToneGenerator.h
@@ -85,8 +85,6 @@ private:
TONE_RESTARTING //
};
- static const unsigned int NUM_PCM_BUFFERS = 2; // Number of AudioTrack pcm buffers
-
static const unsigned int TONEGEN_MAX_WAVES = 3;
static const unsigned int TONEGEN_MAX_SEGMENTS = 4; // Maximun number of elenemts in
static const unsigned int TONEGEN_INF = 0xFFFFFFFF; // Represents infinite time duration
@@ -127,7 +125,6 @@ private:
const ToneDescriptor *mpNewToneDesc; // pointer to next active tone descriptor
int mSamplingRate; // AudioFlinger Sampling rate
- int mBufferSize; // PCM buffer size in frames
AudioTrack *mpAudioTrack; // Pointer to audio track used for playback
Mutex mLock; // Mutex to control concurent access to ToneGenerator object from audio callback and application API
Mutex mCbkCondLock; // Mutex associated to mWaitCbkCond
diff --git a/include/media/mediaplayer.h b/include/media/mediaplayer.h
index 7288445..58906d1 100644
--- a/include/media/mediaplayer.h
+++ b/include/media/mediaplayer.h
@@ -34,11 +34,72 @@ enum media_event_type {
MEDIA_SEEK_COMPLETE = 4,
MEDIA_SET_VIDEO_SIZE = 5,
MEDIA_ERROR = 100,
+ MEDIA_INFO = 200,
};
-typedef int media_error_type;
-const media_error_type MEDIA_ERROR_UNKNOWN = 1;
-const media_error_type MEDIA_ERROR_SERVER_DIED = 100;
+// Generic error codes for the media player framework. Errors are fatal, the
+// playback must abort.
+//
+// Errors are communicated back to the client using the
+// MediaPlayerListener::notify method defined below.
+// In this situation, 'notify' is invoked with the following:
+// 'msg' is set to MEDIA_ERROR.
+// 'ext1' should be a value from the enum media_error_type.
+// 'ext2' contains an implementation dependant error code to provide
+// more details. Should default to 0 when not used.
+//
+// The codes are distributed as follow:
+// 0xx: Reserved
+// 1xx: Android Player errors. Something went wrong inside the MediaPlayer.
+// 2xx: Media errors (e.g Codec not supported). There is a problem with the
+// media itself.
+// 3xx: Runtime errors. Some extraordinary condition arose making the playback
+// impossible.
+//
+enum media_error_type {
+ // 0xx
+ MEDIA_ERROR_UNKNOWN = 1,
+ // 1xx
+ MEDIA_ERROR_SERVER_DIED = 100,
+ // 2xx
+ MEDIA_ERROR_NOT_VALID_FOR_PROGRESSIVE_PLAYBACK = 200,
+ // 3xx
+};
+
+
+// Info and warning codes for the media player framework. These are non fatal,
+// the playback is going on but there might be some user visible issues.
+//
+// Info and warning messages are communicated back to the client using the
+// MediaPlayerListener::notify method defined below. In this situation,
+// 'notify' is invoked with the following:
+// 'msg' is set to MEDIA_INFO.
+// 'ext1' should be a value from the enum media_info_type.
+// 'ext2' contains an implementation dependant error code to provide
+// more details. Should default to 0 when not used.
+//
+// The codes are distributed as follow:
+// 0xx: Reserved
+// 7xx: Android Player info/warning (e.g player lagging behind.)
+// 8xx: Media info/warning (e.g media badly interleaved.)
+//
+enum media_info_type {
+ // 0xx
+ MEDIA_INFO_UNKNOWN = 1,
+ // 7xx
+ // The video is too complex for the decoder: it can't decode frames fast
+ // enough. Possibly only the audio plays fine at this stage.
+ MEDIA_INFO_VIDEO_TRACK_LAGGING = 700,
+ // 8xx
+ // Bad interleaving means that a media has been improperly interleaved or not
+ // interleaved at all, e.g has all the video samples first then all the audio
+ // ones. Video is playing but a lot of disk seek may be happening.
+ MEDIA_INFO_BAD_INTERLEAVING = 800,
+ // The media is not seekable (e.g live stream).
+ MEDIA_INFO_NOT_SEEKABLE = 801,
+};
+
+
enum media_player_states {
MEDIA_PLAYER_STATE_ERROR = 0,
@@ -141,4 +202,3 @@ private:
}; // namespace android
#endif // ANDROID_MEDIAPLAYER_H
-
diff --git a/include/media/mediarecorder.h b/include/media/mediarecorder.h
index a901d32..78d7621 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,34 @@ enum media_recorder_states {
MEDIA_RECORDER_RECORDING = 1 << 4,
};
-class MediaRecorder
+// The "msg" code passed to the listener in notify.
+enum media_recorder_event_type {
+ MEDIA_RECORDER_EVENT_ERROR = 1,
+ MEDIA_RECORDER_EVENT_INFO = 2
+};
+
+enum media_recorder_error_type {
+ MEDIA_RECORDER_ERROR_UNKNOWN = 1
+};
+
+// The codes are distributed as follow:
+// 0xx: Reserved
+// 8xx: General info/warning
+//
+enum media_recorder_info_type {
+ MEDIA_RECORDER_INFO_UNKNOWN = 1,
+ MEDIA_RECORDER_INFO_MAX_DURATION_REACHED = 800
+};
+
+// ----------------------------------------------------------------------------
+// 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();
@@ -102,8 +130,11 @@ public:
status_t setVideoEncoder(int ve);
status_t setAudioEncoder(int ae);
status_t setOutputFile(const char* path);
+ 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 setParameters(const String8& params);
+ status_t setListener(const sp<MediaRecorderListener>& listener);
status_t prepare();
status_t getMaxAmplitude(int* max);
status_t start();
@@ -112,18 +143,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/media/thread_init.h b/include/media/thread_init.h
index 2c0c1f1..2feac86 100644
--- a/include/media/thread_init.h
+++ b/include/media/thread_init.h
@@ -19,7 +19,6 @@
bool InitializeForThread();
void UninitializeForThread();
-void keydestructor(void*);
#endif /* THREAD_INIT_H*/
diff --git a/include/private/opengles/gl_context.h b/include/private/opengles/gl_context.h
index 3056139..0c7ad46 100644
--- a/include/private/opengles/gl_context.h
+++ b/include/private/opengles/gl_context.h
@@ -28,6 +28,7 @@
#include <private/pixelflinger/ggl_context.h>
#include <GLES/gl.h>
+#include <GLES/glext.h>
namespace android {