Fix FILE Monitor type.
parent
9024b57171
commit
0390d0e6f4
|
@ -69,6 +69,12 @@ void FileCamera::Initialise() {
|
|||
void FileCamera::Terminate() {
|
||||
}
|
||||
|
||||
int FileCamera::PrimeCapture() {
|
||||
getVideoStream();
|
||||
Info("Priming capture from %s", path.c_str());
|
||||
return 1;
|
||||
}
|
||||
|
||||
int FileCamera::PreCapture() {
|
||||
struct stat statbuf = {};
|
||||
if (stat(path.c_str(), &statbuf) < 0) {
|
||||
|
@ -87,6 +93,13 @@ int FileCamera::PreCapture() {
|
|||
}
|
||||
|
||||
int FileCamera::Capture(std::shared_ptr<ZMPacket> &zm_packet) {
|
||||
if (!zm_packet->image) {
|
||||
zm_packet->image = new Image(width, height, colours, subpixelorder);
|
||||
}
|
||||
zm_packet->keyframe = 1;
|
||||
zm_packet->codec_type = AVMEDIA_TYPE_VIDEO;
|
||||
zm_packet->packet->stream_index = mVideoStreamId;
|
||||
zm_packet->stream = mVideoStream;
|
||||
return zm_packet->image->ReadJpeg(path, colours, subpixelorder) ? 1 : -1;
|
||||
}
|
||||
|
||||
|
|
|
@ -43,6 +43,8 @@ class FileCamera : public Camera {
|
|||
|
||||
void Initialise();
|
||||
void Terminate();
|
||||
|
||||
int PrimeCapture() override;
|
||||
int PreCapture() override;
|
||||
int Capture(std::shared_ptr<ZMPacket> &p) override;
|
||||
int PostCapture() override;
|
||||
|
|
Loading…
Reference in New Issue