[libbluray-devel] Added bd_select_stream()

hpi1 git at videolan.org
Wed Jun 19 15:21:16 CEST 2013


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Wed Jun 19 15:43:34 2013 +0300| [89dae5a6e7f5411dd056c4d87df90efd3f988d19] | committer: hpi1

Added bd_select_stream()

> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=89dae5a6e7f5411dd056c4d87df90efd3f988d19
---

 src/libbluray/bluray.c |   22 ++++++++++++++++++++++
 src/libbluray/bluray.h |   17 +++++++++++++++++
 2 files changed, 39 insertions(+)

diff --git a/src/libbluray/bluray.c b/src/libbluray/bluray.c
index bca1e48..f3cafc9 100644
--- a/src/libbluray/bluray.c
+++ b/src/libbluray/bluray.c
@@ -2549,6 +2549,28 @@ int bd_set_player_setting_str(BLURAY *bd, uint32_t idx, const char *s)
     }
 }
 
+void bd_select_stream(BLURAY *bd, uint32_t stream_type, uint32_t stream_id, uint32_t enable_flag)
+{
+    uint32_t val;
+
+    bd_mutex_lock(&bd->mutex);
+    bd_psr_lock(bd->regs);
+
+    switch (stream_type) {
+        case BLURAY_PG_TEXTST_STREAM:
+            val = bd_psr_read(bd->regs, PSR_PG_STREAM);
+            bd_psr_write(bd->regs, PSR_PG_STREAM, ((!!enable_flag)<<31) | (stream_id & 0xfff) | (val & 0x7ffff000));
+            break;
+        /*
+        case BLURAY_SECONDARY_VIDEO_STREAM:
+        case BLURAY_SECONDARY_AUDIO_STREAM:
+        */
+    }
+
+    bd_psr_unlock(bd->regs);
+    bd_mutex_unlock(&bd->mutex);
+}
+
 /*
  * BD-J testing
  */
diff --git a/src/libbluray/bluray.h b/src/libbluray/bluray.h
index 8a702ff..05b6c0a 100644
--- a/src/libbluray/bluray.h
+++ b/src/libbluray/bluray.h
@@ -431,6 +431,23 @@ uint64_t bd_tell(BLURAY *bd);
  */
 uint64_t bd_tell_time(BLURAY *bd);
 
+/**
+ *
+ *  Select stream (PG / TextST track)
+ *
+ *  This function can be used to override automatic stream selection.
+ *  Selecting the stream is useful only when using libbluray internal decoders
+ *  or stream is stored in a sub-path.
+ *
+ * @param bd  BLURAY object
+ * @param stream_type  BLURAY_*_STREAM
+ * @param stream_id  stream number (1..N)
+ * @param enable_flag  set to 0 to disable streams of this type
+ */
+#define BLURAY_PG_TEXTST_STREAM  1
+
+void bd_select_stream(BLURAY *bd, uint32_t stream_type, uint32_t stream_id, uint32_t enable_flag);
+
 /*
  * Disc info
  */



More information about the libbluray-devel mailing list