IBackend.h 1.97 KB
Newer Older
1
/*****************************************************************************
2
 * IBackend.h: Provides an entry point to a backend functionnalities
3
 *****************************************************************************
4
 * Copyright (C) 2008-2016 VideoLAN
5
 *
luyikei's avatar
luyikei committed
6 7
 * Authors: Yikei Lu <luyikei.qmltu@gmail.com>
 *          Hugo Beauzée-Luyssen <hugo@beauzee.fr>
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
 *****************************************************************************/

24 25
#ifndef IBACKEND_H
#define IBACKEND_H
26

27
#include <functional>
28

luyikei's avatar
luyikei committed
29 30 31
#include <string>
#include <map>

32 33
namespace Backend
{
34

luyikei's avatar
luyikei committed
35
class IOutput;
luyikei's avatar
luyikei committed
36 37
class IProfile;
class IFilterInfo;
38

39
class IBackend
40
{
41
    public:
42 43 44 45 46 47 48
        enum LogLevel
        {
            Debug,
            Warning,
            Error,
            None
        };
49
        using LogHandler = std::function<void( LogLevel logLevel, const char* msg )>;
50

51
        virtual ~IBackend() = default;
luyikei's avatar
luyikei committed
52 53 54
        virtual IProfile&                   profile() = 0;
        virtual const std::map<std::string, IFilterInfo*>&    availableFilters() const = 0;
        virtual IFilterInfo*                                  filterInfo( const std::string& id ) const = 0;
55

luyikei's avatar
luyikei committed
56 57
        virtual void                        setLogHandler( LogHandler logHandler ) = 0;
};
58

luyikei's avatar
luyikei committed
59
extern IBackend* instance();
60 61
}

62
#endif // IBACKEND_H