Cleanup some old files
These files aren't used, and are cruft that should've been cleaned up a
long time ago.
Tested: Project still builds. Files were not used
Signed-off-by: Ed Tanous <ed.tanous@intel.com>
Change-Id: I658eeebcafc9d20af44609f441b078c3c448a683
diff --git a/aspeed_purley.cmake b/aspeed_purley.cmake
deleted file mode 100644
index 2c48ed2..0000000
--- a/aspeed_purley.cmake
+++ /dev/null
@@ -1,32 +0,0 @@
-# this one is important
-SET(CMAKE_SYSTEM_NAME Linux)
-#this one not so much
-SET(CMAKE_SYSTEM_VERSION 1)
-SET(CMAKE_SYSTEM_PROCESSOR "armv6")
-set(ARCH "armv6")
-
-SET(CMAKE_CROSSCOMPILING True)
-
-# specify the cross compiler
-#SET(CMAKE_C_COMPILER arm-linux-gnueabi-gcc-4.9)
-#SET(CMAKE_CXX_COMPILER arm-linux-gnueabi-g++-4.9)
-#SET(CMAKE_C_LINK_EXECUTABLE "clang <OBJECTS> -o <TARGET> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>")
-#SET(CMAKE_CXX_LINK_EXECUTABLE "clang++ <OBJECTS> -o <TARGET> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>")
-
-set(CMAKE_C_COMPILER /home/ed/deg-bmcfw-core/ToolChain/Host/AST2500/x-tools/arm-aspeed-linux-gnueabi/bin/arm-linux-gcc)
-set(CMAKE_CXX_COMPILER /home/ed/deg-bmcfw-core/ToolChain/Host/AST2500/x-tools/arm-aspeed-linux-gnueabi/bin/arm-linux-g++)
-
-
-set(triple arm-linux-gnueabi)
-set(CMAKE_C_COMPILER_TARGET ${triple})
-set(CMAKE_CXX_COMPILER_TARGET ${triple})
-
-# where is the target environment
-SET(CMAKE_FIND_ROOT_PATH /home/ed/deg-bmcfw-core/_sysroot/AST2500)
-
-# search for programs in the build host directories
-SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
-# for libraries and headers in the target directories
-SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
-SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
-set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
diff --git a/include/ast_video_puller.hpp b/include/ast_video_puller.hpp
deleted file mode 100644
index c97ca48..0000000
--- a/include/ast_video_puller.hpp
+++ /dev/null
@@ -1,212 +0,0 @@
-#pragma once
-
-#include <ast_video_types.hpp>
-#include <boost/asio.hpp>
-#include <cassert>
-#include <iostream>
-#include <mutex>
-#include <vector>
-
-namespace ast_video
-{
-
-//
-// Cursor struct is used in User Mode
-//
-struct AstCurAttributionTag
-{
- unsigned int posX;
- unsigned int posY;
- unsigned int curWidth;
- unsigned int curHeight;
- unsigned int curType; // 0:mono 1:color 2:disappear cursor
- unsigned int curChangeFlag;
-};
-
-//
-// For storing Cursor Information
-//
-struct AstCursorTag
-{
- AstCurAttributionTag attr;
- // unsigned char icon[MAX_CUR_OFFSETX*MAX_CUR_OFFSETY*2];
- unsigned char *icon; //[64*64*2];
-};
-
-//
-// For select image format, i.e. 422 JPG420, 444 JPG444, lumin/chrom table, 0
-// ~ 11, low to high
-//
-struct FeaturesTag
-{
- short jpgFmt; // 422:JPG420, 444:JPG444
- short luminTbl;
- short chromTbl;
- short toleranceNoise;
- int w;
- int h;
- unsigned char *buf;
-};
-
-//
-// For configure video engine control registers
-//
-struct ImageInfo
-{
- short doImageRefresh; // Action 0:motion 1:fullframe 2:quick cursor
- char qcValid; // quick cursor enable/disable
- unsigned int len;
- int crypttype;
- char cryptkey[16];
- union
- {
- FeaturesTag features;
- AstCursorTag cursorInfo;
- } parameter;
-};
-
-class SimpleVideoPuller
-{
- public:
- SimpleVideoPuller() : imageInfo(){};
-
- void initialize()
- {
- std::cout << "Opening /dev/video\n";
- videoFd = open("/dev/video", O_RDWR);
- if (videoFd == 0)
- {
- std::cout << "Failed to open /dev/video\n";
- throw std::runtime_error("Failed to open /dev/video");
- }
- std::cout << "Opened successfully\n";
- }
-
- RawVideoBuffer readVideo()
- {
- assert(videoFd != 0);
- RawVideoBuffer raw;
-
- imageInfo.doImageRefresh = 1; // full frame refresh
- imageInfo.qcValid = 0; // quick cursor disabled
- imageInfo.parameter.features.buf =
- reinterpret_cast<unsigned char *>(raw.buffer.data());
- imageInfo.crypttype = -1;
- std::cout << "Writing\n";
-
- int status;
- /*
- status = write(videoFd, reinterpret_cast<char*>(&imageInfo),
- sizeof(imageInfo));
- if (status != sizeof(imageInfo)) {
- std::cout << "Write failed. Return: " << status << "\n";
- perror("perror output:");
- }
-
- std::cout << "Write done\n";
- */
- std::cout << "Reading\n";
- status = read(videoFd, reinterpret_cast<char *>(&imageInfo),
- sizeof(imageInfo));
- std::cout << "Done reading\n";
-
- if (status != 0)
- {
- std::cerr << "Read failed with status " << status << "\n";
- }
-
- raw.buffer.resize(imageInfo.len);
-
- raw.height = imageInfo.parameter.features.h;
- raw.width = imageInfo.parameter.features.w;
- if (imageInfo.parameter.features.jpgFmt == 422)
- {
- raw.mode = YuvMode::YUV420;
- }
- else
- {
- raw.mode = YuvMode::YUV444;
- }
- return raw;
- }
-
- private:
- int videoFd{};
- ImageInfo imageInfo;
-};
-
-#if defined(BOOST_ASIO_HAS_POSIX_STREAM_DESCRIPTOR)
-class AsyncVideoPuller
-{
- public:
- using video_callback = std::function<void(RawVideoBuffer &)>;
-
- explicit AsyncVideoPuller(boost::asio::io_context &ioService) :
- imageInfo(), devVideo(ioService, open("/dev/video", O_RDWR))
- {
- videobuf = std::make_shared<RawVideoBuffer>();
-
- imageInfo.doImageRefresh = 1; // full frame refresh
- imageInfo.qcValid = 0; // quick cursor disabled
- imageInfo.parameter.features.buf =
- reinterpret_cast<unsigned char *>(videobuf->buffer.data());
- imageInfo.crypttype = -1;
- };
-
- void registerCallback(video_callback &callback)
- {
- std::lock_guard<std::mutex> lock(callbackMutex);
- callbacks.push_back(callback);
- startRead();
- }
-
- void startRead()
- {
- auto mutableBuffer = boost::asio::buffer(&imageInfo, sizeof(imageInfo));
- boost::asio::async_read(devVideo, mutableBuffer,
- [this](const boost::system::error_code &ec,
- std::size_t bytes_transferred) {
- if (ec)
- {
- std::cerr << "Read failed with status "
- << ec << "\n";
- }
- else
- {
- this->readDone();
- }
- });
- }
-
- void readDone()
- {
- std::cout << "Done reading\n";
- videobuf->buffer.resize(imageInfo.len);
-
- videobuf->height = imageInfo.parameter.features.h;
- videobuf->width = imageInfo.parameter.features.w;
- if (imageInfo.parameter.features.jpgFmt == 422)
- {
- videobuf->mode = YuvMode::YUV420;
- }
- else
- {
- videobuf->mode = YuvMode::YUV444;
- }
- std::lock_guard<std::mutex> lock(callbackMutex);
- for (auto &callback : callbacks)
- {
- // TODO(ed) call callbacks async and double buffer frames
- callback(*videobuf);
- }
- }
-
- private:
- std::shared_ptr<RawVideoBuffer> videobuf;
- boost::asio::posix::stream_descriptor devVideo;
- ImageInfo imageInfo;
- std::mutex callbackMutex;
- std::vector<video_callback> callbacks;
-};
-#endif // defined(BOOST_ASIO_HAS_POSIX_STREAM_DESCRIPTOR)
-} // namespace ast_video
diff --git a/include/ast_video_types.hpp b/include/ast_video_types.hpp
deleted file mode 100644
index aeef1d8..0000000
--- a/include/ast_video_types.hpp
+++ /dev/null
@@ -1,25 +0,0 @@
-#pragma once
-
-#include <cstdint>
-#include <vector>
-namespace ast_video
-{
-enum class YuvMode
-{
- YUV444 = 0,
- YUV420 = 1
-};
-
-class RawVideoBuffer
-{
- public:
- RawVideoBuffer() : buffer(1024 * 1024 * 10, 0){};
- unsigned long height{};
- unsigned long width{};
- int ySelector{};
- int uvSelector{};
- YuvMode mode;
- // TODO(ed) determine a more appropriate buffer size
- std::vector<uint32_t> buffer;
-};
-} // namespace ast_video
\ No newline at end of file