[vlc-devel] [RFC PATCH 3/8] input: add INPUT_CONTROL_DECODER_STATE control

Thomas Guillem thomas at gllm.fr
Thu Apr 21 18:24:33 CEST 2016


This control is pushed from the decoder and used to notify an error.
---
 include/vlc_codec.h        |  7 +++++++
 src/input/input.c          |  3 +++
 src/input/input_internal.h | 12 ++++++++++++
 3 files changed, 22 insertions(+)

diff --git a/include/vlc_codec.h b/include/vlc_codec.h
index 2d01d26..808e820 100644
--- a/include/vlc_codec.h
+++ b/include/vlc_codec.h
@@ -43,6 +43,13 @@
 
 typedef struct decoder_owner_sys_t decoder_owner_sys_t;
 
+enum decoder_state
+{
+    DECODER_INIT,
+    DECODER_ERROR_GENERIC,
+    DECODER_ERROR_OUTPUT,
+};
+
 /*
  * BIG FAT WARNING : the code relies in the first 4 members of filter_t
  * and decoder_t to be the same, so if you have anything to add, do it
diff --git a/src/input/input.c b/src/input/input.c
index 5591a4e..0791966 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -1511,6 +1511,9 @@ static void ControlRelease( int i_type, vlc_value_t val )
     case INPUT_CONTROL_ADD_SLAVE:
         free( val.psz_string );
         break;
+    case INPUT_CONTROL_DECODER_STATE:
+        free( val.p_address );
+        break;
 
     default:
         break;
diff --git a/src/input/input_internal.h b/src/input/input_internal.h
index b68bec7..ba9a6ec 100644
--- a/src/input/input_internal.h
+++ b/src/input/input_internal.h
@@ -214,6 +214,18 @@ enum input_control_e
     INPUT_CONTROL_SET_RECORD_STATE,
 
     INPUT_CONTROL_SET_FRAME_NEXT,
+
+    /* Status signaled by a decoder: val is a pointer to a struct
+     * decoder_status_control  */
+    INPUT_CONTROL_DECODER_STATE,
+};
+
+struct decoder_state_control
+{
+    int i_cat;
+    int i_es_id;
+    const char *psz_module_name;
+    enum decoder_state state;
 };
 
 /* Internal helpers */
-- 
2.8.0.rc3



More information about the vlc-devel mailing list