<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><DIV>Hi Mark,</DIV>
<DIV> </DIV>
<DIV>Will we be able to get dowload status (of streaming video) already or will this help?</DIV>
<DIV> </DIV>
<DIV>Thanks,</DIV>
<DIV>Tony<BR><BR>--- On <B>Sun, 7/29/12, Mark Lee <I><mark.lee@capricasoftware.co.uk></I></B> wrote:<BR></DIV>
<BLOCKQUOTE style="BORDER-LEFT: rgb(16,16,255) 2px solid; PADDING-LEFT: 5px; MARGIN-LEFT: 5px"><BR>From: Mark Lee <mark.lee@capricasoftware.co.uk><BR>Subject: [vlc-devel] [PATCH] Add methods to libvlc to enable and query recording of current media:<BR>To: vlc-devel@videolan.org<BR>Date: Sunday, July 29, 2012, 7:30 AM<BR><BR>
<DIV class=plainMail>* libvlc_media_player_can_record<BR>* libvlc_media_player_get_record<BR>* libvlc_media_player_set_record<BR>---<BR>include/vlc/libvlc_media_player.h |   44 +++++++++++++++++++++++++++++++++++++<BR>lib/libvlc.sym                    |    3 +++<BR>lib/media_player.c                |   44 +++++++++++++++++++++++++++++++++++++<BR>3 files changed, 91 insertions(+)<BR><BR>diff --git a/include/vlc/libvlc_media_player.h b/include/vlc/libvlc_media_player.h<BR>index 809ed5f..e6e52ad 100644<BR>--- a/include/vlc/libvlc_media_player.h<BR>+++ b/include/vlc/libvlc_media_player.h<BR>@@ -1580,6 +1580,50 @@ LIBVLC_API int libvlc_audio_set_delay( libvlc_media_player_t *p_mi, int64_t i_de<BR><BR>/** @} audio */<BR><BR>+/**<BR>+ * Can the media player record the current media?<BR>+ *<BR>+ * Media must be playing or buffering
 before it can be recorded.<BR>+ *<BR>+ * \param p_mi media player<BR>+ * \return non-zero if the media player can record, zero if it can not<BR>+ * \version LibVLC 2.1.0 or later<BR>+ */<BR>+LIBVLC_API int libvlc_media_player_can_record( libvlc_media_player_t *p_mi );<BR>+<BR>+/**<BR>+ * Set whether or not recording is enabled.<BR>+ *<BR>+ * Media must be buffering or playing before it can be recorded.<BR>+ *<BR>+ * Media will be saved to the appropriate media directory, for example "~/Videos". The<BR>+ * file will not be immediately available in that directory until recording is finished.<BR>+ *<BR>+ * Recording can be started and stopped on-the-fly once the media has started playing,<BR>+ * each time recording is stopped and restarted a new file will be created.<BR>+ *<BR>+ * Recording will be stopped when the media stops playing, and must be explicitly enabled<BR>+ * again to restart recording.<BR>+ *<BR>+ * Features such as next/previous chapter,
 set time or position and so on are ineffective<BR>+ * when recording is enabled.<BR>+ *<BR>+ * \param p_mi media player<BR>+ * \param i_record start recording if non-zero, stop recording if zero<BR>+ * \return zero on success, -1 on error<BR>+ * \version LibVLC 2.1.0 or later<BR>+ */<BR>+LIBVLC_API int libvlc_media_player_set_record( libvlc_media_player_t *p_mi, int i_record );<BR>+<BR>+/**<BR>+ * Get whether or not the media is currently being recorded.<BR>+ *<BR>+ * \param p_mi media player<BR>+ * \return non-zero if recording, zero if not<BR>+ * \version LibVLC 2.1.0 or later<BR>+ */<BR>+LIBVLC_API int libvlc_media_player_get_record( libvlc_media_player_t *p_mi );<BR>+<BR>/** @} media_player */<BR><BR># ifdef __cplusplus<BR>diff --git a/lib/libvlc.sym b/lib/libvlc.sym<BR>index 974e04f..059471c 100644<BR>--- a/lib/libvlc.sym<BR>+++ b/lib/libvlc.sym<BR>@@ -116,6 +116,7 @@
 libvlc_media_new_from_input_item<BR>libvlc_media_parse<BR>libvlc_media_parse_async<BR>libvlc_media_player_can_pause<BR>+libvlc_media_player_can_record<BR>libvlc_media_player_next_frame<BR>libvlc_media_player_event_manager<BR>libvlc_media_player_get_agl<BR>@@ -129,6 +130,7 @@ libvlc_media_player_get_media<BR>libvlc_media_player_get_nsobject<BR>libvlc_media_player_get_position<BR>libvlc_media_player_get_rate<BR>+libvlc_media_player_get_record<BR>libvlc_media_player_get_state<BR>libvlc_media_player_get_time<BR>libvlc_media_player_get_title<BR>@@ -153,6 +155,7 @@ libvlc_media_player_set_media<BR>libvlc_media_player_set_nsobject<BR>libvlc_media_player_set_position<BR>libvlc_media_player_set_rate<BR>+libvlc_media_player_set_record<BR>libvlc_media_player_set_time<BR>libvlc_media_player_set_title<BR>libvlc_media_player_set_xwindow<BR>diff --git a/lib/media_player.c b/lib/media_player.c<BR>index f30f184..4d93e42 100644<BR>--- a/lib/media_player.c<BR>+++
 b/lib/media_player.c<BR>@@ -1408,3 +1408,47 @@ void libvlc_media_player_next_frame( libvlc_media_player_t *p_mi )<BR>         vlc_object_release( p_input_thread );<BR>     }<BR>}<BR>+<BR>+int libvlc_media_player_can_record( libvlc_media_player_t *p_mi )<BR>+{<BR>+    input_thread_t *p_input_thread;<BR>+    bool b_can_record;<BR>+<BR>+    p_input_thread = libvlc_get_input_thread( p_mi );<BR>+    if( !p_input_thread )<BR>+        return 0;<BR>+<BR>+    b_can_record = var_GetBool( p_input_thread, "can-record" );<BR>+<BR>+    vlc_object_release( p_input_thread );<BR>+    return b_can_record;<BR>+}<BR>+<BR>+int libvlc_media_player_set_record( libvlc_media_player_t *p_mi, int i_record )<BR>+{<BR>+    input_thread_t *p_input_thread;<BR>+<BR>+    p_input_thread = libvlc_get_input_thread( p_mi
 );<BR>+    if( !p_input_thread )<BR>+        return -1;<BR>+<BR>+    var_SetBool( p_input_thread, "record", i_record );<BR>+<BR>+    vlc_object_release( p_input_thread );<BR>+    return 0;<BR>+}<BR>+<BR>+int libvlc_media_player_get_record( libvlc_media_player_t *p_mi )<BR>+{<BR>+    input_thread_t *p_input_thread;<BR>+    bool b_record;<BR>+<BR>+    p_input_thread = libvlc_get_input_thread( p_mi );<BR>+    if( !p_input_thread )<BR>+        return 0;<BR>+<BR>+    b_record = var_GetBool( p_input_thread, "record" );<BR>+<BR>+    vlc_object_release( p_input_thread );<BR>+    return b_record;<BR>+}<BR>-- <BR>1.7.9.5<BR><BR>_______________________________________________<BR>vlc-devel mailing list<BR>To unsubscribe or modify your subscription options:<BR><A href="http://mailman.videolan.org/listinfo/vlc-devel"
 target=_blank>http://mailman.videolan.org/listinfo/vlc-devel</A><BR></DIV></BLOCKQUOTE></td></tr></table>