Critical Link MityCam SoC Firmware  1.0
Critical Link MityCam SoC Firmware
MemoryIO.h
Go to the documentation of this file.
1 #ifndef MEMORYIO_H
2 #define MEMORYIO_H
3 
4 #include <string>
5 #include <unistd.h>
6 #include <list>
7 
8 #include "CameraTypes.h"
9 #include "IOChannel.h"
10 #include "Sensors/SensorBoard.h"
11 #include "Utility/Types.h"
12 
13 // Observer class for the MemoryIO channel. has hooks incase the subclasser doesn't care about a specific operation.
15 public:
16  virtual void onDataReady(const tcImage &arImage, uint32_t anPhysAddr) {}
21  virtual void onErrorDetected(SocCamera::teNackCode aeError) {}
22 
23 };
24 
29 class tcMemoryIO: public tcIOChannel
30 {
31 public:
33  virtual ~tcMemoryIO();
34 
38  void registerWatcher(tcMemoryIOWatcher *apWatcher);
39 
43  void unregisterWatcher(tcMemoryIOWatcher *apWatcher);
44 
56 
63 
68  virtual void sendUpdate(tsNewFrameMsg *apMsg);
69 
79  uint32_t getCurrentFrameIndex();
80 
81  bool getCheckFrameIndex() const { return mbCheckFrameIndex; }
82  void setCheckFrameIndex(bool abCheckFrameIndex) { mbCheckFrameIndex = abCheckFrameIndex; }
83  bool getResyncOnFrameMisMatch() const { return mbResyncOnFrameMisMatch; }
84  void setResyncOnFrameMisMatch(bool abResyncOnFrameMisMatch) { mbResyncOnFrameMisMatch = abResyncOnFrameMisMatch; }
85 
86 private:
87  void closeAll();
91  void updateWatchers(tsNewFrameMsg *apMsg);
92 
93  bool mbIsOpen;
94  bool mbOutputting;
95  bool mbCancel;
96  //tcMutex mcFileMutex;
97  uint32_t mnCurrentHeaderIndex;
98  size_t mnBufferSize;
99  uint8_t* mpIntermediateBuffer;
100 
101  std::list<tcMemoryIOWatcher*> mcWatcherList;
102 
103  uint32_t mnImagesToWrite;
104  uint32_t mnImagesWritten;
105  bool mbCheckFrameIndex;
106  bool mbResyncOnFrameMisMatch;
107 };
108 
109 #endif // MEMORYIO_H
tcMemoryIO::capture
virtual SocCamera::teNackCode capture(tsCaptureRequest asRequest)
start capture
Definition: MemoryIO.cpp:48
Types.h
tcMemoryIO::issueWriteError
void issueWriteError(SocCamera::teNackCode aeError)
issueWriteError notify observers of error condition
Definition: MemoryIO.cpp:206
SensorBoard.h
CameraTypes.h
tcMemoryIOWatcher::onErrorDetected
virtual void onErrorDetected(SocCamera::teNackCode aeError)
Definition: MemoryIO.h:21
SocCamera::teNackCode
teNackCode
Definition: CameraTypes.h:62
tcIOChannel
Camera Output IO channel management class.
Definition: IOChannel.h:34
SocCamera::teBPPMode
teBPPMode
Definition: CameraTypes.h:133
tcMemoryIO::setBpp
virtual SocCamera::teNackCode setBpp(SocCamera::teBPPMode aeBppMode)
Definition: MemoryIO.cpp:97
tcMemoryIO::unregisterWatcher
void unregisterWatcher(tcMemoryIOWatcher *apWatcher)
Definition: MemoryIO.cpp:197
tcMemoryIO::getResyncOnFrameMisMatch
bool getResyncOnFrameMisMatch() const
Definition: MemoryIO.h:83
tcMemoryIO
Definition: MemoryIO.h:29
tcMemoryIOWatcher::onDataReady
virtual void onDataReady(const tcImage &arImage, uint32_t anPhysAddr)
Definition: MemoryIO.h:16
tcMemoryIO::getCurrentFrameIndex
uint32_t getCurrentFrameIndex()
Definition: MemoryIO.cpp:177
tcMemoryIO::getCheckFrameIndex
bool getCheckFrameIndex() const
Definition: MemoryIO.h:81
tcMemoryIOWatcher
Definition: MemoryIO.h:14
tcImage
Definition: Image.h:34
tcMemoryIO::sendUpdate
virtual void sendUpdate(tsNewFrameMsg *apMsg)
Definition: MemoryIO.cpp:106
tcMemoryIO::setCheckFrameIndex
void setCheckFrameIndex(bool abCheckFrameIndex)
Definition: MemoryIO.h:82
tsNewFrameMsg
Definition: IOCallback.h:11
SocCamera::tcSensorBoard
Definition: SensorBoard.h:40
tcMemoryIO::setResyncOnFrameMisMatch
void setResyncOnFrameMisMatch(bool abResyncOnFrameMisMatch)
Definition: MemoryIO.h:84
tcMemoryIO::tcMemoryIO
tcMemoryIO(SocCamera::tcSensorBoard *apSensor)
Definition: MemoryIO.cpp:22
tcMemoryIO::~tcMemoryIO
virtual ~tcMemoryIO()
Definition: MemoryIO.cpp:37
tsCaptureRequest
Definition: IOCallback.h:56
IOChannel.h
tcMemoryIO::registerWatcher
void registerWatcher(tcMemoryIOWatcher *apWatcher)
Definition: MemoryIO.cpp:192