4 Parse list of available streams on Anevia Toucan servers.
5 The URI http://ipaddress:554/list_streams.idp describes a list of
6 available streams on the server.
8 Copyright © 2009 M2X BV
10 Authors: Jean-Paul Saman <jpsaman@videolan.org>
12 This program is free software; you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by
14 the Free Software Foundation; either version 2 of the License, or
15 (at your option) any later version.
17 This program is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 GNU General Public License for more details.
22 You should have received a copy of the GNU General Public License
23 along with this program; if not, write to the Free Software
24 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
29 return vlc
.access
== "http"
30 and string.match( vlc
.path
, "/list_streams%.idp" )
36 _
,_
,server
= string.find( vlc
.path
, "(.*)/list_streams.idp" )
39 if not line
then break end
41 if string.match( line
, "<streams[-]list> </stream[-]list>" ) then
43 elseif string.match( line
, "<streams[-]list xmlns=\"(.*)\">" ) then
46 if not line
then break end
47 if string.match( line
, "<streamer name=\"(.*)\"> </streamer>" ) then
49 elseif string.match( line
, "<streamer name=\"(.*)\">" ) then
50 _
,_
,streamer
= string.find( line
, "name=\"(.*)\"" )
53 if not line
then break end
54 -- ignore <host name=".." /> tags
55 -- ignore <port number=".." /> tags
56 if string.match( line
, "<input name=\"(.*)\">" ) then
57 _
,_
,path
= string.find( line
, "name=\"(.*)\"" )
60 if not line
then break end
61 if string.match( line
, "<stream id=\"(.*)\" />" ) then
62 _
,_
,media
= string.find( line
, "id=\"(.*)\"" )
63 video
= "rtsp://" .. tostring(server
) .. "/" .. tostring(path
) .. "/" .. tostring(media
)
64 vlc
.msg
.dbg( "adding to playlist " .. tostring(video
) )
65 table.insert( p
, { path
= video
; name
= media
, url
= video
} )
67 -- end of input tag found
68 if string.match( line
, "</input>" ) then
74 if not line
then break end
75 -- end of streamer tag found
76 if string.match( line
, "</streamer>" ) then
80 if not line
then break end
81 -- end of streams-list tag found
82 if string.match( line
, "</streams-list>" ) then