summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/media/IHDCP.h78
-rw-r--r--include/media/IMediaPlayerService.h2
-rw-r--r--include/media/stagefright/ACodec.h11
-rw-r--r--include/media/stagefright/AudioSource.h19
4 files changed, 105 insertions, 5 deletions
diff --git a/include/media/IHDCP.h b/include/media/IHDCP.h
new file mode 100644
index 00000000..a0613c7a
--- /dev/null
+++ b/include/media/IHDCP.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (C) 2012 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.
+ */
+
+#include <binder/IInterface.h>
+#include <media/hardware/HDCPAPI.h>
+#include <media/stagefright/foundation/ABase.h>
+
+namespace android {
+
+struct IHDCPObserver : public IInterface {
+ DECLARE_META_INTERFACE(HDCPObserver);
+
+ virtual void notify(
+ int msg, int ext1, int ext2, const Parcel *obj) = 0;
+
+private:
+ DISALLOW_EVIL_CONSTRUCTORS(IHDCPObserver);
+};
+
+struct IHDCP : public IInterface {
+ DECLARE_META_INTERFACE(HDCP);
+
+ // Called to specify the observer that receives asynchronous notifications
+ // from the HDCP implementation to signal completion/failure of asynchronous
+ // operations (such as initialization) or out of band events.
+ virtual status_t setObserver(const sp<IHDCPObserver> &observer) = 0;
+
+ // Request to setup an HDCP session with the specified host listening
+ // on the specified port.
+ virtual status_t initAsync(const char *host, unsigned port) = 0;
+
+ // Request to shutdown the active HDCP session.
+ virtual status_t shutdownAsync() = 0;
+
+ // Encrypt a data according to the HDCP spec. The data is to be
+ // encrypted in-place, only size bytes of data should be read/write,
+ // even if the size is not a multiple of 128 bit (16 bytes).
+ // This operation is to be synchronous, i.e. this call does not return
+ // until outData contains size bytes of encrypted data.
+ // streamCTR will be assigned by the caller (to 0 for the first PES stream,
+ // 1 for the second and so on)
+ // inputCTR will be maintained by the callee for each PES stream.
+ virtual status_t encrypt(
+ const void *inData, size_t size, uint32_t streamCTR,
+ uint64_t *outInputCTR, void *outData) = 0;
+
+private:
+ DISALLOW_EVIL_CONSTRUCTORS(IHDCP);
+};
+
+struct BnHDCPObserver : public BnInterface<IHDCPObserver> {
+ virtual status_t onTransact(
+ uint32_t code, const Parcel &data, Parcel *reply,
+ uint32_t flags = 0);
+};
+
+struct BnHDCP : public BnInterface<IHDCP> {
+ virtual status_t onTransact(
+ uint32_t code, const Parcel &data, Parcel *reply,
+ uint32_t flags = 0);
+};
+
+} // namespace android
+
+
diff --git a/include/media/IMediaPlayerService.h b/include/media/IMediaPlayerService.h
index 76c45a02..dbcdf927 100644
--- a/include/media/IMediaPlayerService.h
+++ b/include/media/IMediaPlayerService.h
@@ -50,6 +50,8 @@ public:
virtual sp<IOMX> getOMX() = 0;
virtual sp<ICrypto> makeCrypto() = 0;
+ virtual status_t enableRemoteDisplay(bool enable) = 0;
+
// codecs and audio devices usage tracking for the battery app
enum BatteryDataBits {
// tracking audio codec
diff --git a/include/media/stagefright/ACodec.h b/include/media/stagefright/ACodec.h
index 2371619b..500dde6b 100644
--- a/include/media/stagefright/ACodec.h
+++ b/include/media/stagefright/ACodec.h
@@ -25,6 +25,8 @@
#include <media/stagefright/SkipCutBuffer.h>
#include <OMX_Audio.h>
+#define TRACK_BUFFER_TIMING 0
+
namespace android {
struct ABuffer;
@@ -127,6 +129,15 @@ private:
sp<GraphicBuffer> mGraphicBuffer;
};
+#if TRACK_BUFFER_TIMING
+ struct BufferStats {
+ int64_t mEmptyBufferTimeUs;
+ int64_t mFillBufferDoneTimeUs;
+ };
+
+ KeyedVector<int64_t, BufferStats> mBufferStats;
+#endif
+
sp<AMessage> mNotify;
sp<UninitializedState> mUninitializedState;
diff --git a/include/media/stagefright/AudioSource.h b/include/media/stagefright/AudioSource.h
index f5466e80..de7edf39 100644
--- a/include/media/stagefright/AudioSource.h
+++ b/include/media/stagefright/AudioSource.h
@@ -31,11 +31,12 @@ namespace android {
class AudioRecord;
struct AudioSource : public MediaSource, public MediaBufferObserver {
- // Note that the "channels" parameter is _not_ the number of channels,
- // but a bitmask of audio_channels_t constants.
+ // Note that the "channels" parameter _is_ the number of channels,
+ // _not_ a bitmask of audio_channels_t constants.
AudioSource(
- audio_source_t inputSource, uint32_t sampleRate,
- uint32_t channels = AUDIO_CHANNEL_IN_MONO);
+ audio_source_t inputSource,
+ uint32_t sampleRate,
+ uint32_t channels = 1);
status_t initCheck() const;
@@ -49,9 +50,15 @@ struct AudioSource : public MediaSource, public MediaBufferObserver {
virtual status_t read(
MediaBuffer **buffer, const ReadOptions *options = NULL);
- status_t dataCallbackTimestamp(const AudioRecord::Buffer& buffer, int64_t timeUs);
+ status_t dataCallback(const AudioRecord::Buffer& buffer);
virtual void signalBufferReturned(MediaBuffer *buffer);
+ // If useLooperTime == true, buffers will carry absolute timestamps
+ // as returned by ALooper::GetNowUs(), otherwise systemTime() is used
+ // and buffers contain timestamps relative to start time.
+ // The default is to _not_ use looper time.
+ void setUseLooperTime(bool useLooperTime);
+
protected:
virtual ~AudioSource();
@@ -87,6 +94,8 @@ private:
List<MediaBuffer * > mBuffersReceived;
+ bool mUseLooperTime;
+
void trackMaxAmplitude(int16_t *data, int nSamples);
// This is used to raise the volume from mute to the