43 int SendCameraCommand(
const char* programName,
const char* fileName,
unsigned int timeInSeconds,
unsigned int width = 0U,
unsigned int height = 0U,
unsigned int fps = 0U,
unsigned long bitRate = 0UL);
95 virtual void TurnOn()
override;
107 virtual void TurnOff()
override;
133 virtual std::string
ToString()
const override;
148 void RecordVideo(
const char* fileName,
unsigned int durationInSeconds = 5U);
168 void RecordVideo(
const char* fileName,
unsigned int durationInSeconds,
unsigned int width,
unsigned int height,
unsigned int fps,
unsigned long bitRate);
183 void TakePicture(
const char* fileName,
unsigned int delayInSeconds = 1U);
Abstract base class for every component (sensor, actuator, etc.) the library manages.
Definition: BaseComponent.h:60
Raspberry Pi camera, recording video (raw .h264 converted to .mp4 on a background thread) and taking ...
Definition: PiCamera.h:18
virtual std::string ToString() const override
Serializes the camera to a string.
Definition: PiCamera.cpp:100
virtual void TurnOff() override
No-op: the camera holds no persistent hardware state that needs releasing when turned off.
Definition: PiCamera.cpp:68
void TakePicture(const char *fileName, unsigned int delayInSeconds=1U)
Takes a picture and saves it to the given file after a short delay.
Definition: PiCamera.cpp:190
std::thread myConvertThread
The background thread that converts recorded .h264 video to .mp4.
Definition: PiCamera.h:20
void RecordVideo(const char *fileName, unsigned int durationInSeconds=5U)
Records video to the given file for a duration, then converts the raw .h264 to .mp4 on a background t...
Definition: PiCamera.cpp:123
virtual void ProcessRawValues() override
No-op: the camera produces media files on demand, so there are no raw values to process.
Definition: PiCamera.cpp:83
~PiCamera()
Destroys the camera, joining any in-progress video-conversion thread and turning off first.
Definition: PiCamera.cpp:32
static void ConvertH264ToMP4(std::string fileName)
Converts a raw .h264 video file to .mp4 (via MP4Box) and removes the original .h264 on success.
Definition: PiCamera.cpp:271
PiCamera()
Builds a Pi camera component.
Definition: PiCamera.cpp:16
int SendCameraCommand(const char *programName, const char *fileName, unsigned int timeInSeconds, unsigned int width=0U, unsigned int height=0U, unsigned int fps=0U, unsigned long bitRate=0UL)
Builds and runs a raspivid/raspistill OS command for the given program, output file,...
Definition: PiCamera.cpp:217
virtual void TurnOn() override
No-op: the camera is driven on demand via RecordVideo/TakePicture, so there is nothing to turn on.
Definition: PiCamera.cpp:53
RumPi is the library's top-level facade.
Definition: AlertManager.h:6