summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/camera/ICameraService.h7
-rw-r--r--include/camera/ICameraServiceListener.h24
-rw-r--r--include/media/AudioSystem.h2
-rw-r--r--include/media/IAudioPolicyService.h3
-rw-r--r--include/media/IMediaPlayer.h1
-rw-r--r--include/media/IOMX.h1
-rw-r--r--include/media/MediaPlayerInterface.h1
-rw-r--r--include/media/mediaplayer.h2
-rw-r--r--include/media/stagefright/ACodec.h1
-rw-r--r--include/media/stagefright/MPEG4Writer.h12
-rw-r--r--include/media/stagefright/MediaCodec.h2
-rw-r--r--include/media/stagefright/foundation/AHandler.h7
-rw-r--r--include/media/stagefright/foundation/ALooperRoster.h3
-rw-r--r--include/media/stagefright/foundation/AWakeLock.h68
14 files changed, 130 insertions, 4 deletions
diff --git a/include/camera/ICameraService.h b/include/camera/ICameraService.h
index f7f06bb..cc41efe 100644
--- a/include/camera/ICameraService.h
+++ b/include/camera/ICameraService.h
@@ -53,6 +53,7 @@ public:
GET_LEGACY_PARAMETERS,
SUPPORTS_CAMERA_API,
CONNECT_LEGACY,
+ SET_TORCH_MODE,
};
enum {
@@ -142,6 +143,12 @@ public:
int clientUid,
/*out*/
sp<ICamera>& device) = 0;
+
+ /**
+ * Turn on or off a camera's torch mode.
+ */
+ virtual status_t setTorchMode(const String16& cameraId, bool enabled,
+ const sp<IBinder>& clientBinder) = 0;
};
// ----------------------------------------------------------------------------
diff --git a/include/camera/ICameraServiceListener.h b/include/camera/ICameraServiceListener.h
index 0a0e43a..9e8b912 100644
--- a/include/camera/ICameraServiceListener.h
+++ b/include/camera/ICameraServiceListener.h
@@ -66,9 +66,33 @@ public:
STATUS_UNKNOWN = 0xFFFFFFFF,
};
+ /**
+ * The torch mode status of a camera.
+ *
+ * Initial status will be transmitted with onTorchStatusChanged immediately
+ * after this listener is added to the service listener list.
+ */
+ enum TorchStatus {
+ // The camera's torch mode has become available to use via
+ // setTorchMode().
+ TORCH_STATUS_AVAILABLE = TORCH_MODE_STATUS_AVAILABLE,
+ // The camera's torch mode has become not available to use via
+ // setTorchMode().
+ TORCH_STATUS_NOT_AVAILABLE = TORCH_MODE_STATUS_RESOURCE_BUSY,
+ // The camera's torch mode has been turned off by setTorchMode().
+ TORCH_STATUS_OFF = TORCH_MODE_STATUS_OFF,
+ // The camera's torch mode has been turned on by setTorchMode().
+ TORCH_STATUS_ON = 0x80000000,
+
+ // Use to initialize variables only
+ TORCH_STATUS_UNKNOWN = 0xFFFFFFFF,
+ };
+
DECLARE_META_INTERFACE(CameraServiceListener);
virtual void onStatusChanged(Status status, int32_t cameraId) = 0;
+
+ virtual void onTorchStatusChanged(TorchStatus status, const String16& cameraId) = 0;
};
// ----------------------------------------------------------------------------
diff --git a/include/media/AudioSystem.h b/include/media/AudioSystem.h
index 843a354..2ab3dd6 100644
--- a/include/media/AudioSystem.h
+++ b/include/media/AudioSystem.h
@@ -201,7 +201,7 @@ public:
// IAudioPolicyService interface (see AudioPolicyInterface for method descriptions)
//
static status_t setDeviceConnectionState(audio_devices_t device, audio_policy_dev_state_t state,
- const char *device_address);
+ const char *device_address, const char *device_name);
static audio_policy_dev_state_t getDeviceConnectionState(audio_devices_t device,
const char *device_address);
static status_t setPhoneState(audio_mode_t state);
diff --git a/include/media/IAudioPolicyService.h b/include/media/IAudioPolicyService.h
index c98c475..fecc6f1 100644
--- a/include/media/IAudioPolicyService.h
+++ b/include/media/IAudioPolicyService.h
@@ -44,7 +44,8 @@ public:
//
virtual status_t setDeviceConnectionState(audio_devices_t device,
audio_policy_dev_state_t state,
- const char *device_address) = 0;
+ const char *device_address,
+ const char *device_name) = 0;
virtual audio_policy_dev_state_t getDeviceConnectionState(audio_devices_t device,
const char *device_address) = 0;
virtual status_t setPhoneState(audio_mode_t state) = 0;
diff --git a/include/media/IMediaPlayer.h b/include/media/IMediaPlayer.h
index db62cd5..4153c25 100644
--- a/include/media/IMediaPlayer.h
+++ b/include/media/IMediaPlayer.h
@@ -56,6 +56,7 @@ public:
virtual status_t stop() = 0;
virtual status_t pause() = 0;
virtual status_t isPlaying(bool* state) = 0;
+ virtual status_t setPlaybackRate(float rate) = 0;
virtual status_t seekTo(int msec) = 0;
virtual status_t getCurrentPosition(int* msec) = 0;
virtual status_t getDuration(int* msec) = 0;
diff --git a/include/media/IOMX.h b/include/media/IOMX.h
index 627f23b..6def65b 100644
--- a/include/media/IOMX.h
+++ b/include/media/IOMX.h
@@ -147,6 +147,7 @@ public:
INTERNAL_OPTION_SUSPEND, // data is a bool
INTERNAL_OPTION_REPEAT_PREVIOUS_FRAME_DELAY, // data is an int64_t
INTERNAL_OPTION_MAX_TIMESTAMP_GAP, // data is int64_t
+ INTERNAL_OPTION_MAX_FPS, // data is float
INTERNAL_OPTION_START_TIME, // data is an int64_t
INTERNAL_OPTION_TIME_LAPSE, // data is an int64_t[2]
};
diff --git a/include/media/MediaPlayerInterface.h b/include/media/MediaPlayerInterface.h
index 4a6bf28..482b85f 100644
--- a/include/media/MediaPlayerInterface.h
+++ b/include/media/MediaPlayerInterface.h
@@ -156,6 +156,7 @@ public:
virtual status_t stop() = 0;
virtual status_t pause() = 0;
virtual bool isPlaying() = 0;
+ virtual status_t setPlaybackRate(float rate) { return INVALID_OPERATION; }
virtual status_t seekTo(int msec) = 0;
virtual status_t getCurrentPosition(int *msec) = 0;
virtual status_t getDuration(int *msec) = 0;
diff --git a/include/media/mediaplayer.h b/include/media/mediaplayer.h
index 5830933..808e893 100644
--- a/include/media/mediaplayer.h
+++ b/include/media/mediaplayer.h
@@ -220,6 +220,7 @@ public:
status_t stop();
status_t pause();
bool isPlaying();
+ status_t setPlaybackRate(float rate);
status_t getVideoWidth(int *w);
status_t getVideoHeight(int *h);
status_t seekTo(int msec);
@@ -274,6 +275,7 @@ private:
int mVideoWidth;
int mVideoHeight;
int mAudioSessionId;
+ float mPlaybackRate;
float mSendLevel;
struct sockaddr_in mRetransmitEndpoint;
bool mRetransmitEndpointValid;
diff --git a/include/media/stagefright/ACodec.h b/include/media/stagefright/ACodec.h
index 595ace8..442c861 100644
--- a/include/media/stagefright/ACodec.h
+++ b/include/media/stagefright/ACodec.h
@@ -214,6 +214,7 @@ private:
int64_t mRepeatFrameDelayUs;
int64_t mMaxPtsGapUs;
+ float mMaxFps;
int64_t mTimePerFrameUs;
int64_t mTimePerCaptureUs;
diff --git a/include/media/stagefright/MPEG4Writer.h b/include/media/stagefright/MPEG4Writer.h
index 899b324..a195fe8 100644
--- a/include/media/stagefright/MPEG4Writer.h
+++ b/include/media/stagefright/MPEG4Writer.h
@@ -26,6 +26,7 @@
namespace android {
+class AMessage;
class MediaBuffer;
class MediaSource;
class MetaData;
@@ -48,6 +49,7 @@ public:
virtual status_t dump(int fd, const Vector<String16>& args);
void beginBox(const char *fourcc);
+ void beginBox(uint32_t id);
void writeInt8(int8_t x);
void writeInt16(int16_t x);
void writeInt32(int32_t x);
@@ -62,6 +64,7 @@ public:
int32_t getTimeScale() const { return mTimeScale; }
status_t setGeoData(int latitudex10000, int longitudex10000);
+ status_t setCaptureRate(float captureFps);
virtual void setStartTimeOffsetMs(int ms) { mStartTimeOffsetMs = ms; }
virtual int32_t getStartTimeOffsetMs() const { return mStartTimeOffsetMs; }
@@ -88,6 +91,7 @@ private:
off64_t mFreeBoxOffset;
bool mStreamableFile;
off64_t mEstimatedMoovBoxSize;
+ off64_t mMoovExtraSize;
uint32_t mInterleaveDurationUs;
int32_t mTimeScale;
int64_t mStartTimestampUs;
@@ -102,6 +106,8 @@ private:
List<off64_t> mBoxes;
+ sp<AMessage> mMetaKeys;
+
void setStartTimestampUs(int64_t timeUs);
int64_t getStartTimestampUs(); // Not const
status_t startTracks(MetaData *params);
@@ -195,6 +201,12 @@ private:
void writeGeoDataBox();
void writeLatitude(int degreex10000);
void writeLongitude(int degreex10000);
+
+ void addDeviceMeta();
+ void writeHdlr();
+ void writeKeys();
+ void writeIlst();
+ void writeMetaBox();
void sendSessionSummary();
void release();
status_t reset();
diff --git a/include/media/stagefright/MediaCodec.h b/include/media/stagefright/MediaCodec.h
index 54a4e8b..d448097 100644
--- a/include/media/stagefright/MediaCodec.h
+++ b/include/media/stagefright/MediaCodec.h
@@ -194,7 +194,7 @@ private:
};
enum {
- kFlagIsSoftwareCodec = 1,
+ kFlagUsesSoftwareRenderer = 1,
kFlagOutputFormatChanged = 2,
kFlagOutputBuffersChanged = 4,
kFlagStickyError = 8,
diff --git a/include/media/stagefright/foundation/AHandler.h b/include/media/stagefright/foundation/AHandler.h
index b008b54..41ade77 100644
--- a/include/media/stagefright/foundation/AHandler.h
+++ b/include/media/stagefright/foundation/AHandler.h
@@ -19,6 +19,7 @@
#define A_HANDLER_H_
#include <media/stagefright/foundation/ALooper.h>
+#include <utils/KeyedVector.h>
#include <utils/RefBase.h>
namespace android {
@@ -27,7 +28,8 @@ struct AMessage;
struct AHandler : public RefBase {
AHandler()
- : mID(0) {
+ : mID(0),
+ mMessageCounter(0) {
}
ALooper::handler_id id() const {
@@ -48,6 +50,9 @@ private:
mID = id;
}
+ uint32_t mMessageCounter;
+ KeyedVector<uint32_t, uint32_t> mMessages;
+
DISALLOW_EVIL_CONSTRUCTORS(AHandler);
};
diff --git a/include/media/stagefright/foundation/ALooperRoster.h b/include/media/stagefright/foundation/ALooperRoster.h
index 4d76b64..a0be8eb 100644
--- a/include/media/stagefright/foundation/ALooperRoster.h
+++ b/include/media/stagefright/foundation/ALooperRoster.h
@@ -20,6 +20,7 @@
#include <media/stagefright/foundation/ALooper.h>
#include <utils/KeyedVector.h>
+#include <utils/String16.h>
namespace android {
@@ -42,6 +43,8 @@ struct ALooperRoster {
sp<ALooper> findLooper(ALooper::handler_id handlerID);
+ void dump(int fd, const Vector<String16>& args);
+
private:
struct HandlerInfo {
wp<ALooper> mLooper;
diff --git a/include/media/stagefright/foundation/AWakeLock.h b/include/media/stagefright/foundation/AWakeLock.h
new file mode 100644
index 0000000..57716c1
--- /dev/null
+++ b/include/media/stagefright/foundation/AWakeLock.h
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2015 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 A_WAKELOCK_H_
+#define A_WAKELOCK_H_
+
+#include <media/stagefright/foundation/ABase.h>
+#include <powermanager/IPowerManager.h>
+#include <utils/RefBase.h>
+
+namespace android {
+
+class AWakeLock : public RefBase {
+
+public:
+ AWakeLock();
+
+ // NOTE: acquire and release are not thread safe
+
+ // returns true if wakelock was acquired
+ bool acquire();
+ void release(bool force = false);
+
+ virtual ~AWakeLock();
+
+private:
+ sp<IPowerManager> mPowerManager;
+ sp<IBinder> mWakeLockToken;
+ uint32_t mWakeLockCount;
+
+ class PMDeathRecipient : public IBinder::DeathRecipient {
+ public:
+ PMDeathRecipient(AWakeLock *wakeLock) : mWakeLock(wakeLock) {}
+ virtual ~PMDeathRecipient() {}
+
+ // IBinder::DeathRecipient
+ virtual void binderDied(const wp<IBinder> &who);
+
+ private:
+ PMDeathRecipient(const PMDeathRecipient&);
+ PMDeathRecipient& operator= (const PMDeathRecipient&);
+
+ AWakeLock *mWakeLock;
+ };
+
+ const sp<PMDeathRecipient> mDeathRecipient;
+
+ void clearPowerManager();
+
+ DISALLOW_EVIL_CONSTRUCTORS(AWakeLock);
+};
+
+} // namespace android
+
+#endif // A_WAKELOCK_H_