media_device.h 1.61 KB
Newer Older
1
/*
2
 *  Copyright (C) 2015-2019 Savoir-faire Linux Inc.
3
 *
4 5 6 7 8 9 10 11 12 13 14 15 16 17
 *  Author: Adrien Béraud <adrien.beraud@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
18
 *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA.
19 20 21 22 23
 */

#ifndef __MEDIA_DEVICE_H__
#define __MEDIA_DEVICE_H__

24 25
#include "rational.h"

26
#include <string>
27
#include <chrono>
28

Adrien Béraud's avatar
Adrien Béraud committed
29
namespace jami {
30

31 32
constexpr static auto NEWPARAMS_TIMEOUT = std::chrono::milliseconds(1000);

33 34 35 36 37 38
/**
 * DeviceParams
 * Parameters used by MediaDecoder and MediaEncoder
 * to open a LibAV device/stream
 */
struct DeviceParams {
39
    std::string name {};
40 41 42
    std::string input {}; // Device path (e.g. /dev/video0)
    std::string format {};
    unsigned width {}, height {};
43
    rational<double> framerate {};
44 45
    std::string pixel_format {};
    std::string channel_name {};
46 47 48
    unsigned channel {}; // Channel number
    std::string loop {};
    std::string sdp_flags {};
49 50
    int offset_x {};
    int offset_y {};
Adrien Béraud's avatar
Adrien Béraud committed
51
    int orientation {};
52 53 54 55 56
};

}

#endif // __MEDIA_DEVICE_H__