[libbluray-devel] Added return value to gc_decode_ts()

hpi1 git at videolan.org
Fri Jun 10 14:13:05 CEST 2011


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Fri Jun 10 15:10:39 2011 +0300| [c8a3130f9ba53973f83846a30169aae873057d5a] | committer: hpi1

Added return value to gc_decode_ts()

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

 src/libbluray/decoders/graphics_controller.c |   14 ++++++++++----
 src/libbluray/decoders/graphics_controller.h |   15 +++++++++++----
 2 files changed, 21 insertions(+), 8 deletions(-)

diff --git a/src/libbluray/decoders/graphics_controller.c b/src/libbluray/decoders/graphics_controller.c
index ec05ee4..dd3109c 100644
--- a/src/libbluray/decoders/graphics_controller.c
+++ b/src/libbluray/decoders/graphics_controller.c
@@ -367,11 +367,11 @@ void gc_free(GRAPHICS_CONTROLLER **p)
  * graphics stream input
  */
 
-void gc_decode_ts(GRAPHICS_CONTROLLER *gc, uint16_t pid, uint8_t *block, unsigned num_blocks, int64_t stc)
+int gc_decode_ts(GRAPHICS_CONTROLLER *gc, uint16_t pid, uint8_t *block, unsigned num_blocks, int64_t stc)
 {
     if (!gc) {
         GC_TRACE("gc_decode_ts(): no graphics controller\n");
-        return;
+        return -1;
     }
 
     if (pid >= 0x1400 && pid < 0x1500) {
@@ -388,7 +388,7 @@ void gc_decode_ts(GRAPHICS_CONTROLLER *gc, uint16_t pid, uint8_t *block, unsigne
                                      stc);
         if (!gc->igs || !gc->igs->complete) {
             bd_mutex_unlock(&gc->mutex);
-            return;
+            return 0;
         }
 
         gc->popup_visible = 0;
@@ -396,6 +396,8 @@ void gc_decode_ts(GRAPHICS_CONTROLLER *gc, uint16_t pid, uint8_t *block, unsigne
         _select_page(gc, 0);
 
         bd_mutex_unlock(&gc->mutex);
+
+        return 1;
     }
 
     else if (pid >= 0x1200 && pid < 0x1300) {
@@ -408,9 +410,13 @@ void gc_decode_ts(GRAPHICS_CONTROLLER *gc, uint16_t pid, uint8_t *block, unsigne
                                      stc);
 
         if (!gc->pgs || !gc->pgs->complete) {
-            return;
+            return 0;
         }
+
+        return 1;
     }
+
+    return -1;
 }
 
 /*
diff --git a/src/libbluray/decoders/graphics_controller.h b/src/libbluray/decoders/graphics_controller.h
index 30ef627..33efdd2 100644
--- a/src/libbluray/decoders/graphics_controller.h
+++ b/src/libbluray/decoders/graphics_controller.h
@@ -75,11 +75,18 @@ BD_PRIVATE GRAPHICS_CONTROLLER *gc_init(struct bd_registers_s *regs,
 
 BD_PRIVATE void                 gc_free(GRAPHICS_CONTROLLER **p);
 
-/*
- * input stream (MPEG-TS IG stream)
+/**
+ *
+ *  Decode data from MPEG-TS input stream
+ *
+ * @param p  GRAPHICS_CONTROLLER object
+ * @param pid  mpeg-ts PID to decode (HDMV IG/PG stream)
+ * @param block  mpeg-ts data
+ * @param num_blocks  number of aligned units in data
+ * @param stc  current playback time
+ * @return <0 on error, 0 when not complete, >0 when complete
  */
-
-BD_PRIVATE void                 gc_decode_ts(GRAPHICS_CONTROLLER *p,
+BD_PRIVATE int                  gc_decode_ts(GRAPHICS_CONTROLLER *p,
                                              uint16_t pid,
                                              uint8_t *block, unsigned num_blocks,
                                              int64_t stc);



More information about the libbluray-devel mailing list