1
/*****************************************************************************
3
*****************************************************************************
4
* Copyright (C) 2003 VideoLAN
5
* $Id: stream.cpp 7397 2004-04-20 17:27:30Z sam $
7
* Authors: Olivier Teuli�re <ipkiss@via.ecp.fr>
9
* This program is free software; you can redistribute it and/or modify
10
* it under the terms of the GNU General Public License as published by
11
* the Free Software Foundation; either version 2 of the License, or
12
* (at your option) any later version.
14
* This program is distributed in the hope that it will be useful,
15
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
* GNU General Public License for more details.
19
* You should have received a copy of the GNU General Public License
20
* along with this program; if not, write to the Free Software
21
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
22
*****************************************************************************/
24
#include <stdio.h> // snprintf
27
#include "../utils/ustring.hpp"
28
#include "../src/os_factory.hpp"
29
#include <vlc/input.h>
32
void Stream::set( const UString &name, bool updateVLC )
36
// Avoid looping forever...
39
// We have nothing to do here, until we decide that the user
40
// can change a stream name on the fly...
45
const string Stream::getAsStringName() const
47
string fullName = getAsStringFullName();
49
// XXX: This should be done in VLC core, not here...
50
// Remove path information if any
51
OSFactory *pFactory = OSFactory::instance( getIntf() );
52
string::size_type pos = fullName.rfind( pFactory->getDirSeparator() );
53
if( pos != string::npos )
55
fullName = fullName.substr( pos + 1, fullName.size() - pos + 1 );
62
const string Stream::getAsStringFullName() const
66
// XXX: we are not using geIntf()->p_sys->p_input direclty here, because it
67
// is not updated by VlcProc yet. Anyway, we shouldn't need to do that,
68
// because VLC core should provide getter functions for the stream name...
69
if( getIntf()->p_sys->p_playlist->p_input == NULL )
75
ret = getIntf()->p_sys->p_playlist->p_input->psz_source;