system_codec_container.h 2.04 KB
Newer Older
Éloi Bail's avatar
Éloi Bail committed
1
/*
Sébastien Blin's avatar
Sébastien Blin committed
2
 *  Copyright (C) 2015-2019 Savoir-faire Linux Inc.
Guillaume Roguez's avatar
Guillaume Roguez committed
3
 *
Éloi Bail's avatar
Éloi Bail committed
4 5 6 7 8 9 10 11 12 13 14 15 16 17
 *  Author: Eloi BAIL <eloi.bail@savoirfairelinux.com>
 *
 *  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 3 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
Guillaume Roguez's avatar
Guillaume Roguez committed
18
 *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA.
Éloi Bail's avatar
Éloi Bail committed
19 20 21 22 23 24 25 26 27 28 29 30
 */

#ifndef __SYSTEM_CODEC_CONTAINER_H__
#define __SYSTEM_CODEC_CONTAINER_H__

#include "media_codec.h"
#include "ring_types.h"

#include <string>
#include <vector>
#include <memory>

Adrien Béraud's avatar
Adrien Béraud committed
31
namespace jami {
Éloi Bail's avatar
Éloi Bail committed
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52

class SystemCodecContainer;

extern decltype(getGlobalInstance<SystemCodecContainer>)& getSystemCodecContainer;

class SystemCodecContainer
{
    public:
        SystemCodecContainer();
        ~SystemCodecContainer();

        std::vector<std::shared_ptr<SystemCodecInfo>>
        getSystemCodecInfoList(MediaType mediaType = MEDIA_ALL);

        std::vector<unsigned>
        getSystemCodecInfoIdList(MediaType type = MEDIA_ALL);

        std::shared_ptr<SystemCodecInfo>
        searchCodecById(unsigned codecId, MediaType type = MEDIA_ALL);

        std::shared_ptr<SystemCodecInfo>
Adrien Béraud's avatar
Adrien Béraud committed
53
        searchCodecByName(const std::string& name, MediaType type = MEDIA_ALL);
Éloi Bail's avatar
Éloi Bail committed
54 55 56 57 58 59 60 61 62 63 64 65

        std::shared_ptr<SystemCodecInfo>
        searchCodecByPayload(unsigned payload, MediaType type = MEDIA_ALL);

    private:
        /* available audio & video codec  */
        std::vector<std::shared_ptr<SystemCodecInfo>> availableCodecList_;

        void initCodecConfig();
        void checkInstalledCodecs();
};

Adrien Béraud's avatar
Adrien Béraud committed
66
} // namespace jami
Éloi Bail's avatar
Éloi Bail committed
67 68

#endif //SYSTEM_CODEC_CONTAINER