diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/drm/DrmManagerClient.h | 21 | ||||
-rw-r--r-- | include/drm/drm_framework_common.h | 10 | ||||
-rw-r--r-- | include/media/MemoryLeakTrackUtil.h | 28 | ||||
-rw-r--r-- | include/media/mediametadataretriever.h | 6 | ||||
-rw-r--r-- | include/media/stagefright/DataSource.h | 4 | ||||
-rw-r--r-- | include/media/stagefright/FileSource.h | 6 | ||||
-rw-r--r-- | include/private/hwui/DrawGlInfo.h | 50 |
7 files changed, 109 insertions, 16 deletions
diff --git a/include/drm/DrmManagerClient.h b/include/drm/DrmManagerClient.h index 12142bc..5011137 100644 --- a/include/drm/DrmManagerClient.h +++ b/include/drm/DrmManagerClient.h @@ -69,7 +69,7 @@ public: * @return * Handle for the decryption session */ - DecryptHandle* openDecryptSession(int fd, off64_t offset, off64_t length); + sp<DecryptHandle> openDecryptSession(int fd, off64_t offset, off64_t length); /** * Open the decrypt session to decrypt the given protected content @@ -78,7 +78,7 @@ public: * @return * Handle for the decryption session */ - DecryptHandle* openDecryptSession(const char* uri); + sp<DecryptHandle> openDecryptSession(const char* uri); /** * Close the decrypt session for the given handle @@ -87,7 +87,7 @@ public: * @return status_t * Returns DRM_NO_ERROR for success, DRM_ERROR_UNKNOWN for failure */ - status_t closeDecryptSession(DecryptHandle* decryptHandle); + status_t closeDecryptSession(sp<DecryptHandle> &decryptHandle); /** * Consumes the rights for a content. @@ -101,7 +101,7 @@ public: * Returns DRM_NO_ERROR for success, DRM_ERROR_UNKNOWN for failure. * In case license has been expired, DRM_ERROR_LICENSE_EXPIRED will be returned. */ - status_t consumeRights(DecryptHandle* decryptHandle, int action, bool reserve); + status_t consumeRights(sp<DecryptHandle> &decryptHandle, int action, bool reserve); /** * Informs the DRM engine about the playback actions performed on the DRM files. @@ -113,7 +113,8 @@ public: * @return status_t * Returns DRM_NO_ERROR for success, DRM_ERROR_UNKNOWN for failure */ - status_t setPlaybackStatus(DecryptHandle* decryptHandle, int playbackStatus, int64_t position); + status_t setPlaybackStatus( + sp<DecryptHandle> &decryptHandle, int playbackStatus, int64_t position); /** * Initialize decryption for the given unit of the protected content @@ -125,7 +126,7 @@ public: * Returns DRM_NO_ERROR for success, DRM_ERROR_UNKNOWN for failure */ status_t initializeDecryptUnit( - DecryptHandle* decryptHandle, int decryptUnitId, const DrmBuffer* headerInfo); + sp<DecryptHandle> &decryptHandle, int decryptUnitId, const DrmBuffer* headerInfo); /** * Decrypt the protected content buffers for the given unit @@ -144,7 +145,7 @@ public: * DRM_ERROR_DECRYPT for failure. */ status_t decrypt( - DecryptHandle* decryptHandle, int decryptUnitId, + sp<DecryptHandle> &decryptHandle, int decryptUnitId, const DrmBuffer* encBuffer, DrmBuffer** decBuffer, DrmBuffer* IV = NULL); /** @@ -155,7 +156,8 @@ public: * @return status_t * Returns DRM_NO_ERROR for success, DRM_ERROR_UNKNOWN for failure */ - status_t finalizeDecryptUnit(DecryptHandle* decryptHandle, int decryptUnitId); + status_t finalizeDecryptUnit( + sp<DecryptHandle> &decryptHandle, int decryptUnitId); /** * Reads the specified number of bytes from an open DRM file. @@ -167,7 +169,8 @@ public: * * @return Number of bytes read. Returns -1 for Failure. */ - ssize_t pread(DecryptHandle* decryptHandle, void* buffer, ssize_t numBytes, off64_t offset); + ssize_t pread(sp<DecryptHandle> &decryptHandle, + void* buffer, ssize_t numBytes, off64_t offset); /** * Validates whether an action on the DRM content is allowed or not. diff --git a/include/drm/drm_framework_common.h b/include/drm/drm_framework_common.h index 1758cdd..3ad0330 100644 --- a/include/drm/drm_framework_common.h +++ b/include/drm/drm_framework_common.h @@ -19,6 +19,7 @@ #include <utils/Vector.h> #include <utils/KeyedVector.h> +#include <utils/RefBase.h> #include <utils/String8.h> #include <utils/Errors.h> @@ -240,7 +241,7 @@ public: /** * Defines decryption handle */ -class DecryptHandle { +class DecryptHandle : public RefBase { public: /** * Decryption session Handle @@ -285,10 +286,15 @@ public: decryptId(INVALID_VALUE), mimeType(""), decryptApiType(INVALID_VALUE), - status(INVALID_VALUE) { + status(INVALID_VALUE), + decryptInfo(NULL) { } + ~DecryptHandle() { + delete decryptInfo; decryptInfo = NULL; + } + bool operator<(const DecryptHandle& handle) const { return (decryptId < handle.decryptId); } diff --git a/include/media/MemoryLeakTrackUtil.h b/include/media/MemoryLeakTrackUtil.h new file mode 100644 index 0000000..290b748 --- /dev/null +++ b/include/media/MemoryLeakTrackUtil.h @@ -0,0 +1,28 @@ + +/* + * Copyright 2011, 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 MEMORY_LEAK_TRACK_UTIL_H +#define MEMORY_LEAK_TRACK_UTIL_H + +namespace android { +/* + * Dump the memory adddress of the calling process to the given fd. + */ +extern void dumpMemoryAddresses(int fd); + +}; + +#endif // MEMORY_LEAK_TRACK_UTIL_H diff --git a/include/media/mediametadataretriever.h b/include/media/mediametadataretriever.h index e905006..a5cb949 100644 --- a/include/media/mediametadataretriever.h +++ b/include/media/mediametadataretriever.h @@ -47,6 +47,12 @@ enum { METADATA_KEY_ALBUMARTIST = 13, METADATA_KEY_DISC_NUMBER = 14, METADATA_KEY_COMPILATION = 15, + METADATA_KEY_HAS_AUDIO = 16, + METADATA_KEY_HAS_VIDEO = 17, + METADATA_KEY_VIDEO_WIDTH = 18, + METADATA_KEY_VIDEO_HEIGHT = 19, + METADATA_KEY_BITRATE = 20, + // Add more here... }; diff --git a/include/media/stagefright/DataSource.h b/include/media/stagefright/DataSource.h index f95e56a..d30e908 100644 --- a/include/media/stagefright/DataSource.h +++ b/include/media/stagefright/DataSource.h @@ -75,10 +75,10 @@ public: static void RegisterDefaultSniffers(); // for DRM - virtual DecryptHandle* DrmInitialization() { + virtual sp<DecryptHandle> DrmInitialization() { return NULL; } - virtual void getDrmInfo(DecryptHandle **handle, DrmManagerClient **client) {}; + virtual void getDrmInfo(sp<DecryptHandle> &handle, DrmManagerClient **client) {}; virtual String8 getUri() { return String8(); diff --git a/include/media/stagefright/FileSource.h b/include/media/stagefright/FileSource.h index 51a4343..6cf86dc 100644 --- a/include/media/stagefright/FileSource.h +++ b/include/media/stagefright/FileSource.h @@ -38,9 +38,9 @@ public: virtual status_t getSize(off64_t *size); - virtual DecryptHandle* DrmInitialization(); + virtual sp<DecryptHandle> DrmInitialization(); - virtual void getDrmInfo(DecryptHandle **handle, DrmManagerClient **client); + virtual void getDrmInfo(sp<DecryptHandle> &handle, DrmManagerClient **client); protected: virtual ~FileSource(); @@ -52,7 +52,7 @@ private: Mutex mLock; /*for DRM*/ - DecryptHandle *mDecryptHandle; + sp<DecryptHandle> mDecryptHandle; DrmManagerClient *mDrmManagerClient; int64_t mDrmBufOffset; int64_t mDrmBufSize; diff --git a/include/private/hwui/DrawGlInfo.h b/include/private/hwui/DrawGlInfo.h new file mode 100644 index 0000000..1e9912b --- /dev/null +++ b/include/private/hwui/DrawGlInfo.h @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2011 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_HWUI_DRAW_GL_INFO_H +#define ANDROID_HWUI_DRAW_GL_INFO_H + +namespace android { +namespace uirenderer { + +/** + * Structure used by OpenGLRenderer::callDrawGLFunction() to pass and + * receive data from OpenGL functors. + */ +struct DrawGlInfo { + // Input: current clip rect + int clipLeft; + int clipTop; + int clipRight; + int clipBottom; + + // Input: is the render target an FBO + bool isLayer; + + // Input: current transform matrix, in OpenGL format + float transform[16]; + + // Output: dirty region to redraw + float dirtyLeft; + float dirtyTop; + float dirtyRight; + float dirtyBottom; +}; // struct DrawGlInfo + +}; // namespace uirenderer +}; // namespace android + +#endif // ANDROID_HWUI_DRAW_GL_INFO_H |