YARP
Yet Another Robot Platform
constants.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5
14#ifndef YARP_FFMPEG_CARRIER_FFMPEGPORTMONITOR_CL_PARAMS_H
15#define YARP_FFMPEG_CARRIER_FFMPEGPORTMONITOR_CL_PARAMS_H
16
17// Standard imports
18#include <string>
19#include <vector>
20#include <map>
21
22// Ffmpeg imports
23extern "C" {
24 #include <libavcodec/avcodec.h>
25}
26
27// YARP imports
28#include <yarp/sig/Image.h>
29
34static const std::vector<std::string> FFMPEGPORTMONITOR_IGNORE_PARAMS {
35 "tcp",
36 "fast_tcp",
37 "udp",
38 "send.portmonitor",
39 "recv.portmonitor",
40 "file.image_compression_ffmpeg",
41 "type.dll"
42};
43
48static const std::string FFMPEGPORTMONITOR_CL_CODEC_KEY = "codec";
49
54static const std::vector<std::string> FFMPEGPORTMONITOR_CL_CODECS {
55 "mpeg2video",
56 "h264",
57 "h265"
58};
59
64static const std::vector<int> FFMPEGPORTMONITOR_CODE_CODECS {
65 AV_CODEC_ID_MPEG2VIDEO,
66 AV_CODEC_ID_H264,
67 AV_CODEC_ID_H265
68};
69
74static std::map<int, int> FFMPEGPORTMONITOR_PIXELMAP = {
75 { VOCAB_PIXEL_RGB, AV_PIX_FMT_RGB24 },
76 { VOCAB_PIXEL_RGBA, AV_PIX_FMT_RGBA },
77 { VOCAB_PIXEL_BGR, AV_PIX_FMT_BGR24 },
78 { VOCAB_PIXEL_BGRA, AV_PIX_FMT_BGRA },
79 { VOCAB_PIXEL_YUV_420, AV_PIX_FMT_YUV420P }
80};
81
86static std::map<int, int> FFMPEGPORTMONITOR_CODECPIXELMAP = {
87 { AV_CODEC_ID_H264, AV_PIX_FMT_YUV420P },
88 { AV_CODEC_ID_H265, AV_PIX_FMT_YUV420P },
89 { AV_CODEC_ID_MPEG2VIDEO, AV_PIX_FMT_YUV420P }
90};
91
92#endif // YARP_FFMPEG_CARRIER_FFMPEGPORTMONITOR_CL_PARAMS_H
static const std::vector< std::string > FFMPEGPORTMONITOR_IGNORE_PARAMS
This vector contains all parameters that have to be ignored while parsing command line string.
Definition: constants.h:34
static const std::string FFMPEGPORTMONITOR_CL_CODEC_KEY
This string is the "key" value for the codec parameter.
Definition: constants.h:48
static std::map< int, int > FFMPEGPORTMONITOR_CODECPIXELMAP
This structure maps Ffmpeg video codecs with their needed Ffmpeg pixel format code.
Definition: constants.h:86
static const std::vector< std::string > FFMPEGPORTMONITOR_CL_CODECS
This vector contains the only accepted values for the command line parameter "codec".
Definition: constants.h:54
static std::map< int, int > FFMPEGPORTMONITOR_PIXELMAP
This structure maps YARP pixel format codec into Ffmpeg pixel format codes.
Definition: constants.h:74
static const std::vector< int > FFMPEGPORTMONITOR_CODE_CODECS
This vector contains the codec ids corresponding to the codecs of the FFMPEGPORTMONITOR_CL_CODECS vec...
Definition: constants.h:64
@ VOCAB_PIXEL_YUV_420
Definition: Image.h:64
@ VOCAB_PIXEL_RGBA
Definition: Image.h:45
@ VOCAB_PIXEL_BGRA
Definition: Image.h:46
@ VOCAB_PIXEL_BGR
Definition: Image.h:49
@ VOCAB_PIXEL_RGB
Definition: Image.h:44