Loading...
Searching...
No Matches
CameraFormatName.hpp
1#pragma once
2
3// <cstdint> first: libavutil/common.h refuses to be included from C++ unless
4// UINT64_C is already defined.
5#include <cstdint>
6#include <string>
7
8extern "C" {
9#include <libavcodec/codec_desc.h>
10#include <libavcodec/codec_id.h>
11#include <libavutil/pixdesc.h>
12#include <libavutil/pixfmt.h>
13}
14
15namespace Gfx
16{
22inline std::string cameraFormatName(int codec, int pixelformat) noexcept
23{
24 if(codec != AV_CODEC_ID_NONE && codec != AV_CODEC_ID_RAWVIDEO)
25 {
26 if(const AVCodecDescriptor* desc = avcodec_descriptor_get((AVCodecID)codec))
27 return desc->name;
28 }
29
30 if(const char* name = av_get_pix_fmt_name((AVPixelFormat)pixelformat))
31 return name;
32
33 return "unknown";
34}
35}
Binds the rendering pipeline to ossia processes.
Definition AssetTable.cpp:7
std::string cameraFormatName(int codec, int pixelformat) noexcept
Definition CameraFormatName.hpp:22