HDR prep work (#808)

This commit is contained in:
Cameron Gutman
2023-01-23 20:54:08 -06:00
committed by GitHub
parent fa6c279efc
commit 9181028bcf
15 changed files with 294 additions and 77 deletions

View File

@@ -6,6 +6,11 @@
#include "src/config.h"
#include "src/main.h"
// Avoid conflict between AVFoundation and libavutil both defining AVMediaType
#define AVMediaType AVMediaType_FFmpeg
#include "src/video.h"
#undef AVMediaType
namespace fs = std::filesystem;
namespace platf {
@@ -147,7 +152,7 @@ struct av_display_t : public display_t {
}
};
std::shared_ptr<display_t> display(platf::mem_type_e hwdevice_type, const std::string &display_name, int framerate) {
std::shared_ptr<display_t> display(platf::mem_type_e hwdevice_type, const std::string &display_name, const video::config_t &config) {
if(hwdevice_type != platf::mem_type_e::system) {
BOOST_LOG(error) << "Could not initialize display with the given hw device type."sv;
return nullptr;
@@ -168,7 +173,7 @@ std::shared_ptr<display_t> display(platf::mem_type_e hwdevice_type, const std::s
}
}
display->av_capture = [[AVVideo alloc] initWithDisplay:display->display_id frameRate:framerate];
display->av_capture = [[AVVideo alloc] initWithDisplay:display->display_id frameRate:config.framerate];
if(!display->av_capture) {
BOOST_LOG(error) << "Video setup failed."sv;