eGrabber Recorder Reference  24.06.0.14
EGrabberRecorder.h
Go to the documentation of this file.
1 /* Copyright Euresys 2020 */
2 
3 #ifndef ERECORDERLIBRARY_H
4 #define ERECORDERLIBRARY_H
5 
6 #include "ERecorder.h"
7 #include "internal/dynamicLibrary.h"
8 #include "internal/defaultPath.h"
9 
10 #include <string>
11 #include <vector>
12 #include <sstream>
13 
14 #ifndef ERECORDERLIBRARY_WITH_PROGRESS_REPORT
15 #if __cplusplus >= 201103L
16 #define ERECORDERLIBRARY_WITH_PROGRESS_REPORT 1
17 #else
18 #define ERECORDERLIBRARY_WITH_PROGRESS_REPORT 0
19 #endif
20 #endif
21 
22 #if ERECORDERLIBRARY_WITH_PROGRESS_REPORT
23 #include <atomic>
24 #endif
25 
30 namespace Euresys {
31 namespace EGrabberRecorder {
32 
39 class RecorderError: public std::runtime_error {
41 public:
43  explicit RecorderError(RECORDER_STATUS status, const std::string &description);
45 };
46 
48 class UnknownError: public RecorderError {
49 public:
51 };
52 
55 public:
57 };
58 
61 public:
63 };
64 
67 public:
69 };
70 
73 public:
75 };
76 
79 public:
81 };
82 
84 class SystemError: public RecorderError {
85 public:
87 };
88 
91 public:
93 };
94 
96 class DataFileFull: public RecorderError {
97 public:
99 };
100 
103 public:
105 };
106 
109 public:
111 };
112 
115 public:
117 };
118 
121 public:
123 };
124 
127 public:
129 };
130 
133 public:
135 };
136 
139 public:
141 };
142 
145 public:
147 };
148 
151 public:
153 };
154 
157 public:
159 };
160 
162 class EndOfData: public RecorderError {
163 public:
165 };
166 
169 public:
171 };
172 
174 class NoContainer: public RecorderError {
175 public:
177 };
178 
181 public:
183 };
184 
186 class NoLicense: public RecorderError {
187 public:
189 };
190 
193 public:
195 };
196 
199 public:
201 };
202 
204 class Aborted : public RecorderError {
205 public:
207 };
208 
211 public:
213 };
214 
217 public:
219 };
220 
223 public:
225 };
226 
229 public:
231 };
232 
235 public:
237 };
238 
239 class RecorderLibrary;
240 
246 class Recorder {
247 public:
248 #if __cplusplus >= 201103L
249  Recorder(const Recorder &) = delete;
250  Recorder(Recorder &&);
251  Recorder &operator=(const Recorder &) = delete;
253 #else
254  Recorder(const Recorder &);
256 #endif
257  explicit Recorder(RecorderLibrary &recorderLibrary, RECORDER_HANDLE handle,
259  RECORDER_CLOSE_MODE closeMode);
261  virtual ~Recorder();
263  operator bool() const;
265  void close();
267  void close(RECORDER_CLOSE_MODE closeMode);
269  std::string getParameterString(RECORDER_PARAMETER parameter);
271  void setParameterString(RECORDER_PARAMETER parameter, const std::string &value);
275  void setParameterInteger(RECORDER_PARAMETER parameter, int64_t value);
277  void write(const RECORDER_BUFFER_INFO *info, const void *buffer);
278  // read data from the container into a user buffer (@ref RecorderRead)
279  size_t read(RECORDER_BUFFER_INFO *info, void *buffer, size_t bufferSize);
280  // read data from the container (@ref RecorderRead)
281  std::vector<char> read(RECORDER_BUFFER_INFO *info = 0);
282  // export images from the container (@ref RecorderExport)
283  size_t exportImages(const std::string &path, size_t count, uint32_t exportPixelFormat = 0);
284  // start a new chapter (@ref RecorderStartChapter)
285  void startChapter(const std::string &name = "", const std::string &info = "");
286 
287 #if ERECORDERLIBRARY_WITH_PROGRESS_REPORT
288  struct Progress {
289  size_t index;
290  size_t count;
291  bool working;
292  };
293  Progress getProgress() const;
294  void abort();
295 #endif
296 
297 private:
298  RecorderLibrary *recorderLibrary;
299  RECORDER_HANDLE handle;
300  RECORDER_CLOSE_MODE closeMode;
301 #if ERECORDERLIBRARY_WITH_PROGRESS_REPORT
302  static int progressCallback(void *context, RECORDER_PROGRESS_STATE state, size_t index, size_t count);
303  std::atomic<Progress> currentProgress;
304  std::atomic<bool> abortFlag;
305 #endif
306 };
307 
312 public:
313  explicit RecorderLibrary(const std::string &path = getDefaultPath())
314  : dynlib(path)
315  , initLib(reinterpret_cast<FnRecorderInitLib>(dynlib.getSymbol("RecorderInitLib")))
316  , closeLib(reinterpret_cast<FnRecorderCloseLib>(dynlib.getSymbol("RecorderCloseLib")))
317  , open(reinterpret_cast<FnRecorderOpen>(dynlib.getSymbol("RecorderOpen")))
318  , close(reinterpret_cast<FnRecorderClose>(dynlib.getSymbol("RecorderClose")))
319  , setParameterString(reinterpret_cast<FnRecorderSetParameterString>(dynlib.getSymbol("RecorderSetParameterString")))
320  , getParameterString(reinterpret_cast<FnRecorderGetParameterString>(dynlib.getSymbol("RecorderGetParameterString")))
321  , setParameterInteger(reinterpret_cast<FnRecorderSetParameterInteger>(dynlib.getSymbol("RecorderSetParameterInteger")))
322  , getParameterInteger(reinterpret_cast<FnRecorderGetParameterInteger>(dynlib.getSymbol("RecorderGetParameterInteger")))
323  , read(reinterpret_cast<FnRecorderRead>(dynlib.getSymbol("RecorderRead")))
324  , write(reinterpret_cast<FnRecorderWrite>(dynlib.getSymbol("RecorderWrite")))
325  , exportImages(reinterpret_cast<FnRecorderExport>(dynlib.getSymbol("RecorderExport")))
326  , startChapter(reinterpret_cast<FnRecorderStartChapter>(dynlib.getSymbol("RecorderStartChapter"))) {
327  initLibrary();
328  }
329  virtual ~RecorderLibrary() {
330  closeLib();
331  }
332 
333  void initLibrary() {
334  RecorderError::check(initLib());
335  }
336 
337  void closeLibrary() {
338  RecorderError::check(closeLib());
339  }
340 
342  Recorder openRecorder(const std::string &path, RECORDER_OPEN_MODE mode,
343  RECORDER_CLOSE_MODE closeMode = RECORDER_CLOSE_MODE_TRIM, uint32_t *fileVersion = 0) {
344  RECORDER_HANDLE handle = 0;
345  RecorderError::check(open(path.c_str(), mode, &handle, fileVersion));
346  return Recorder(*this, handle, closeMode);
347  }
348 
349  static std::string getDefaultPath() {
350  std::string path(Internal::getDefaultLibraryPath());
351  if (path.empty()) {
352  throw std::runtime_error("No default recorder library path");
353  }
354  return path;
355  }
356 
357 private:
358  Internal::DynamicLibrary dynlib;
359  FnRecorderInitLib initLib;
360  FnRecorderCloseLib closeLib;
361 public:
362  FnRecorderOpen open;
363  FnRecorderClose close;
364  FnRecorderSetParameterString setParameterString;
365  FnRecorderGetParameterString getParameterString;
366  FnRecorderSetParameterInteger setParameterInteger;
367  FnRecorderGetParameterInteger getParameterInteger;
368  FnRecorderRead read;
369  FnRecorderWrite write;
370  FnRecorderExport exportImages;
371  FnRecorderStartChapter startChapter;
372 };
373 
376 inline void RecorderError::check(RECORDER_STATUS status) {
377  switch (status) {
378  case RECORDER_STATUS_OK:
379  break;
381  throw UnknownError();
383  throw UnknownParameter();
385  throw InvalidParameterType();
387  throw InvalidParameterValue();
389  throw BufferTooSmall();
391  throw ParameterIsReadOnly();
393  throw SystemError();
395  throw InvalidContainerPath();
397  throw DataFileFull();
399  throw OperationNotAllowed();
401  throw IndexOutOfRange();
403  throw InvalidIndexData();
405  throw InvalidIndexSize();
409  throw InvalidIndexHeader();
411  throw InvalidLengthWritten();
413  throw NotInitialized();
415  throw InvalidHandle();
417  throw ResourceInUse();
419  throw EndOfData();
421  throw InvalidArgument();
423  throw NoContainer();
425  throw LicenseManagerError();
427  throw NoLicense();
429  throw ImageConversionError();
433  throw Aborted();
435  throw InvalidDataSize();
437  throw InvalidChapterCharacter();
439  throw ReservedChapterName();
441  throw ChapterNameAlreadyUsed();
443  throw ChapterNameTooLong();
444  default: {
445  std::stringstream ss;
446  ss << "RecorderError(RECORDER_STATUS=" << status << ")";
447  throw RecorderError(status, ss.str());
448  }
449  }
450 }
451 
452 inline RecorderError::RecorderError(RECORDER_STATUS status, const std::string &description)
453  : std::runtime_error(description)
454  , status(status)
455 {}
456 
457 #define EGRABBER_RECORDER_ERROR_CTOR(error, status) \
458  inline error::error(): RecorderError(status, #error){}
459 
460 EGRABBER_RECORDER_ERROR_CTOR(UnknownError, RECORDER_STATUS_UNKNOWN_ERROR);
461 EGRABBER_RECORDER_ERROR_CTOR(UnknownParameter, RECORDER_STATUS_UNKNOWN_PARAMETER);
462 EGRABBER_RECORDER_ERROR_CTOR(InvalidParameterType, RECORDER_STATUS_INVALID_PARAMETER_TYPE);
463 EGRABBER_RECORDER_ERROR_CTOR(InvalidParameterValue, RECORDER_STATUS_INVALID_PARAMETER_VALUE);
464 EGRABBER_RECORDER_ERROR_CTOR(BufferTooSmall, RECORDER_STATUS_BUFFER_TOO_SMALL);
465 EGRABBER_RECORDER_ERROR_CTOR(ParameterIsReadOnly, RECORDER_STATUS_PARAMETER_IS_READ_ONLY);
466 EGRABBER_RECORDER_ERROR_CTOR(SystemError, RECORDER_STATUS_SYSTEM_ERROR);
467 EGRABBER_RECORDER_ERROR_CTOR(InvalidContainerPath, RECORDER_STATUS_INVALID_CONTAINER_PATH);
468 EGRABBER_RECORDER_ERROR_CTOR(DataFileFull, RECORDER_STATUS_DATA_FILE_FULL);
469 EGRABBER_RECORDER_ERROR_CTOR(OperationNotAllowed, RECORDER_STATUS_OPERATION_NOT_ALLOWED);
470 EGRABBER_RECORDER_ERROR_CTOR(IndexOutOfRange, RECORDER_STATUS_INDEX_OUT_OF_RANGE);
471 EGRABBER_RECORDER_ERROR_CTOR(InvalidIndexData, RECORDER_STATUS_INVALID_INDEX_DATA);
472 EGRABBER_RECORDER_ERROR_CTOR(InvalidIndexSize, RECORDER_STATUS_INVALID_INDEX_SIZE);
473 EGRABBER_RECORDER_ERROR_CTOR(UnsupportedDatabaseVersion, RECORDER_STATUS_UNSUPPORTED_DATABASE_VERSION);
474 EGRABBER_RECORDER_ERROR_CTOR(InvalidIndexHeader, RECORDER_STATUS_INVALID_INDEX_HEADER);
475 EGRABBER_RECORDER_ERROR_CTOR(InvalidLengthWritten, RECORDER_STATUS_INVALID_LENGTH_WRITTEN);
476 EGRABBER_RECORDER_ERROR_CTOR(NotInitialized, RECORDER_STATUS_NOT_INITIALIZED);
477 EGRABBER_RECORDER_ERROR_CTOR(InvalidHandle, RECORDER_STATUS_INVALID_HANDLE);
478 EGRABBER_RECORDER_ERROR_CTOR(ResourceInUse, RECORDER_STATUS_RESOURCE_IN_USE);
479 EGRABBER_RECORDER_ERROR_CTOR(EndOfData, RECORDER_STATUS_END_OF_DATA);
480 EGRABBER_RECORDER_ERROR_CTOR(InvalidArgument, RECORDER_STATUS_INVALID_ARGUMENT);
481 EGRABBER_RECORDER_ERROR_CTOR(NoContainer, RECORDER_STATUS_NO_CONTAINER);
482 EGRABBER_RECORDER_ERROR_CTOR(LicenseManagerError, RECORDER_STATUS_LICENSE_MANAGER_ERROR);
483 EGRABBER_RECORDER_ERROR_CTOR(NoLicense, RECORDER_STATUS_NO_LICENSE);
484 EGRABBER_RECORDER_ERROR_CTOR(ImageConversionError, RECORDER_STATUS_IMAGE_CONVERSION_ERROR);
485 EGRABBER_RECORDER_ERROR_CTOR(UnsupportedImageFormatError, RECORDER_STATUS_UNSUPPORTED_IMAGE_FORMAT);
486 EGRABBER_RECORDER_ERROR_CTOR(Aborted, RECORDER_STATUS_ABORTED);
487 EGRABBER_RECORDER_ERROR_CTOR(InvalidDataSize, RECORDER_STATUS_INVALID_DATA_SIZE);
488 EGRABBER_RECORDER_ERROR_CTOR(InvalidChapterCharacter, RECORDER_STATUS_INVALID_CHAPTER_CHARACTER);
489 EGRABBER_RECORDER_ERROR_CTOR(ReservedChapterName, RECORDER_STATUS_RESERVED_CHAPTER_NAME);
490 EGRABBER_RECORDER_ERROR_CTOR(ChapterNameAlreadyUsed, RECORDER_STATUS_CHAPTER_NAME_ALREADY_USED);
491 EGRABBER_RECORDER_ERROR_CTOR(ChapterNameTooLong, RECORDER_STATUS_CHAPTER_NAME_TOO_LONG);
492 
493 #if __cplusplus >= 201103L
494 inline Recorder::Recorder(Recorder &&other)
495  : recorderLibrary(other.recorderLibrary)
496  , handle(other.handle)
497  , closeMode(other.closeMode)
499  , currentProgress(other.currentProgress.load())
500  , abortFlag(other.abortFlag.load())
501 #endif
502 {
503  other.handle = 0;
504 }
505 
506 inline Recorder &Recorder::operator=(Recorder &&other) {
507  if (&other == this) {
508  return *this;
509  }
510 
511  std::swap(recorderLibrary, other.recorderLibrary);
512  std::swap(handle, other.handle);
513  std::swap(closeMode, other.closeMode);
514 
515 #if ERECORDERLIBRARY_WITH_PROGRESS_REPORT
516  currentProgress = other.currentProgress.load();
517  abortFlag = other.abortFlag.load();
518 #endif
519 
520  return *this;
521 }
522 #endif
523 
524 inline Recorder::Recorder(RecorderLibrary &recorderLibrary, RECORDER_HANDLE handle,
525  RECORDER_CLOSE_MODE closeMode)
526  : recorderLibrary(&recorderLibrary)
527  , handle(handle)
528  , closeMode(closeMode)
530  , currentProgress({0, 0, false})
531  , abortFlag(false)
532 #endif
533 {}
534 inline Recorder::~Recorder() {
535  try {
536  close();
537  } catch (...) {
538  }
539 }
540 inline void Recorder::close() {
541  close(closeMode);
542 }
543 inline void Recorder::close(RECORDER_CLOSE_MODE mode) {
544  if (handle) {
545  RecorderError::check(recorderLibrary->close(handle, mode));
546  handle = 0;
547  }
548 }
549 inline Recorder::operator bool() const {
550  return handle != 0;
551 }
552 inline std::string Recorder::getParameterString(RECORDER_PARAMETER parameter) {
553  std::vector<char> value(128);
554  size_t size = value.size();
555  RECORDER_STATUS status = recorderLibrary->getParameterString(handle, parameter, &value[0], &size);
556  if (status == RECORDER_STATUS_BUFFER_TOO_SMALL) {
557  RecorderError::check(recorderLibrary->getParameterString(handle, parameter, 0, &size));
558  value.resize(size);
559  status = recorderLibrary->getParameterString(handle, parameter, &value[0], &size);
560  }
561  RecorderError::check(status);
562  return (size) ? std::string(&value[0]) : std::string();
563 }
564 inline void Recorder::setParameterString(RECORDER_PARAMETER parameter, const std::string &value) {
565  RecorderError::check(recorderLibrary->setParameterString(handle, parameter, value.c_str()));
566 }
567 inline int64_t Recorder::getParameterInteger(RECORDER_PARAMETER parameter) {
568  int64_t value = 0;
569  RecorderError::check(recorderLibrary->getParameterInteger(handle, parameter, &value));
570  return value;
571 }
572 inline void Recorder::setParameterInteger(RECORDER_PARAMETER parameter, int64_t value) {
573  RecorderError::check(recorderLibrary->setParameterInteger(handle, parameter, value));
574 }
575 inline void Recorder::write(const RECORDER_BUFFER_INFO *info, const void *buffer) {
576  RecorderError::check(recorderLibrary->write(handle, info, buffer, 0, 0, 0));
577 }
578 inline size_t Recorder::read(RECORDER_BUFFER_INFO *info, void *buffer, size_t bufferSize) {
579  size_t size = bufferSize;
580  RecorderError::check(recorderLibrary->read(handle, info, buffer, &size, 0));
581  return size;
582 }
583 inline std::vector<char> Recorder::read(RECORDER_BUFFER_INFO *info) {
584  size_t size = 0;
585  RecorderError::check(recorderLibrary->read(handle, 0, 0, &size, 0));
586  std::vector<char> data(size ? size : 1);
587  RecorderError::check(recorderLibrary->read(handle, info, &data[0], &size, 0));
588  data.resize(size);
589  return data;
590 }
591 inline size_t Recorder::exportImages(const std::string &path, size_t count, uint32_t exportPixelFormat) {
592 #if ERECORDERLIBRARY_WITH_PROGRESS_REPORT
593  RecorderError::check(recorderLibrary->exportImages(handle, path.c_str(), &count, exportPixelFormat, 0, &progressCallback, this));
594 #else
595  RecorderError::check(recorderLibrary->exportImages(handle, path.c_str(), &count, exportPixelFormat, 0, 0, 0));
596 #endif
597  return count;
598 }
599 inline void Recorder::startChapter(const std::string &name, const std::string &info) {
600  RecorderError::check(recorderLibrary->startChapter(handle, name.c_str(), info.c_str()));
601 }
602 
603 
604 #if ERECORDERLIBRARY_WITH_PROGRESS_REPORT
605 inline int Recorder::progressCallback(void *context, RECORDER_PROGRESS_STATE state, size_t index, size_t count) {
606  Recorder *recorder = reinterpret_cast<Recorder *>(context);
607  if (recorder) {
608  if (state == RECORDER_PROGRESS_STATE_STARTING) {
609  recorder->currentProgress.store({0, 0, true});
610  recorder->abortFlag.store(false);
611  } else if (state == RECORDER_PROGRESS_STATE_ONGOING) {
612  recorder->currentProgress.store({index, count, true});
613  if (recorder->abortFlag.load()) {
614  return -1;
615  }
616  } else if (state == RECORDER_PROGRESS_STATE_ENDING) {
617  Progress finished(recorder->currentProgress.load());
618  finished.working = false;
619  recorder->currentProgress.store(finished);
620  }
621  }
622  return 0;
623 }
624 inline Recorder::Progress Recorder::getProgress() const {
625  return currentProgress.load();
626 }
627 inline void Recorder::abort() {
628  abortFlag.store(true);
629 }
630 #endif
631 
636 } // namespace EGrabberRecorder
637 } // namespace Euresys
638 
639 #endif
Euresys::EGrabberRecorder::RECORDER_STATUS_PARAMETER_IS_READ_ONLY
@ RECORDER_STATUS_PARAMETER_IS_READ_ONLY
The recorder parameter is read-only.
Definition: ERecorder.h:51
Euresys::EGrabberRecorder::UnsupportedDatabaseVersion
Unsupported database version error (RECORDER_STATUS_UNSUPPORTED_DATABASE_VERSION)
Definition: EGrabberRecorder.h:126
Euresys::EGrabberRecorder::IndexOutOfRange
Index out of range error (RECORDER_STATUS_INDEX_OUT_OF_RANGE)
Definition: EGrabberRecorder.h:108
Euresys::EGrabberRecorder::EndOfData
End of data error (RECORDER_STATUS_END_OF_DATA)
Definition: EGrabberRecorder.h:162
Euresys::EGrabberRecorder::ChapterNameTooLong::ChapterNameTooLong
ChapterNameTooLong()
Euresys::EGrabberRecorder::RECORDER_STATUS_CHAPTER_NAME_ALREADY_USED
@ RECORDER_STATUS_CHAPTER_NAME_ALREADY_USED
The chapter name is already used.
Definition: ERecorder.h:75
Euresys::EGrabberRecorder::RECORDER_CLOSE_MODE
unsigned int RECORDER_CLOSE_MODE
Definition: ERecorder.h:133
Euresys::EGrabberRecorder::RECORDER_CLOSE_MODE_TRIM
@ RECORDER_CLOSE_MODE_TRIM
trim the recorder container size when closing the recorder
Definition: ERecorder.h:129
Euresys::EGrabberRecorder::RECORDER_PARAMETER
unsigned int RECORDER_PARAMETER
Definition: ERecorder.h:119
Euresys::EGrabberRecorder::NoLicense
No license (RECORDER_STATUS_NO_LICENSE)
Definition: EGrabberRecorder.h:186
Euresys::EGrabberRecorder::RECORDER_STATUS_INVALID_CHAPTER_CHARACTER
@ RECORDER_STATUS_INVALID_CHAPTER_CHARACTER
The chapter name has an invalid character.
Definition: ERecorder.h:73
Euresys::EGrabberRecorder::RECORDER_STATUS_LICENSE_MANAGER_ERROR
@ RECORDER_STATUS_LICENSE_MANAGER_ERROR
An error occurred in the licenser manager, please contact Euresys support.
Definition: ERecorder.h:67
Euresys::EGrabberRecorder::InvalidIndexSize
Invalid index size error (RECORDER_STATUS_INVALID_INDEX_SIZE)
Definition: EGrabberRecorder.h:120
Euresys::EGrabberRecorder::InvalidIndexData::InvalidIndexData
InvalidIndexData()
Euresys::EGrabberRecorder::InvalidParameterType
Invalid parameter type error (RECORDER_STATUS_INVALID_PARAMETER_TYPE)
Definition: EGrabberRecorder.h:60
Euresys::EGrabberRecorder::RECORDER_PROGRESS_STATE_STARTING
@ RECORDER_PROGRESS_STATE_STARTING
An operation is starting, index and count are not set.
Definition: ERecorder.h:136
Euresys::EGrabberRecorder::InvalidIndexHeader::InvalidIndexHeader
InvalidIndexHeader()
Euresys::EGrabberRecorder::RECORDER_STATUS_UNKNOWN_PARAMETER
@ RECORDER_STATUS_UNKNOWN_PARAMETER
The recorder parameter is unknown.
Definition: ERecorder.h:47
Euresys::EGrabberRecorder::DataFileFull
Data file full error (RECORDER_STATUS_DATA_FILE_FULL)
Definition: EGrabberRecorder.h:96
Euresys::EGrabberRecorder::InvalidParameterType::InvalidParameterType
InvalidParameterType()
Euresys::EGrabberRecorder::ImageConversionError::ImageConversionError
ImageConversionError()
Euresys::EGrabberRecorder::RecorderLibrary
A Recorder library object that loads and unloads the Recorder Library and exposes its low-level funct...
Definition: EGrabberRecorder.h:311
Euresys::EGrabberRecorder::Recorder::exportImages
size_t exportImages(const std::string &path, size_t count, uint32_t exportPixelFormat=0)
Euresys::EGrabberRecorder::RecorderLibrary::setParameterInteger
FnRecorderSetParameterInteger setParameterInteger
Definition: EGrabberRecorder.h:366
Euresys::EGrabberRecorder::BufferTooSmall
Buffer too small error (RECORDER_STATUS_BUFFER_TOO_SMALL)
Definition: EGrabberRecorder.h:72
Euresys::EGrabberRecorder::InvalidParameterValue::InvalidParameterValue
InvalidParameterValue()
Euresys::EGrabberRecorder::SystemError
System error RECORDER_STATUS_SYSTEM_ERROR.
Definition: EGrabberRecorder.h:84
Euresys::EGrabberRecorder::UnknownError
Unknown error (RECORDER_STATUS_UNKNOWN_ERROR)
Definition: EGrabberRecorder.h:48
Euresys::EGrabberRecorder::IndexOutOfRange::IndexOutOfRange
IndexOutOfRange()
Euresys::EGrabberRecorder::ParameterIsReadOnly
Parameter read-only error (RECORDER_STATUS_PARAMETER_IS_READ_ONLY)
Definition: EGrabberRecorder.h:78
Euresys::EGrabberRecorder::UnsupportedImageFormatError
Unsupported image format error (thrown by Recorder::exportImages)
Definition: EGrabberRecorder.h:198
Euresys::EGrabberRecorder::RECORDER_STATUS_INVALID_LENGTH_WRITTEN
@ RECORDER_STATUS_INVALID_LENGTH_WRITTEN
Some data was not completely written to disk (partial write)
Definition: ERecorder.h:61
Euresys::EGrabberRecorder::NotInitialized::NotInitialized
NotInitialized()
Euresys::EGrabberRecorder::RecorderError
A Recorder error (RECORDER_STATUS)
Definition: EGrabberRecorder.h:40
Euresys::EGrabberRecorder::RECORDER_STATUS_INVALID_PARAMETER_VALUE
@ RECORDER_STATUS_INVALID_PARAMETER_VALUE
The recorder parameter value is invalid.
Definition: ERecorder.h:49
Euresys::EGrabberRecorder::S_RECORDER_BUFFER_INFO
Definition: ERecorder.h:80
Euresys::EGrabberRecorder::UnknownParameter::UnknownParameter
UnknownParameter()
Euresys::EGrabberRecorder::InvalidIndexData
Invalid index data error (RECORDER_STATUS_INVALID_INDEX_DATA)
Definition: EGrabberRecorder.h:114
Euresys::EGrabberRecorder::UnknownParameter
Unknown parameter error (RECORDER_STATUS_UNKNOWN_PARAMETER)
Definition: EGrabberRecorder.h:54
Euresys::EGrabberRecorder::RECORDER_PROGRESS_STATE_ONGOING
@ RECORDER_PROGRESS_STATE_ONGOING
An operation is ongoing, index and count are set according to the current progress.
Definition: ERecorder.h:137
Euresys::EGrabberRecorder::OperationNotAllowed::OperationNotAllowed
OperationNotAllowed()
Euresys::EGrabberRecorder::ResourceInUse
Resource in use error (RECORDER_STATUS_RESOURCE_IN_USE)
Definition: EGrabberRecorder.h:156
Euresys::EGrabberRecorder::RECORDER_STATUS_ABORTED
@ RECORDER_STATUS_ABORTED
The current operation has been aborted by the user.
Definition: ERecorder.h:71
Euresys::EGrabberRecorder::Aborted::Aborted
Aborted()
ERECORDERLIBRARY_WITH_PROGRESS_REPORT
#define ERECORDERLIBRARY_WITH_PROGRESS_REPORT
Definition: EGrabberRecorder.h:18
Euresys::EGrabberRecorder::RECORDER_STATUS_RESOURCE_IN_USE
@ RECORDER_STATUS_RESOURCE_IN_USE
The resource is already in use.
Definition: ERecorder.h:63
Euresys::EGrabberRecorder::RECORDER_STATUS_BUFFER_TOO_SMALL
@ RECORDER_STATUS_BUFFER_TOO_SMALL
The destination buffer is too small.
Definition: ERecorder.h:50
Euresys::EGrabberRecorder::RECORDER_PROGRESS_STATE
unsigned int RECORDER_PROGRESS_STATE
Definition: ERecorder.h:140
Euresys::EGrabberRecorder::RecorderLibrary::initLibrary
void initLibrary()
Definition: EGrabberRecorder.h:333
Euresys::EGrabberRecorder::RECORDER_STATUS
int RECORDER_STATUS
Definition: ERecorder.h:78
Euresys::EGrabberRecorder::UnsupportedImageFormatError::UnsupportedImageFormatError
UnsupportedImageFormatError()
Euresys::EGrabberRecorder::ReservedChapterName::ReservedChapterName
ReservedChapterName()
Euresys::EGrabberRecorder::RecorderError::check
static void check(RECORDER_STATUS status)
Euresys::EGrabberRecorder::ReservedChapterName
The chapter name conflicts with a reserved name.
Definition: EGrabberRecorder.h:222
Euresys::EGrabberRecorder::RecorderLibrary::close
FnRecorderClose close
Definition: EGrabberRecorder.h:363
Euresys::EGrabberRecorder::InvalidHandle::InvalidHandle
InvalidHandle()
Euresys::EGrabberRecorder::RecorderLibrary::getParameterString
FnRecorderGetParameterString getParameterString
Definition: EGrabberRecorder.h:365
Euresys::EGrabberRecorder::NoContainer::NoContainer
NoContainer()
Euresys::EGrabberRecorder::RECORDER_STATUS_INVALID_DATA_SIZE
@ RECORDER_STATUS_INVALID_DATA_SIZE
A read operation returned an invalid size (partial read or invalid data file size)
Definition: ERecorder.h:72
Euresys::EGrabberRecorder::RECORDER_STATUS_OK
@ RECORDER_STATUS_OK
The operation completed successfully.
Definition: ERecorder.h:44
Euresys::EGrabberRecorder::Recorder::Recorder
Recorder(const Recorder &)
Euresys::EGrabberRecorder::RecorderLibrary::getDefaultPath
static std::string getDefaultPath()
Definition: EGrabberRecorder.h:349
Euresys::EGrabberRecorder::RECORDER_STATUS_INVALID_HANDLE
@ RECORDER_STATUS_INVALID_HANDLE
The record handle is invalid.
Definition: ERecorder.h:62
Euresys::EGrabberRecorder::Recorder::getParameterString
std::string getParameterString(RECORDER_PARAMETER parameter)
get a recorder parameter (RecorderGetParameterString)
Euresys::EGrabberRecorder::ChapterNameAlreadyUsed::ChapterNameAlreadyUsed
ChapterNameAlreadyUsed()
Euresys::EGrabberRecorder::ParameterIsReadOnly::ParameterIsReadOnly
ParameterIsReadOnly()
Euresys::EGrabberRecorder::Recorder::close
void close()
close the recorder using the mode defined when the recorder was created (RecorderClose)
ERecorder.h
Header file for Euresys Recorder Library.
Euresys::EGrabberRecorder::RecorderLibrary::setParameterString
FnRecorderSetParameterString setParameterString
Definition: EGrabberRecorder.h:364
Euresys::EGrabberRecorder::Recorder::~Recorder
virtual ~Recorder()
close a recorder using the mode defined when the recorder was created (RecorderClose)
Euresys::EGrabberRecorder::Recorder::read
std::vector< char > read(RECORDER_BUFFER_INFO *info=0)
Euresys::EGrabberRecorder::RECORDER_STATUS_NOT_INITIALIZED
@ RECORDER_STATUS_NOT_INITIALIZED
The recorder library is not initialized.
Definition: ERecorder.h:45
Euresys::EGrabberRecorder::RECORDER_STATUS_IMAGE_CONVERSION_ERROR
@ RECORDER_STATUS_IMAGE_CONVERSION_ERROR
An image conversion error has occurred.
Definition: ERecorder.h:69
Euresys::EGrabberRecorder::InvalidContainerPath::InvalidContainerPath
InvalidContainerPath()
Euresys::EGrabberRecorder::RECORDER_STATUS_INVALID_CONTAINER_PATH
@ RECORDER_STATUS_INVALID_CONTAINER_PATH
The specified container path is invalid.
Definition: ERecorder.h:53
Euresys::EGrabberRecorder::Recorder::write
void write(const RECORDER_BUFFER_INFO *info, const void *buffer)
write to the container synchronously (RecorderWrite)
Euresys::EGrabberRecorder::ImageConversionError
Image conversion error (RECORDER_STATUS_IMAGE_CONVERSION_ERROR)
Definition: EGrabberRecorder.h:192
Euresys::EGrabberRecorder::InvalidLengthWritten
Invalid length written error (RECORDER_STATUS_INVALID_LENGTH_WRITTEN)
Definition: EGrabberRecorder.h:138
Euresys::EGrabberRecorder::Recorder::setParameterString
void setParameterString(RECORDER_PARAMETER parameter, const std::string &value)
set a recorder parameter (RecorderSetParameterString)
Euresys::EGrabberRecorder::InvalidIndexHeader
Invalid index header error (RECORDER_STATUS_INVALID_INDEX_HEADER)
Definition: EGrabberRecorder.h:132
Euresys::EGrabberRecorder::RECORDER_STATUS_UNSUPPORTED_IMAGE_FORMAT
@ RECORDER_STATUS_UNSUPPORTED_IMAGE_FORMAT
The image format is not supported by the export file.
Definition: ERecorder.h:70
Euresys::EGrabberRecorder::RecorderLibrary::closeLibrary
void closeLibrary()
Definition: EGrabberRecorder.h:337
Euresys::EGrabberRecorder::Recorder
A Recorder object that encapsulates a recorder handle (RECORDER_HANDLE) and exposes higher level reco...
Definition: EGrabberRecorder.h:246
Euresys::EGrabberRecorder::RecorderLibrary::open
FnRecorderOpen open
Definition: EGrabberRecorder.h:362
Euresys::EGrabberRecorder::NotInitialized
Not initialized error (RECORDER_STATUS_NOT_INITIALIZED)
Definition: EGrabberRecorder.h:144
Euresys::EGrabberRecorder::RecorderLibrary::exportImages
FnRecorderExport exportImages
Definition: EGrabberRecorder.h:370
Euresys::EGrabberRecorder::RECORDER_PROGRESS_STATE_ENDING
@ RECORDER_PROGRESS_STATE_ENDING
An operation is ending (successfully or not), index and count are not set.
Definition: ERecorder.h:138
Euresys::EGrabberRecorder::Recorder::operator=
Recorder & operator=(const Recorder &)
Euresys::EGrabberRecorder::LicenseManagerError
License Manager error (RECORDER_STATUS_LICENSE_MANAGER_ERROR)
Definition: EGrabberRecorder.h:180
Euresys::EGrabberRecorder::Recorder::read
size_t read(RECORDER_BUFFER_INFO *info, void *buffer, size_t bufferSize)
Euresys::EGrabberRecorder::InvalidArgument::InvalidArgument
InvalidArgument()
Euresys::EGrabberRecorder::NoContainer
No container in path (RECORDER_STATUS_NO_CONTAINER)
Definition: EGrabberRecorder.h:174
Euresys::EGrabberRecorder::UnsupportedDatabaseVersion::UnsupportedDatabaseVersion
UnsupportedDatabaseVersion()
Euresys::EGrabberRecorder::BufferTooSmall::BufferTooSmall
BufferTooSmall()
Euresys::EGrabberRecorder::RECORDER_STATUS_SYSTEM_ERROR
@ RECORDER_STATUS_SYSTEM_ERROR
A system error has occurred.
Definition: ERecorder.h:52
Euresys::EGrabberRecorder::RECORDER_OPEN_MODE
unsigned int RECORDER_OPEN_MODE
Definition: ERecorder.h:126
Euresys::EGrabberRecorder::RECORDER_STATUS_INVALID_PARAMETER_TYPE
@ RECORDER_STATUS_INVALID_PARAMETER_TYPE
The recorder parameter type is invalid.
Definition: ERecorder.h:48
Euresys::EGrabberRecorder::OperationNotAllowed
Operation not allowed error (RECORDER_STATUS_OPERATION_NOT_ALLOWED)
Definition: EGrabberRecorder.h:102
Euresys::EGrabberRecorder::InvalidChapterCharacter::InvalidChapterCharacter
InvalidChapterCharacter()
Euresys::EGrabberRecorder::Recorder::getParameterInteger
int64_t getParameterInteger(RECORDER_PARAMETER parameter)
get a recorder parameter (RecorderGetParameterInteger)
Euresys::EGrabberRecorder::RecorderError::status
RECORDER_STATUS status
Definition: EGrabberRecorder.h:42
Euresys::EGrabberRecorder::Recorder::startChapter
void startChapter(const std::string &name="", const std::string &info="")
Euresys::EGrabberRecorder::RecorderLibrary::read
FnRecorderRead read
Definition: EGrabberRecorder.h:368
Euresys
Definition: EGrabberRecorder.h:30
Euresys::EGrabberRecorder::RECORDER_STATUS_CHAPTER_NAME_TOO_LONG
@ RECORDER_STATUS_CHAPTER_NAME_TOO_LONG
The chapter name is too long.
Definition: ERecorder.h:76
Euresys::EGrabberRecorder::RECORDER_STATUS_NO_CONTAINER
@ RECORDER_STATUS_NO_CONTAINER
The path does not contain a container and read only access is required.
Definition: ERecorder.h:65
Euresys::EGrabberRecorder::Recorder::close
void close(RECORDER_CLOSE_MODE closeMode)
close the recorder using the given close mode (RecorderClose)
Euresys::EGrabberRecorder::RECORDER_STATUS_UNKNOWN_ERROR
@ RECORDER_STATUS_UNKNOWN_ERROR
An unknown error has occurred.
Definition: ERecorder.h:46
Euresys::EGrabberRecorder::RECORDER_STATUS_OPERATION_NOT_ALLOWED
@ RECORDER_STATUS_OPERATION_NOT_ALLOWED
The operation is not allowed by the recorder open mode.
Definition: ERecorder.h:55
Euresys::EGrabberRecorder::ChapterNameAlreadyUsed
The chapter name is already used.
Definition: EGrabberRecorder.h:228
Euresys::EGrabberRecorder::RECORDER_STATUS_END_OF_DATA
@ RECORDER_STATUS_END_OF_DATA
There is no more record to read in the container.
Definition: ERecorder.h:64
Euresys::EGrabberRecorder::ChapterNameTooLong
The chapter name is too long.
Definition: EGrabberRecorder.h:234
Euresys::EGrabberRecorder::InvalidParameterValue
Invalid parameter value error (RECORDER_STATUS_INVALID_PARAMETER_VALUE)
Definition: EGrabberRecorder.h:66
Euresys::EGrabberRecorder::RecorderLibrary::openRecorder
Recorder openRecorder(const std::string &path, RECORDER_OPEN_MODE mode, RECORDER_CLOSE_MODE closeMode=RECORDER_CLOSE_MODE_TRIM, uint32_t *fileVersion=0)
Open a recorder and return a Recorder object that wraps the opened recorder handle.
Definition: EGrabberRecorder.h:342
Euresys::EGrabberRecorder::RECORDER_STATUS_INVALID_INDEX_DATA
@ RECORDER_STATUS_INVALID_INDEX_DATA
The internal meta-data of the current record is invalid (partial read)
Definition: ERecorder.h:57
Euresys::EGrabberRecorder::RECORDER_STATUS_INVALID_INDEX_HEADER
@ RECORDER_STATUS_INVALID_INDEX_HEADER
The internal meta-data header of the container is invalid.
Definition: ERecorder.h:60
Euresys::EGrabberRecorder::EndOfData::EndOfData
EndOfData()
Euresys::EGrabberRecorder::RECORDER_STATUS_NO_LICENSE
@ RECORDER_STATUS_NO_LICENSE
There is no valid license for this library, please contact Euresys support.
Definition: ERecorder.h:68
Euresys::EGrabberRecorder::RECORDER_HANDLE
void * RECORDER_HANDLE
Definition: ERecorder.h:95
Euresys::EGrabberRecorder::InvalidDataSize
Invalid data size on reading.
Definition: EGrabberRecorder.h:210
Euresys::EGrabberRecorder::RECORDER_BUFFER_INFO
struct Euresys::EGrabberRecorder::S_RECORDER_BUFFER_INFO RECORDER_BUFFER_INFO
Euresys::EGrabberRecorder::InvalidArgument
Invalid argument error (RECORDER_STATUS_INVALID_ARGUMENT)
Definition: EGrabberRecorder.h:168
Euresys::EGrabberRecorder::RECORDER_STATUS_INVALID_INDEX_SIZE
@ RECORDER_STATUS_INVALID_INDEX_SIZE
The internal meta-data size of the container is invalid (partial read or invalid meta-data file size)
Definition: ERecorder.h:58
Euresys::EGrabberRecorder::Aborted
Operation aborted by the user (thrown by Recorder::exportImages)
Definition: EGrabberRecorder.h:204
Euresys::EGrabberRecorder::NoLicense::NoLicense
NoLicense()
Euresys::EGrabberRecorder::RECORDER_STATUS_DATA_FILE_FULL
@ RECORDER_STATUS_DATA_FILE_FULL
The container data file is full.
Definition: ERecorder.h:54
Euresys::EGrabberRecorder::RecorderLibrary::RecorderLibrary
RecorderLibrary(const std::string &path=getDefaultPath())
Definition: EGrabberRecorder.h:313
Euresys::EGrabberRecorder::DataFileFull::DataFileFull
DataFileFull()
Euresys::EGrabberRecorder::RECORDER_STATUS_UNSUPPORTED_DATABASE_VERSION
@ RECORDER_STATUS_UNSUPPORTED_DATABASE_VERSION
The given container is not supported by the recorder library.
Definition: ERecorder.h:59
Euresys::EGrabberRecorder::InvalidChapterCharacter
An invalid character was used in the chapter name.
Definition: EGrabberRecorder.h:216
Euresys::EGrabberRecorder::RecorderLibrary::startChapter
FnRecorderStartChapter startChapter
Definition: EGrabberRecorder.h:371
Euresys::EGrabberRecorder::LicenseManagerError::LicenseManagerError
LicenseManagerError()
Euresys::EGrabberRecorder::SystemError::SystemError
SystemError()
Euresys::EGrabberRecorder::RecorderError::RecorderError
RecorderError(RECORDER_STATUS status, const std::string &description)
Euresys::EGrabberRecorder::InvalidIndexSize::InvalidIndexSize
InvalidIndexSize()
Euresys::EGrabberRecorder::InvalidDataSize::InvalidDataSize
InvalidDataSize()
Euresys::EGrabberRecorder::InvalidHandle
Invalid handle error (RECORDER_STATUS_INVALID_HANDLE)
Definition: EGrabberRecorder.h:150
Euresys::EGrabberRecorder::ResourceInUse::ResourceInUse
ResourceInUse()
Euresys::EGrabberRecorder::RecorderLibrary::~RecorderLibrary
virtual ~RecorderLibrary()
Definition: EGrabberRecorder.h:329
Euresys::EGrabberRecorder::Recorder::setParameterInteger
void setParameterInteger(RECORDER_PARAMETER parameter, int64_t value)
set a recorder parameter (RecorderSetParameterInteger)
Euresys::EGrabberRecorder::RecorderLibrary::write
FnRecorderWrite write
Definition: EGrabberRecorder.h:369
Euresys::EGrabberRecorder::RECORDER_STATUS_INVALID_ARGUMENT
@ RECORDER_STATUS_INVALID_ARGUMENT
A given argument is invalid.
Definition: ERecorder.h:66
Euresys::EGrabberRecorder::InvalidLengthWritten::InvalidLengthWritten
InvalidLengthWritten()
Euresys::EGrabberRecorder::UnknownError::UnknownError
UnknownError()
Euresys::EGrabberRecorder::RECORDER_STATUS_RESERVED_CHAPTER_NAME
@ RECORDER_STATUS_RESERVED_CHAPTER_NAME
The chapter name conflicts with a reserved name.
Definition: ERecorder.h:74
Euresys::EGrabberRecorder::RECORDER_STATUS_INDEX_OUT_OF_RANGE
@ RECORDER_STATUS_INDEX_OUT_OF_RANGE
The RECORDER_PARAMETER_RECORD_INDEX value is out of range.
Definition: ERecorder.h:56
Euresys::EGrabberRecorder::InvalidContainerPath
Invalid storage path error (RECORDER_STATUS_INVALID_CONTAINER_PATH)
Definition: EGrabberRecorder.h:90
Euresys::EGrabberRecorder::RecorderLibrary::getParameterInteger
FnRecorderGetParameterInteger getParameterInteger
Definition: EGrabberRecorder.h:367