Commit e026c018 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

Remove using namespace std; from C++ code

This prevents us from providing our atomic types definitions, as they
would conflict with the ones in std::
parent 918ed4d1
......@@ -59,7 +59,6 @@
#include "dcpparser.h"
using namespace ASDCP;
using namespace std;
#define FRAME_BUFFER_SIZE 1302083 /* maximum frame length, in bytes, after
"Digital Cinema System Specification Version 1.2
......@@ -124,10 +123,10 @@ class demux_sys_t
EssenceType_t PictureEssType;
/* ASDCP Video MXF Reader */
vector<videoReader_t> v_videoReader;
std::vector<videoReader_t> v_videoReader;
/* ASDCP Audio MXF Reader */
vector<audioReader_t> v_audioReader;
std::vector<audioReader_t> v_audioReader;
/* audio buffer size */
uint32_t i_audio_buffer;
......@@ -953,12 +952,12 @@ int dcpInit ( demux_t *p_demux )
* Function to retrieve the path to the ASSETMAP file.
* @param p_demux DCP access_demux.
*/
static string assetmapPath( demux_t * p_demux )
static std::string assetmapPath( demux_t * p_demux )
{
DIR *dir = NULL;
struct dirent *ent = NULL;
dcp_t *p_dcp = p_demux->p_sys->p_dcp;
string result;
std::string result;
if( ( dir = opendir (p_dcp->path.c_str() ) ) != NULL )
{
......@@ -995,7 +994,7 @@ int parseXML ( demux_t * p_demux )
{
int retval;
string assetmap_path = assetmapPath( p_demux );
std::string assetmap_path = assetmapPath( p_demux );
/* We get the ASSETMAP file path */
if( assetmap_path.empty() )
return VLC_EGENERIC;
......
......@@ -25,7 +25,6 @@
/*****************************************************************************
* Preamble
*****************************************************************************/
using namespace std;
#include <dshow.h>
......
......@@ -63,9 +63,9 @@ static int AccessControl ( access_t *, int, va_list );
static int Demux ( demux_t * );
static int DemuxControl( demux_t *, int, va_list );
static int OpenDevice( vlc_object_t *, access_sys_t *, string, bool );
static IBaseFilter *FindCaptureDevice( vlc_object_t *, string *,
list<string> *, bool );
static int OpenDevice( vlc_object_t *, access_sys_t *, std::string, bool );
static IBaseFilter *FindCaptureDevice( vlc_object_t *, std::string *,
std::list<std::string> *, bool );
static size_t EnumDeviceCaps( vlc_object_t *, IBaseFilter *,
int, int, int, int, int, int,
AM_MEDIA_TYPE *mt, size_t );
......@@ -305,7 +305,7 @@ vlc_module_end ()
*****************************************************************************/
typedef struct dshow_stream_t
{
string devicename;
std::string devicename;
IBaseFilter *p_device_filter;
CaptureFilter *p_capture_filter;
AM_MEDIA_TYPE mt;
......@@ -322,7 +322,7 @@ typedef struct dshow_stream_t
bool b_pts;
deque<VLCMediaSample> samples_queue;
std::deque<VLCMediaSample> samples_queue;
} dshow_stream_t;
/*****************************************************************************
......@@ -397,7 +397,7 @@ static int CommonOpen( vlc_object_t *p_this, access_sys_t *p_sys,
char *psz_val;
/* Get/parse options and open device(s) */
string vdevname, adevname;
std::string vdevname, adevname;
int i_width = 0, i_height = 0;
vlc_fourcc_t i_chroma = 0;
bool b_use_audio = true;
......@@ -415,7 +415,7 @@ static int CommonOpen( vlc_object_t *p_this, access_sys_t *p_sys,
msg_Dbg( p_this, "dshow-vdev: %s", psz_val ) ;
/* skip none device */
if ( strncasecmp( psz_val, "none", 4 ) != 0 )
vdevname = string( psz_val );
vdevname = std::string( psz_val );
else
b_use_video = false ;
}
......@@ -427,7 +427,7 @@ static int CommonOpen( vlc_object_t *p_this, access_sys_t *p_sys,
msg_Dbg( p_this, "dshow-adev: %s", psz_val ) ;
/* skip none device */
if ( strncasecmp( psz_val, "none", 4 ) != 0 )
adevname = string( psz_val );
adevname = std::string( psz_val );
else
b_use_audio = false ;
}
......@@ -989,7 +989,7 @@ static int GetFourCCPriority( int i_fourcc )
#define MAX_MEDIA_TYPES 32
static int OpenDevice( vlc_object_t *p_this, access_sys_t *p_sys,
string devicename, bool b_audio )
std::string devicename, bool b_audio )
{
/* See if device is already opened */
for( int i = 0; i < p_sys->i_streams; i++ )
......@@ -1002,14 +1002,14 @@ static int OpenDevice( vlc_object_t *p_this, access_sys_t *p_sys,
}
}
list<string> list_devices;
std::list<std::string> list_devices;
/* Enumerate devices and display their names */
FindCaptureDevice( p_this, NULL, &list_devices, b_audio );
if( list_devices.empty() )
return VLC_EGENERIC;
list<string>::iterator iter;
std::list<std::string>::iterator iter;
for( iter = list_devices.begin(); iter != list_devices.end(); ++iter )
msg_Dbg( p_this, "found device: %s", iter->c_str() );
......@@ -1203,14 +1203,14 @@ static int OpenDevice( vlc_object_t *p_this, access_sys_t *p_sys,
These actions *may* be requested whith a single call.
*/
static IBaseFilter *
FindCaptureDevice( vlc_object_t *p_this, string *p_devicename,
list<string> *p_listdevices, bool b_audio )
FindCaptureDevice( vlc_object_t *p_this, std::string *p_devicename,
std::list<std::string> *p_listdevices, bool b_audio )
{
IBaseFilter *p_base_filter = NULL;
IMoniker *p_moniker = NULL;
ULONG i_fetched;
HRESULT hr;
list<string> devicelist;
std::list<std::string> devicelist;
/* Create the system device enumerator */
ICreateDevEnum *p_dev_enum = NULL;
......@@ -1267,14 +1267,14 @@ FindCaptureDevice( vlc_object_t *p_this, string *p_devicename,
if( SUCCEEDED(hr) )
{
char *p_buf = FromWide( var.bstrVal );
string devname = string(p_buf);
std::string devname(p_buf);
free( p_buf) ;
int dup = 0;
/* find out if this name is already used by a previously found device */
list<string>::const_iterator iter = devicelist.begin();
list<string>::const_iterator end = devicelist.end();
string ordevname = devname ;
std::list<std::string>::const_iterator iter = devicelist.begin();
std::list<std::string>::const_iterator end = devicelist.end();
std::string ordevname = devname ;
while ( iter != end )
{
if( 0 == (*iter).compare( devname ) )
......@@ -1982,7 +1982,7 @@ static int FindDevices( vlc_object_t *p_this, const char *psz_name,
char ***vp, char ***tp )
{
/* Find list of devices */
list<string> list_devices;
std::list<std::string> list_devices;
if( SUCCEEDED(CoInitializeEx( NULL, COINIT_MULTITHREADED ))
|| SUCCEEDED(CoInitializeEx( NULL, COINIT_APARTMENTTHREADED )) )
{
......@@ -2001,7 +2001,7 @@ static int FindDevices( vlc_object_t *p_this, const char *psz_name,
values[1] = strdup( "none" );
texts[1] = strdup( N_("None") );
for( list<string>::iterator iter = list_devices.begin();
for( std::list<std::string>::iterator iter = list_devices.begin();
iter != list_devices.end();
++iter )
{
......
......@@ -236,7 +236,7 @@ CapturePin::~CapturePin()
* @return S_OK if a sample was available, S_FALSE if no sample was
* available
*/
HRESULT CapturePin::CustomGetSamples( deque<VLCMediaSample> &external_queue )
HRESULT CapturePin::CustomGetSamples( std::deque<VLCMediaSample> &external_queue )
{
#if 0 //def DEBUG_DSHOW
msg_Dbg( p_input, "CapturePin::CustomGetSamples: %d samples in the queue", samples_queue.size());
......
......@@ -27,7 +27,6 @@
*****************************************************************************/
#include <deque>
using namespace std;
typedef struct VLCMediaSample
{
......@@ -62,7 +61,7 @@ class CapturePin: public IPin, public IMemInputPin
AM_MEDIA_TYPE cx_media_type;
deque<VLCMediaSample> samples_queue;
std::deque<VLCMediaSample> samples_queue;
long i_ref;
......@@ -108,7 +107,7 @@ class CapturePin: public IPin, public IMemInputPin
/* Custom methods */
HRESULT CustomGetSample( VLCMediaSample * );
HRESULT CustomGetSamples( deque<VLCMediaSample> &external_queue );
HRESULT CustomGetSamples( std::deque<VLCMediaSample> &external_queue );
AM_MEDIA_TYPE &CustomGetMediaType();
};
......
......@@ -24,8 +24,6 @@
* Preamble
*****************************************************************************/
using namespace std;
#include <wtypes.h>
#include <unknwn.h>
#include <ole2.h>
......
......@@ -61,8 +61,6 @@ extern "C" {
#include "../access/mms/asf.h" /* Who said ugly ? */
}
using namespace std;
/*****************************************************************************
* Module descriptor
*****************************************************************************/
......
......@@ -27,7 +27,6 @@
#include "AbstractPlaylist.hpp"
using namespace adaptative::playlist;
using namespace std;
SegmentInformation::SegmentInformation(SegmentInformation *parent_) :
ICanonicalUrl( parent_ ),
......@@ -69,7 +68,7 @@ AbstractPlaylist * SegmentInformation::getPlaylist() const
return NULL;
}
std::size_t SegmentInformation::getSegments(SegmentInfoType type, vector<ISegment *> &retSegments,
std::size_t SegmentInformation::getSegments(SegmentInfoType type, std::vector<ISegment *> &retSegments,
std::size_t *offset) const
{
std::size_t off = 0;
......@@ -148,11 +147,11 @@ std::size_t SegmentInformation::getSegments(SegmentInfoType type, vector<ISegmen
}
}
std::size_t SegmentInformation::getAllSegments(vector<ISegment *> &retSegments) const
std::size_t SegmentInformation::getAllSegments(std::vector<ISegment *> &retSegments) const
{
for(int i=0; i<InfoTypeCount; i++)
{
vector<ISegment *> segs;
std::vector<ISegment *> segs;
if( getSegments(static_cast<SegmentInfoType>(i), segs) )
retSegments.insert( retSegments.end(), segs.begin(), segs.end() );
}
......@@ -163,7 +162,7 @@ ISegment * SegmentInformation::getSegment(SegmentInfoType type, uint64_t pos) co
{
ISegment *segment = NULL;
vector<ISegment *> retSegments;
std::vector<ISegment *> retSegments;
std::size_t offset = 0;
const size_t size = getSegments( type, retSegments, &offset );
if( size )
......
......@@ -321,7 +321,7 @@ SimpleTag * matroska_segment_c::ParseSimpleTags( KaxTagSimple *tag, int target_t
{
KaxTagLangue &language = *(KaxTagLangue*) el;
language.ReadData( es.I_O(), SCOPE_ALL_DATA );
p_simple->psz_lang = strdup( string( language ).c_str());
p_simple->psz_lang = strdup( std::string( language ).c_str());
}
else if( MKV_IS_ID( el, KaxTagDefault ) )
{
......@@ -1268,7 +1268,7 @@ void matroska_segment_c::EnsureDuration()
{
KaxSimpleBlock *block = (KaxSimpleBlock*)l;
block->SetParent( *p_last_cluster );
i_last_timecode = max(i_last_timecode, block->GlobalTimecode());
i_last_timecode = std::max(i_last_timecode, block->GlobalTimecode());
}
else if( MKV_IS_ID( l, KaxBlockGroup ) )
{
......@@ -1290,7 +1290,7 @@ void matroska_segment_c::EnsureDuration()
i_group_timecode += uint64( dur );
}
}
i_last_timecode = max(i_last_timecode, i_group_timecode);
i_last_timecode = std::max(i_last_timecode, i_group_timecode);
}
}
......
......@@ -366,7 +366,7 @@ void matroska_segment_c::ParseTrackEntry( KaxTrackEntry *m )
KaxTrackLanguage &lang = *(KaxTrackLanguage*)l;
free( tk->fmt.psz_language );
tk->fmt.psz_language = strdup( string( lang ).c_str() );
tk->fmt.psz_language = strdup( std::string( lang ).c_str() );
msg_Dbg( &sys.demuxer,
"| | | + Track Language=`%s'", tk->fmt.psz_language );
}
......@@ -374,8 +374,8 @@ void matroska_segment_c::ParseTrackEntry( KaxTrackEntry *m )
{
KaxCodecID &codecid = *(KaxCodecID*)l;
tk->psz_codec = strdup( string( codecid ).c_str() );
msg_Dbg( &sys.demuxer, "| | | + Track CodecId=%s", string( codecid ).c_str() );
tk->psz_codec = strdup( std::string( codecid ).c_str() );
msg_Dbg( &sys.demuxer, "| | | + Track CodecId=%s", std::string( codecid ).c_str() );
}
else if( MKV_IS_ID( l, KaxCodecPrivate ) )
{
......@@ -1042,13 +1042,13 @@ void matroska_segment_c::ParseChapterAtom( int i_level, KaxChapterAtom *ca, chap
{
KaxChapterLanguage &lang =*(KaxChapterLanguage*)l;
msg_Dbg( &sys.demuxer, "| | | | | + ChapterLanguage '%s'",
string( lang ).c_str() );
std::string( lang ).c_str() );
}
else if( MKV_IS_ID( l, KaxChapterCountry ) )
{
KaxChapterCountry &ct =*(KaxChapterCountry*)l;
msg_Dbg( &sys.demuxer, "| | | | | + ChapterCountry '%s'",
string( ct ).c_str() );
std::string( ct ).c_str() );
}
}
}
......
......@@ -667,7 +667,7 @@ void BlockDecode( demux_t *p_demux, KaxBlock *block, KaxSimpleBlock *simpleblock
else if ( tk->i_last_dts == VLC_TS_INVALID )
p_block->i_dts = i_pts;
else
p_block->i_dts = min( i_pts, tk->i_last_dts + ( mtime_t )tk->i_default_duration );
p_block->i_dts = std::min( i_pts, tk->i_last_dts + ( mtime_t )tk->i_default_duration );
}
}
......
......@@ -115,7 +115,6 @@ enum
using namespace LIBMATROSKA_NAMESPACE;
using namespace std;
void BlockDecode( demux_t *p_demux, KaxBlock *block, KaxSimpleBlock *simpleblock,
mtime_t i_pts, mtime_t i_duration, bool b_key_picture,
......
......@@ -31,8 +31,6 @@
#include <QMenu>
#include <QVector>
using namespace std;
class MenuItemData : public QObject
{
Q_OBJECT
......
......@@ -87,7 +87,7 @@ void AsyncQueue::push( const CmdGenericPtr &rcCommand, bool removePrev )
}
void AsyncQueue::remove( const string &rType, const CmdGenericPtr &rcCommand )
void AsyncQueue::remove( const std::string &rType, const CmdGenericPtr &rcCommand )
{
cmdList_t::iterator it;
for( it = m_cmdList.begin(); it != m_cmdList.end(); /* nothing */ )
......
......@@ -49,7 +49,7 @@ public:
void push( const CmdGenericPtr &rcCommand, bool removePrev = true );
/// Remove the commands of the given type
void remove( const string &rType , const CmdGenericPtr &rcCommand );
void remove( const std::string &rType , const CmdGenericPtr &rcCommand );
/// Flush the queue and execute the commands
void flush();
......
......@@ -33,15 +33,15 @@
class CmdAddItem: public CmdGeneric
{
public:
CmdAddItem( intf_thread_t *pIntf, const string &rName, bool playNow )
CmdAddItem( intf_thread_t *pIntf, const std::string &rName, bool playNow )
: CmdGeneric( pIntf ), m_name( rName ), m_playNow( playNow ) { }
virtual ~CmdAddItem() { }
virtual void execute();
virtual string getType() const { return "add item"; }
virtual std::string getType() const { return "add item"; }
private:
/// Name of the item to enqueue
string m_name;
std::string m_name;
/// Should we play the item immediately?
bool m_playNow;
};
......
......@@ -34,7 +34,7 @@ public:
: CmdGeneric( pIntf ), m_enable( iEnable ) { }
virtual ~CmdSetEqualizer() { }
virtual void execute();
virtual string getType() const { return "set equalizer"; }
virtual std::string getType() const { return "set equalizer"; }
private:
/// Enable or disable the equalizer
......
......@@ -34,7 +34,7 @@ class CmdCallback : public CmdGeneric
public:
CmdCallback( intf_thread_t *pIntf, vlc_object_t *pObj, vlc_value_t newVal,
void (VlcProc::*func)(vlc_object_t *,vlc_value_t),
string label )
std::string label )
: CmdGeneric( pIntf ), m_pObj( pObj ), m_newVal( newVal ),
m_label( label ), m_pfExecute( func )
{
......@@ -56,12 +56,12 @@ public:
vlc_object_release( m_pObj );
m_pObj = NULL;
}
virtual string getType() const { return m_label; }
virtual std::string getType() const { return m_label; }
private:
vlc_object_t* m_pObj;
vlc_value_t m_newVal;
string m_label;
std::string m_label;
void (VlcProc::*m_pfExecute)(vlc_object_t *,vlc_value_t);
};
......@@ -122,7 +122,7 @@ public:
vlc_cond_signal( &m_wait );
}
virtual string getType() const { return "CmdExecuteBlock"; }
virtual std::string getType() const { return "CmdExecuteBlock"; }
private:
vlc_object_t* m_pObj;
......
......@@ -32,15 +32,15 @@
class CmdChangeSkin: public CmdGeneric
{
public:
CmdChangeSkin( intf_thread_t *pIntf, const string &rFile ):
CmdChangeSkin( intf_thread_t *pIntf, const std::string &rFile ):
CmdGeneric( pIntf ), m_file( rFile ) { }
virtual ~CmdChangeSkin() { }
virtual void execute();
virtual string getType() const { return "change skin"; }
virtual std::string getType() const { return "change skin"; }
private:
/// Skin file to load
string m_file;
std::string m_file;
};
#endif
......@@ -42,7 +42,7 @@ class CmdDlg##a: public CmdGeneric \
Dialogs *dlg = Dialogs::instance( getIntf() ); \
if( dlg ) dlg->c; \
} \
virtual string getType() const { return #a" dialog"; } \
virtual std::string getType() const { return #a" dialog"; } \
};
DEFC( ChangeSkin, showChangeSkin() )
......@@ -85,7 +85,7 @@ public:
if( pDialogs != NULL )
pDialogs->showInteraction( m_pDialog );
}
virtual string getType() const { return "interaction"; }
virtual std::string getType() const { return "interaction"; }
private:
interaction_dialog_t *m_pDialog;
};
......
......@@ -38,7 +38,7 @@ class Cmd##name: public CmdGeneric \
Cmd##name( intf_thread_t *pIntf ): CmdGeneric( pIntf ) { } \
virtual ~Cmd##name() { } \
virtual void execute(); \
virtual string getType() const { return type; } \
virtual std::string getType() const { return type; } \
};
......@@ -51,7 +51,7 @@ public: \
CmdGeneric( pParent->getIntf() ), m_pParent( pParent ) { } \
virtual ~Cmd##action() { } \
virtual void execute(); \
virtual string getType() const { return "Cmd" #parent #action; } \
virtual std::string getType() const { return "Cmd" #parent #action; } \
private: \
parent *m_pParent; \
} m_cmd##action; \
......@@ -68,7 +68,7 @@ public:
virtual void execute() = 0;
/// Return the type of the command
virtual string getType() const { return ""; }
virtual std::string getType() const { return ""; }
/// During queue reductions, check if we really want to remove
/// this command.
......
......@@ -38,7 +38,7 @@ public:
GenericLayout &rLayout );
virtual ~CmdLayout() { }
virtual void execute();
virtual string getType() const { return "change layout"; }
virtual std::string getType() const { return "change layout"; }
private:
TopWindow &m_rWindow;
......
......@@ -42,7 +42,7 @@ public:
TopWindow &rWindow );
virtual ~CmdMaximize() { }
virtual void execute();
virtual string getType() const { return "maximize"; }
virtual std::string getType() const { return "maximize"; }
private:
WindowManager &m_rWindowManager;
......@@ -59,7 +59,7 @@ public:
TopWindow &rWindow );
virtual ~CmdUnmaximize() { }
virtual void execute();
virtual string getType() const { return "unmaximize"; }
virtual std::string getType() const { return "unmaximize"; }
private:
WindowManager &m_rWindowManager;
......
......@@ -32,11 +32,11 @@
class CmdMuxer: public CmdGeneric
{
public:
CmdMuxer( intf_thread_t *pIntf, const list<CmdGeneric*> &rList )
CmdMuxer( intf_thread_t *pIntf, const std::list<CmdGeneric*> &rList )
: CmdGeneric( pIntf ), m_list( rList ) { }
virtual ~CmdMuxer() { }
virtual void execute();
virtual string getType() const { return "muxer"; }
virtual std::string getType() const { return "muxer"; }
private:
/// List of commands we will execute sequentially
......
......@@ -38,7 +38,7 @@ public:
: CmdGeneric( pIntf ), m_ontop( b_ontop ) { }
virtual ~CmdSetOnTop() { }
virtual void execute();
virtual string getType() const { return "set on top"; }
virtual std::string getType() const { return "set on top"; }
private:
bool m_ontop;
......
......@@ -86,11 +86,11 @@ void CmdPlaylistSave::execute()
if( pPlaylist != NULL )
{
const char *psz_module;
if( m_file.find( ".xsp", 0 ) != string::npos )
if( m_file.find( ".xsp", 0 ) != std::string::npos )
psz_module = "export-xspf";
else if( m_file.find( "m3u", 0 ) != string::npos )
else if( m_file.find( "m3u", 0 ) != std::string::npos )
psz_module = "export-m3u";
else if( m_file.find( "html", 0 ) != string::npos )
else if( m_file.find( "html", 0 ) != std::string::npos )
psz_module = "export-html";
else
{
......
......@@ -37,7 +37,7 @@ public:
: CmdGeneric( pIntf ), m_rList( rList ) { }
virtual ~CmdPlaylistDel() { }
virtual void execute();
virtual string getType() const { return "playlist del"; }
virtual std::string getType() const { return "playlist del"; }
private:
/// List
......@@ -66,7 +66,7 @@ public:
: CmdGeneric( pIntf ), m_value( value ) { }
virtual ~CmdPlaylistRandom() { }
virtual void execute();
virtual string getType() const { return "playlist random"; }
virtual std::string getType() const { return "playlist random"; }
private:
/// Random state
......@@ -82,7 +82,7 @@ public:
: CmdGeneric( pIntf ), m_value( value ) { }
virtual ~CmdPlaylistLoop() { }
virtual void execute();
virtual string getType() const { return "playlist loop"; }
virtual std::string getType() const { return "playlist loop"; }
private:
/// Loop state
......@@ -98,7 +98,7 @@ public:
: CmdGeneric( pIntf ), m_value( value ) { }
virtual ~CmdPlaylistRepeat() { }
virtual void execute();
virtual string getType() const { return "playlist repeat"; }
virtual std::string getType() const { return "playlist repeat"; }
private:
/// Repeat state
......@@ -110,15 +110,15 @@ private:
class CmdPlaylistLoad: public CmdGeneric
{
public:
CmdPlaylistLoad( intf_thread_t *pIntf, const string& rFile )
CmdPlaylistLoad( intf_thread_t *pIntf, const std::string& rFile )
: CmdGeneric( pIntf ), m_file( rFile ) { }
virtual ~CmdPlaylistLoad() { }
virtual void execute();
virtual string getType() const { return "playlist load"; }
virtual std::string getType() const { return "playlist load"; }
private:
/// Playlist file to load
string m_file;
std::string m_file;
};
......@@ -126,15 +126,15 @@ private:
class CmdPlaylistSave: public CmdGeneric
{
public:
CmdPlaylistSave( intf_thread_t *pIntf, const string& rFile )
CmdPlaylistSave( intf_thread_t *pIntf, const std::string& rFile )
: CmdGeneric( pIntf ), m_file( rFile ) { }
virtual ~CmdPlaylistSave() { }