summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorphintuka <phintuka>2010-06-13 20:07:06 +0000
committerphintuka <phintuka>2010-06-13 20:07:06 +0000
commit715cc11548878ed103f42bd0be378459806d98cf (patch)
tree48ece27baba5fa4e208221a638d8bfd0a4c031f1
parent671ce4d6daecdee6995bfc625808b3793521109d (diff)
downloadxineliboutput-715cc11548878ed103f42bd0be378459806d98cf.tar.gz
xineliboutput-715cc11548878ed103f42bd0be378459806d98cf.tar.bz2
Added angle change support
-rw-r--r--xine/BluRay/input_bluray.c46
1 files changed, 46 insertions, 0 deletions
diff --git a/xine/BluRay/input_bluray.c b/xine/BluRay/input_bluray.c
index 92a3c4f3..7bec3859 100644
--- a/xine/BluRay/input_bluray.c
+++ b/xine/BluRay/input_bluray.c
@@ -93,7 +93,10 @@ typedef struct {
input_plugin_t input_plugin;
xine_stream_t *stream;
+ xine_event_queue_t *event_queue;
+
bluray_input_class_t *class;
+
char *mrl;
char *disc_root;
@@ -138,6 +141,42 @@ static int open_title (bluray_input_plugin_t *this, int title)
return 1;
}
+static void handle_events(bluray_input_plugin_t *this)
+{
+ if (!this->event_queue)
+ return;
+
+ xine_event_t *event;
+ while (NULL != (event = xine_event_get(this->event_queue))) {
+
+ if (!this->bdh || !this->bdh->title) {
+ xine_event_free(event);
+ return;
+ }
+
+ switch (event->type) {
+
+ case XINE_EVENT_INPUT_ANGLE_NEXT: {
+ int angle = MIN(8, this->bdh->angle - 1);
+ lprintf("XINE_EVENT_INPUT_ANGLE_NEXT: set angle %d --> %d\n", this->bdh->angle, angle);
+ bd_seamless_angle_change(this->bdh, angle);
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_DVD_ANGLE_NUMBER, angle);
+ break;
+ }
+
+ case XINE_EVENT_INPUT_ANGLE_PREVIOUS: {
+ int angle = MAX(0, this->bdh->angle - 1);
+ lprintf("XINE_EVENT_INPUT_ANGLE_PREVIOUS: set angle %d --> %d\n", this->bdh->angle, angle);
+ bd_seamless_angle_change(this->bdh, angle);
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_DVD_ANGLE_NUMBER, angle);
+ break;
+ }
+ }
+
+ xine_event_free(event);
+ }
+}
+
/*
* xine plugin interface
*/
@@ -157,6 +196,8 @@ static off_t bluray_plugin_read (input_plugin_t *this_gen, char *buf, off_t len)
if (!this || !this->bdh || len < 0)
return -1;
+ handle_events(this);
+
off_t result = bd_read (this->bdh, (unsigned char *)buf, len);
if (result < 0)
@@ -326,6 +367,9 @@ static void bluray_plugin_dispose (input_plugin_t *this_gen)
{
bluray_input_plugin_t *this = (bluray_input_plugin_t *) this_gen;
+ if (this->event_queue)
+ xine_event_dispose_queue(this->event_queue);
+
if (this->bdh)
bd_close(this->bdh);
@@ -469,6 +513,8 @@ static input_plugin_t *bluray_class_get_instance (input_class_t *cls_gen, xine_s
this->input_plugin.dispose = bluray_plugin_dispose;
this->input_plugin.input_class = cls_gen;
+ this->event_queue = xine_event_new_queue (this->stream);
+
return &this->input_plugin;
}