summaryrefslogtreecommitdiffstats
path: root/include/hardware/hdmi_cec.h
diff options
context:
space:
mode:
authorJinsuk Kim <jinsukkim@google.com>2014-03-06 19:25:19 +0900
committerJinsuk Kim <jinsukkim@google.com>2014-03-08 06:15:49 +0900
commit70ae777c9abd054cd47f1dcad2c79ba0ce900a39 (patch)
treed1682d169f2b5fa691f42ab4d93dd1c5ce48f037 /include/hardware/hdmi_cec.h
parent5f9a7907844ba5319957dd9913ef951d78709afb (diff)
downloadhardware_libhardware-70ae777c9abd054cd47f1dcad2c79ba0ce900a39.zip
hardware_libhardware-70ae777c9abd054cd47f1dcad2c79ba0ce900a39.tar.gz
hardware_libhardware-70ae777c9abd054cd47f1dcad2c79ba0ce900a39.tar.bz2
[HDMI-CEC] Modify the signature of register_event_callback
Additional parameter helps the caller avoid managing a static instance variable. The parameter is used to pass the caller object itself. Change-Id: I06cbcc7736031678f4638a0b5082d7b6a7ea51b6
Diffstat (limited to 'include/hardware/hdmi_cec.h')
-rw-r--r--include/hardware/hdmi_cec.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/include/hardware/hdmi_cec.h b/include/hardware/hdmi_cec.h
index 938e9dc..5b3b1af 100644
--- a/include/hardware/hdmi_cec.h
+++ b/include/hardware/hdmi_cec.h
@@ -194,7 +194,7 @@ typedef struct hdmi_event {
* Callback function type that will be called by HAL implementation.
* Services can not close/open the device in the callback.
*/
-typedef void (*event_callback_t)(const hdmi_event_t* event);
+typedef void (*event_callback_t)(const hdmi_event_t* event, void* arg);
typedef struct hdmi_cec_module {
struct hw_module_t common;
@@ -214,7 +214,6 @@ typedef struct hdmi_cec_device {
* is not successful the addr will be set to CEC_ADDR_UNREGISTERED.
*
* Returns 0 on success or -errno on error.
- *
*/
int (*allocate_logical_address)(const struct hdmi_cec_device* dev,
int device_type, cec_logical_address_t* addr);
@@ -238,14 +237,17 @@ typedef struct hdmi_cec_device {
* Returns 0 on success or -errno on error.
*/
int (*send_message)(const struct hdmi_cec_device* dev,
- const cec_message_t *);
+ const cec_message_t*);
/*
* (*register_event_callback)() registers a callback that HDMI-CEC HAL
* can later use for incoming CEC messages or internal HDMI events.
+ * When calling from C++, use the argument arg to pass the calling object.
+ * It will be passed back when the callback is invoked so that the context
+ * can be retrieved.
*/
void (*register_event_callback)(const struct hdmi_cec_device* dev,
- event_callback_t callback);
+ event_callback_t callback, void* arg);
/*
* (*get_version)() returns the CEC version supported by underlying