[vlc-commits] Add SNR and signal level for access_demux
Rémi Denis-Courmont
git at videolan.org
Thu May 10 23:02:14 CEST 2012
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu May 10 23:53:00 2012 +0300| [7a15955acd1adb65a71f17a19b78fa9c545bf37d] | committer: Rémi Denis-Courmont
Add SNR and signal level for access_demux
In particular, V4L is (usually) an access_demux rather than an access.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7a15955acd1adb65a71f17a19b78fa9c545bf37d
---
include/vlc_demux.h | 2 ++
src/input/input.c | 12 ++++++++++++
2 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/include/vlc_demux.h b/include/vlc_demux.h
index a5b5257..6d143e4 100644
--- a/include/vlc_demux.h
+++ b/include/vlc_demux.h
@@ -159,6 +159,8 @@ enum demux_query_e
DEMUX_SET_RATE, /* arg1= int*pi_rate can fail */
DEMUX_CAN_SEEK, /* arg1= bool* can fail (assume false)*/
+
+ DEMUX_GET_SIGNAL, /* arg1= double * arg2= double * can fail */
};
VLC_API int demux_vaControlHelper( stream_t *, int64_t i_start, int64_t i_end, int64_t i_bitrate, int i_align, int i_query, va_list args );
diff --git a/src/input/input.c b/src/input/input.c
index b6e5bd2..bd7f859 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -2253,6 +2253,18 @@ static void UpdateGenericFromDemux( input_thread_t *p_input )
}
p_demux->info.i_update &= ~INPUT_UPDATE_META;
}
+ if( p_demux->info.i_update & INPUT_UPDATE_SIGNAL )
+ {
+ double quality;
+ double strength;
+
+ if( demux_Control( p_demux, DEMUX_GET_SIGNAL, &quality, &strength ) )
+ quality = strength = -1.;
+
+ input_SendEventSignal( p_input, quality, strength );
+
+ p_demux->info.i_update &= ~INPUT_UPDATE_SIGNAL;
+ }
p_demux->info.i_update &= ~INPUT_UPDATE_SIZE;
}
More information about the vlc-commits
mailing list