Critical Link MityCam SoC Firmware
1.0
Critical Link MityCam SoC Firmware
|
Camera Output IO channel management class. More...
#include <IOChannel.h>
Public Member Functions | |
tcIOChannel (SocCamera::teIOChannels aeIOId, SocCamera::tcSensorBoard *apSensor) | |
Construct a new tcIOChannel::tcIOChannel object. More... | |
virtual | ~tcIOChannel () |
virtual SocCamera::teNackCode | capture (tsCaptureRequest asRequest)=0 |
virtual SocCamera::teNackCode | setBpp (SocCamera::teBPPMode aeBppMode)=0 |
virtual void | initialized () |
SocCamera::teBPPMode | getBpp () |
virtual void | sendUpdate (tsNewFrameMsg *apMsg)=0 |
virtual void | processUpdate (tsNewFrameMsg *apMsg) |
void | setEnable (bool abEnable) |
tcImage * | grabImage () |
SocCamera::teIOChannels | id () |
virtual void | invalidateCache (void *apMem, size_t anSize) |
virtual void * | memory () |
Public Member Functions inherited from tcIOCallback | |
tcIOCallback () | |
virtual | ~tcIOCallback () |
Protected Member Functions | |
void | invalidateCache (tsNewFrameMsg *apMsg) |
void | invalidateCache () |
void | Report (const char *fmt,...) |
This method routes text to stderr. More... | |
void | ReportError (const char *fmt,...) |
Protected Attributes | |
std::string | m_name |
SocCamera::teIOChannels | meIOId |
SocCamera::tcSensorBoard * | mpSensor |
SocCamera::teBPPMode | meBppMode |
int64 | mnImgCount |
std::list< tsNewFrameMsg > | mlUpdates |
tcMutex | mcMutex |
tcCondition | mcCond |
void * | mpMemory |
tcIOChannelThread | mcThread |
tsNewFrameMsg | msLastUpdate |
bool | mbSimRAM |
Static Protected Attributes | |
static uint32 | CAPTURE_START_ADDR = (0x20000000) |
static uint32 | MEMORY_BLOCK_SIZE = (0x20000000) |
static bool | CMEM_USED = (true) |
static bool | MMAP_USED = (true) |
Friends | |
class | tcIOChannelThread |
Camera Output IO channel management class.
The tcIOChannel provides a base class abstraction for C++ class that are responsible for taking received sensor streaming image data and routing it to an output channel. Output channels might include USB or ethernet endpoints, or HDMI endpoints, or even custom processing blocks.
Multiple tcIOChannels may exist within a camera design in order to support processing the sensor data for multiple output paths, such as EVKs that transmit data to a U3V (USB 3) interface as well as provide previews on an HDMI output, etc.
tcIOChannel::tcIOChannel | ( | SocCamera::teIOChannels | aeIOId, |
SocCamera::tcSensorBoard * | apSensor | ||
) |
Construct a new tcIOChannel::tcIOChannel object.
aeIOId | The type of IO channel being constructed. |
apSensor | a pointer to the tcSensorBoard sensor interface, keeper of the tcRAMStreamer object. |
This section of code allocates or reserves a block of memory for the Sensor FPGA pipeline to stream images / data into and provides it to the tcRAMStreamer() (or a class derived from it). Memory is only allocated 1 time, so only the first constructor of multiple tcIOChannel instances will perform allocation.
Memory allocation can occur using a couple of mechanisms: (1) If the processor needs to access the streamed data, then TI's LUDEV / CMEM library is generally the preferred method, as it supports mapping the memory as cached and includes invalidation IO calls. (2) If CMEM is not available then we'll try to mmap() it using /dev/mem. This is slower, as the memory will not be cacheable.
(3) If the memory does not need to be accessed by the processor (e.g., it is buffered, but transmitted directly by the FPGA. In some cases the FPGA can access memory regions that processors, such as the top 1GB of memory in the Intel Cyclone V or Arria 10 SoC devices), this will simply note the physical memory location and pass it to the streamer object.
It would seem that this code might be better placed in the constructor / initializer of the tcSensorBoard->tcRAMStreamer object, however the IO channel threads do need access to the memory pointers in order to extract stream data and manage cache flushingm, etc. At the moment, the design does the memory allocation here.
The original parameters used had been hardcoded. As the software has evolved to support other use cases, most of memory allocation parameters have migrated to an INI file called "ram_cfg.ini".
|
virtual |
|
pure virtual |
Start a capture with this request. If the requests number of frames is tsNewRequest::CANCEL_CAPTURE then the current capture is stopped if possible.
asRequest | - the request for capture being made. |
Implemented in tcMityViewerApp, tcFilesystemIO, SocCamera::tcBufferedCameraLinkIO, tcMemoryIO, SocCamera::tcQueueIO, SocCamera::tcGigEIO, SocCamera::tcU3VIO, and tcCameraLinkIO.
SocCamera::teBPPMode tcIOChannel::getBpp | ( | ) |
Return the currently configured bits-per-pixel setting.
tcImage * tcIOChannel::grabImage | ( | ) |
Copies the latest image captured into memory. The caller assumes responsibility for this image. After grabbing the image, the caller should check if the data is packed or stored as separate 16 bit values.
SocCamera::teIOChannels tcIOChannel::id | ( | ) |
Provide an "isA" test
|
virtual |
|
protected |
|
protected |
|
virtual |
Performs a cache invalidation at the memory location of the size specified.
Implements tcIOCallback.
|
virtual |
memory mapped pointer that can be passed to invalidate cache.
Implements tcIOCallback.
|
virtual |
Enqueues the update for the IOChannelThread to send when possible.
Implements tcIOCallback.
|
protected |
This method routes text to stderr.
|
protected |
Report Error Function This method routes error text to stderr
|
pure virtual |
Actually sends the frame by whatever means; called by the internal thread.
apMsg |
Implemented in tcFilesystemIO, tcMemoryIO, SocCamera::tcBufferedCameraLinkIO, SocCamera::tcQueueIO, tcMityViewerApp, tcCameraLinkIO, SocCamera::tcGigEIO, and SocCamera::tcU3VIO.
|
pure virtual |
Sets the bits-per-pixel output of the camera.
aeBppMode | - the bits per pixel mode. |
Implemented in tcFilesystemIO, SocCamera::tcBufferedCameraLinkIO, SocCamera::tcQueueIO, tcMityViewerApp, tcMemoryIO, tcCameraLinkIO, SocCamera::tcGigEIO, and SocCamera::tcU3VIO.
void tcIOChannel::setEnable | ( | bool | abEnable | ) |
|
friend |
|
staticprotected |
|
staticprotected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
staticprotected |
|
protected |
|
staticprotected |
|
protected |
|
protected |
|
protected |
|
protected |