YARP
Yet Another Robot Platform
constants.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2021 Istituto Italiano di Tecnologia (IIT)
3  * All rights reserved.
4  *
5  * This software may be modified and distributed under the terms of the
6  * BSD-3-Clause license. See the accompanying LICENSE file for details.
7  */
8 
17 #ifndef YARP_FFMPEG_CARRIER_FFMPEGPORTMONITOR_CL_PARAMS_H
18 #define YARP_FFMPEG_CARRIER_FFMPEGPORTMONITOR_CL_PARAMS_H
19 
20 // Standard imports
21 #include <string>
22 #include <vector>
23 #include <map>
24 
25 // Ffmpeg imports
26 extern "C" {
27  #include <libavcodec/avcodec.h>
28 }
29 
30 // YARP imports
31 #include <yarp/sig/Image.h>
32 
37 static const std::vector<std::string> FFMPEGPORTMONITOR_IGNORE_PARAMS {
38  "tcp",
39  "fast_tcp",
40  "udp",
41  "send.portmonitor",
42  "recv.portmonitor",
43  "file.libffmpeg",
44  "type.dll"
45 };
46 
51 static const std::string FFMPEGPORTMONITOR_CL_CODEC_KEY = "codec";
52 
57 static const std::vector<std::string> FFMPEGPORTMONITOR_CL_CODECS {
58  "mpeg2video",
59  "h264",
60  "h265"
61 };
62 
67 static const std::vector<int> FFMPEGPORTMONITOR_CODE_CODECS {
68  AV_CODEC_ID_MPEG2VIDEO,
69  AV_CODEC_ID_H264,
70  AV_CODEC_ID_H265
71 };
72 
77 static std::map<int, int> FFMPEGPORTMONITOR_PIXELMAP = {
78  { VOCAB_PIXEL_RGB, AV_PIX_FMT_RGB24 },
79  { VOCAB_PIXEL_RGBA, AV_PIX_FMT_RGBA },
80  { VOCAB_PIXEL_BGR, AV_PIX_FMT_BGR24 },
81  { VOCAB_PIXEL_BGRA, AV_PIX_FMT_BGRA },
82  { VOCAB_PIXEL_YUV_420, AV_PIX_FMT_YUV420P }
83 };
84 
89 static std::map<int, int> FFMPEGPORTMONITOR_CODECPIXELMAP = {
90  { AV_CODEC_ID_H264, AV_PIX_FMT_YUV420P },
91  { AV_CODEC_ID_H265, AV_PIX_FMT_YUV420P },
92  { AV_CODEC_ID_MPEG2VIDEO, AV_PIX_FMT_YUV420P }
93 };
94 
95 #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:37
static const std::string FFMPEGPORTMONITOR_CL_CODEC_KEY
This string is the "key" value for the codec parameter.
Definition: constants.h:51
static std::map< int, int > FFMPEGPORTMONITOR_CODECPIXELMAP
This structure maps Ffmpeg video codecs with their needed Ffmpeg pixel format code.
Definition: constants.h:89
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:57
static std::map< int, int > FFMPEGPORTMONITOR_PIXELMAP
This structure maps YARP pixel format codec into Ffmpeg pixel format codes.
Definition: constants.h:77
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:67
@ VOCAB_PIXEL_YUV_420
Definition: Image.h:70
@ VOCAB_PIXEL_RGBA
Definition: Image.h:51
@ VOCAB_PIXEL_BGRA
Definition: Image.h:52
@ VOCAB_PIXEL_BGR
Definition: Image.h:55
@ VOCAB_PIXEL_RGB
Definition: Image.h:50