[vlc-devel] [PATCH 02/12] vlc_demux: add DEMUX_GET/SET_ANGLE
Francois Cartegnie
fcvlcdev at free.fr
Thu Apr 2 20:40:10 CEST 2020
---
include/vlc_demux.h | 5 +++++
src/input/demux.c | 11 +++++++++++
src/input/demux.h | 1 +
test/src/input/demux-run.c | 2 ++
4 files changed, 19 insertions(+)
diff --git a/include/vlc_demux.h b/include/vlc_demux.h
index 5d67813fc0..5799c40373 100644
--- a/include/vlc_demux.h
+++ b/include/vlc_demux.h
@@ -48,6 +48,7 @@
#define INPUT_UPDATE_TITLE 0x0010
#define INPUT_UPDATE_SEEKPOINT 0x0020
#define INPUT_UPDATE_META 0x0040
+#define INPUT_UPDATE_ANGLE 0x0080
#define INPUT_UPDATE_TITLE_LIST 0x0100
/* demux_meta_t is returned by "meta reader" module to the demuxer */
@@ -169,6 +170,10 @@ enum demux_query_e
* arg1= int * */
DEMUX_GET_SEEKPOINT, /* arg1= int* can fail */
+ /* Viewing angle of the currently playing title */
+ DEMUX_GET_ANGLE, /* arg1= int* can fail */
+ DEMUX_SET_ANGLE, /* arg1= int can fail */
+
/* I. Common queries to access_demux and demux */
/* POSITION double between 0.0 and 1.0 */
DEMUX_GET_POSITION = 0x300, /* arg1= double * res= */
diff --git a/src/input/demux.c b/src/input/demux.c
index db1b46532e..1bbb91049c 100644
--- a/src/input/demux.c
+++ b/src/input/demux.c
@@ -386,6 +386,8 @@ int demux_vaControlHelper( stream_t *s,
case DEMUX_TEST_AND_CLEAR_FLAGS:
case DEMUX_GET_TITLE:
case DEMUX_GET_SEEKPOINT:
+ case DEMUX_GET_ANGLE:
+ case DEMUX_SET_ANGLE:
case DEMUX_NAV_ACTIVATE:
case DEMUX_NAV_UP:
case DEMUX_NAV_DOWN:
@@ -479,6 +481,15 @@ int demux_GetSeekpoint( demux_t *p_demux )
return seekpoint;
}
+int demux_GetAngle( demux_t *p_demux )
+{
+ int angle;
+
+ if (demux_Control(p_demux, DEMUX_GET_ANGLE, &angle))
+ angle = 0;
+ return angle;
+}
+
static demux_t *demux_FilterNew( demux_t *p_next, const char *p_name )
{
struct vlc_demux_private *priv;
diff --git a/src/input/demux.h b/src/input/demux.h
index f729018105..ca944765e0 100644
--- a/src/input/demux.h
+++ b/src/input/demux.h
@@ -37,6 +37,7 @@ demux_t *demux_NewAdvanced( vlc_object_t *p_obj, input_thread_t *p_parent_input,
unsigned demux_TestAndClearFlags( demux_t *, unsigned );
int demux_GetTitle( demux_t * );
int demux_GetSeekpoint( demux_t * );
+int demux_GetAngle( demux_t * );
/**
* Builds an explicit chain of demux filters.
diff --git a/test/src/input/demux-run.c b/test/src/input/demux-run.c
index 4cacfdfdb1..7a8207a870 100644
--- a/test/src/input/demux-run.c
+++ b/test/src/input/demux-run.c
@@ -315,12 +315,14 @@ static int demux_process_stream(const struct vlc_run_args *args, stream_t *s)
demux_get_meta(demux);
int seekpoint = 0;
+ int angle = 0;
double position = 0.0;
vlc_tick_t time = 0;
vlc_tick_t length = 0;
/* Call controls for increased code coverage */
demux_Control(demux, DEMUX_GET_SEEKPOINT, &seekpoint);
+ demux_Control(demux, DEMUX_GET_ANGLE, &angle);
demux_Control(demux, DEMUX_GET_POSITION, &position);
demux_Control(demux, DEMUX_GET_TIME, &time);
demux_Control(demux, DEMUX_GET_LENGTH, &length);
--
2.25.1
More information about the vlc-devel
mailing list