diff options
author | Ed Tanous <ed.tanous@intel.com> | 2017-04-18 22:45:08 +0300 |
---|---|---|
committer | Ed Tanous <ed.tanous@intel.com> | 2017-04-18 22:45:08 +0300 |
commit | 1ff48780d3e8e4bc0dee01ae0e756eb4d46a4f53 (patch) | |
tree | 59bd96554546fabbe03afb084f5068f658c93ff3 /src/getvideo_main.cpp | |
parent | 93f987d2383258f88fe9b9133af956bcc0f00233 (diff) | |
download | bmcweb-1ff48780d3e8e4bc0dee01ae0e756eb4d46a4f53.tar.xz |
incremental
Diffstat (limited to 'src/getvideo_main.cpp')
-rw-r--r-- | src/getvideo_main.cpp | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/src/getvideo_main.cpp b/src/getvideo_main.cpp index 4f375ca025..f20c10b4dd 100644 --- a/src/getvideo_main.cpp +++ b/src/getvideo_main.cpp @@ -1,13 +1,13 @@ #include <video.h> +#include <fcntl.h> +#include <unistd.h> +#include <chrono> +#include <fstream> #include <iomanip> #include <iostream> -#include <chrono> #include <thread> #include <vector> -#include <fstream> -#include <fcntl.h> -#include <unistd.h> #include <stdio.h> #include <stdlib.h> @@ -24,7 +24,7 @@ int main() { std::cout << "Started\n"; AstVideo::RawVideoBuffer out; bool have_hardware = false; - if( access( "/dev/video", F_OK ) != -1 ) { + if (access("/dev/video", F_OK) != -1) { AstVideo::VideoPuller p; p.initialize(); out = p.read_video(); @@ -43,19 +43,17 @@ int main() { out.height = 600; out.y_selector = 0; out.uv_selector = 0; - } } FILE *fp = fopen("/tmp/screendata.bin", "wb"); - fwrite(out.buffer.data(), sizeof(char), - out.buffer.size(), fp); + fwrite(out.buffer.data(), sizeof(char), out.buffer.size(), fp); AstVideo::AstJpegDecoder d; std::cout << "MODE " << static_cast<int>(out.mode); d.decode(out.buffer, out.width, out.height, out.mode, out.y_selector, out.uv_selector); - #ifdef BUILD_CIMG +#ifdef BUILD_CIMG cimg_library::CImg<unsigned char> image(out.width, out.height, 1, 3 /*numchannels*/); for (int y = 0; y < out.height; y++) { @@ -67,10 +65,9 @@ int main() { } } image.save("/tmp/file2.bmp"); - #endif - - std::cout << "Done!\n"; +#endif + std::cout << "Done!\n"; return 1; } |