Skip to content

Commit

Permalink
Update main.cpp for new rpicam-apps library
Browse files Browse the repository at this point in the history
  • Loading branch information
SBCV-apegram committed Dec 30, 2023
1 parent 1b9f208 commit 94cc75f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,23 +128,23 @@ void mirrored_rotation(VideoOptions *options)
options->transform = transform;
}

static void event_loop(LibcameraEncoder &app)
static void event_loop(RPiCamEncoder &app)
{
VideoOptions const *options = app.GetOptions();
std::unique_ptr<Output> output = std::unique_ptr<Output>(new NdiOutput(options, _getValue("neopixel_path", "/tmp/neopixel.state")));
app.SetEncodeOutputReadyCallback(std::bind(&Output::OutputReady, output.get(), _1, _2, _3, _4));


app.OpenCamera();
app.ConfigureVideo(LibcameraEncoder::FLAG_VIDEO_JPEG_COLOURSPACE);
app.ConfigureVideo(RPiCamEncoder::FLAG_VIDEO_JPEG_COLOURSPACE);
app.StartEncoder();
app.StartCamera();
while (!exit_loop)
{
LibcameraEncoder::Msg msg = app.Wait();
if (msg.type == LibcameraEncoder::MsgType::Quit)
RPiCamEncoder::Msg msg = app.Wait();
if (msg.type == RPiCamEncoder::MsgType::Quit)
return;
else if (msg.type != LibcameraEncoder::MsgType::RequestComplete)
else if (msg.type != RPiCamEncoder::MsgType::RequestComplete)
throw std::runtime_error("unrecognised message!");

CompletedRequestPtr &completed_request = std::get<CompletedRequestPtr>(msg.payload);
Expand All @@ -156,7 +156,7 @@ int main(int argc, char *argv[])
{
try
{
LibcameraEncoder app;
RPiCamEncoder app;
VideoOptions *options = app.GetOptions();
loadConfig();
options->codec = "YUV420";
Expand Down

0 comments on commit 94cc75f

Please sign in to comment.