summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJeff Tinker <jtinker@google.com>2013-08-26 16:09:03 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-08-26 16:09:03 +0000
commit3bd3690fb0a423f9d0ba635e8db1c148ac9e93fc (patch)
tree4f0325468fd7977d00223a9efa4c4c566125878a /include
parent33142e1e318c0c766a385d88d2434f62f9e2dfe7 (diff)
parent5ff7836da0220b3097f36c8a5e82111816ebca62 (diff)
downloadframeworks_av-3bd3690fb0a423f9d0ba635e8db1c148ac9e93fc.zip
frameworks_av-3bd3690fb0a423f9d0ba635e8db1c148ac9e93fc.tar.gz
frameworks_av-3bd3690fb0a423f9d0ba635e8db1c148ac9e93fc.tar.bz2
Merge "Enhancement for OnInfo callback on DRM Framework" into klp-dev
Diffstat (limited to 'include')
-rw-r--r--include/drm/DrmInfoEvent.h117
1 files changed, 115 insertions, 2 deletions
diff --git a/include/drm/DrmInfoEvent.h b/include/drm/DrmInfoEvent.h
index dfca228..23b2950 100644
--- a/include/drm/DrmInfoEvent.h
+++ b/include/drm/DrmInfoEvent.h
@@ -17,6 +17,8 @@
#ifndef __DRM_INFO_EVENT_H__
#define __DRM_INFO_EVENT_H__
+#include "drm_framework_common.h"
+
namespace android {
class String8;
@@ -71,18 +73,70 @@ public:
public:
/**
- * Constructor for DrmInfoEvent
+ * Constructor for DrmInfoEvent.
+ * Data in drmBuffer are copied to newly allocated buffer.
*
* @param[in] uniqueId Unique session identifier
* @param[in] infoType Type of information
* @param[in] message Message description
+ * @param[in] drmBuffer Binary information
*/
DrmInfoEvent(int uniqueId, int infoType, const String8 message);
+ DrmInfoEvent(int uniqueId, int infoType, const String8 message, const DrmBuffer& drmBuffer);
/**
* Destructor for DrmInfoEvent
*/
- virtual ~DrmInfoEvent() {}
+ ~DrmInfoEvent();
+
+public:
+ /**
+ * Iterator for key
+ */
+ class KeyIterator {
+ friend class DrmInfoEvent;
+
+ private:
+ KeyIterator(const DrmInfoEvent* drmInfoEvent)
+ : mDrmInfoEvent(const_cast <DrmInfoEvent*> (drmInfoEvent)), mIndex(0) {}
+
+ public:
+ KeyIterator(const KeyIterator& keyIterator);
+ KeyIterator& operator=(const KeyIterator& keyIterator);
+ virtual ~KeyIterator() {}
+
+ public:
+ bool hasNext();
+ const String8& next();
+
+ private:
+ DrmInfoEvent* mDrmInfoEvent;
+ unsigned int mIndex;
+ };
+
+ /**
+ * Iterator
+ */
+ class Iterator {
+ friend class DrmInfoEvent;
+
+ private:
+ Iterator(const DrmInfoEvent* drmInfoEvent)
+ : mDrmInfoEvent(const_cast <DrmInfoEvent*> (drmInfoEvent)), mIndex(0) {}
+
+ public:
+ Iterator(const Iterator& iterator);
+ Iterator& operator=(const Iterator& iterator);
+ virtual ~Iterator() {}
+
+ public:
+ bool hasNext();
+ const String8& next();
+
+ private:
+ DrmInfoEvent* mDrmInfoEvent;
+ unsigned int mIndex;
+ };
public:
/**
@@ -106,10 +160,69 @@ public:
*/
const String8 getMessage() const;
+ /**
+ * Returns the number of attributes contained in this instance
+ *
+ * @return Number of attributes
+ */
+ int getCount() const;
+
+ /**
+ * Adds optional information as <key, value> pair to this instance
+ *
+ * @param[in] key Key to add
+ * @param[in] value Value to add
+ * @return Returns the error code
+ */
+ status_t put(const String8& key, String8& value);
+
+ /**
+ * Retrieves the value of given key
+ *
+ * @param key Key whose value to be retrieved
+ * @return The value
+ */
+ const String8 get(const String8& key) const;
+
+ /**
+ * Returns KeyIterator object to walk through the keys associated with this instance
+ *
+ * @return KeyIterator object
+ */
+ KeyIterator keyIterator() const;
+
+ /**
+ * Returns Iterator object to walk through the values associated with this instance
+ *
+ * @return Iterator object
+ */
+ Iterator iterator() const;
+
+ /**
+ * Returns the Binary information associated with this instance
+ *
+ * @return Binary information
+ */
+ const DrmBuffer& getData() const;
+
+ /**
+ * Sets the Binary information associated with this instance.
+ * Data in drmBuffer are copied to newly allocated buffer.
+ *
+ * @param[in] drmBuffer Binary information associated with this instance
+ */
+ void setData(const DrmBuffer& drmBuffer);
+
+private:
+ DrmInfoEvent(const DrmInfoEvent& ref);
+ const DrmInfoEvent& operator=(const DrmInfoEvent& ref);
+
private:
int mUniqueId;
int mInfoType;
const String8 mMessage;
+ KeyedVector<String8, String8> mAttributes;
+ DrmBuffer mDrmBuffer;
};
};