1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87
|
From 8305696be79fe650d3d9eee29b2a88e020d7c58f Mon Sep 17 00:00:00 2001
From: Voyager1 <voyager@xbmc.org>
Date: Sun, 14 Feb 2016 17:15:56 +0100
Subject: [PATCH 02/10] [xbmc][dvdnav] expose dvdnav_get_vm,
dvdnav_get_button_info, dvdnav_free
---
src/dvdnav.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++
src/dvdnav/dvdnav.h | 1 +
2 files changed, 53 insertions(+)
diff --git a/src/dvdnav.c b/src/dvdnav.c
index ae267d5..39c11dd 100644
--- a/libdvdnav-5-0-3/src/dvdnav.c
+++ b/libdvdnav-5-0-3/src/dvdnav.c
@@ -1273,3 +1273,55 @@ user_ops_t dvdnav_get_restrictions(dvdnav_t* this) {
return ops.ops_struct;
}
+
+#ifdef _XBMC
+
+vm_t* dvdnav_get_vm(dvdnav_t *this) {
+ if (!this) return 0;
+ return this->vm;
+}
+
+/* return the alpha and color for the current active button
+ * color, alpha [0][] = selection
+ * color, alpha = color
+ *
+ * argsize = [2][4]
+ */
+int dvdnav_get_button_info(dvdnav_t* this, int alpha[2][4], int color[2][4])
+{
+ int current_button, current_button_color, i;
+ pci_t* pci;
+
+ if (!this) return -1;
+
+ pci = dvdnav_get_current_nav_pci(this);
+ if (!pci) return -1;
+
+ dvdnav_get_current_highlight(this, ¤t_button);
+ current_button_color = pci->hli.btnit[current_button - 1].btn_coln;
+
+ for (i = 0; i < 2; i++)
+ {
+ alpha[i][0] = pci->hli.btn_colit.btn_coli[current_button_color - 1][i] >> 0 & 0xf;
+ alpha[i][1] = pci->hli.btn_colit.btn_coli[current_button_color - 1][i] >> 4 & 0xf;
+ alpha[i][2] = pci->hli.btn_colit.btn_coli[current_button_color - 1][i] >> 8 & 0xf;
+ alpha[i][3] = pci->hli.btn_colit.btn_coli[current_button_color - 1][i] >> 12 & 0xf;
+
+ color[i][0] = pci->hli.btn_colit.btn_coli[current_button_color - 1][i] >> 16 & 0xf;
+ color[i][1] = pci->hli.btn_colit.btn_coli[current_button_color - 1][i] >> 20 & 0xf;
+ color[i][2] = pci->hli.btn_colit.btn_coli[current_button_color - 1][i] >> 24 & 0xf;
+ color[i][3] = pci->hli.btn_colit.btn_coli[current_button_color - 1][i] >> 28 & 0xf;
+ }
+
+ return 0;
+}
+
+void dvdnav_free(void* pdata)
+{
+ free(pdata);
+}
+
+#undef printerr
+#define printerr(str) strncpy(self->err_str, str, MAX_ERR_LEN);
+
+#endif // _XBMC
\ No newline at end of file
diff --git a/src/dvdnav/dvdnav.h b/src/dvdnav/dvdnav.h
index 8d68102..9f82b0f 100644
--- a/libdvdnav-5-0-3/src/dvdnav/dvdnav.h
+++ b/libdvdnav-5-0-3/src/dvdnav/dvdnav.h
@@ -699,6 +699,7 @@ int8_t dvdnav_is_domain_vtsm(dvdnav_t *self);
*/
int8_t dvdnav_is_domain_vts(dvdnav_t *self);
+void dvdnav_free(void* pdata);
#ifdef __cplusplus
}
--
2.1.4
|