2017-05-17 00:04:56 +08:00
|
|
|
//ZoneMinder Packet Wrapper Class
|
|
|
|
//Copyright 2017 ZoneMinder LLC
|
|
|
|
//
|
|
|
|
//This file is part of ZoneMinder.
|
|
|
|
//
|
|
|
|
//ZoneMinder is free software: you can redistribute it and/or modify
|
|
|
|
//it under the terms of the GNU General Public License as published by
|
|
|
|
//the Free Software Foundation, either version 3 of the License, or
|
|
|
|
//(at your option) any later version.
|
|
|
|
//
|
|
|
|
//ZoneMinder is distributed in the hope that it will be useful,
|
|
|
|
//but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
//GNU General Public License for more details.
|
|
|
|
//
|
|
|
|
//You should have received a copy of the GNU General Public License
|
|
|
|
//along with ZoneMinder. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef ZM_PACKET_H
|
|
|
|
#define ZM_PACKET_H
|
|
|
|
|
|
|
|
extern "C" {
|
|
|
|
#include <libavformat/avformat.h>
|
|
|
|
}
|
|
|
|
|
2017-06-22 22:14:24 +08:00
|
|
|
#ifdef __FreeBSD__
|
|
|
|
#include <sys/time.h>
|
|
|
|
#endif // __FreeBSD__
|
2017-10-10 21:36:56 +08:00
|
|
|
#include "zm_image.h"
|
2017-06-22 22:14:24 +08:00
|
|
|
|
2017-05-17 00:04:56 +08:00
|
|
|
class ZMPacket {
|
|
|
|
public:
|
|
|
|
|
2017-10-10 03:32:09 +08:00
|
|
|
AVPacket packet; // Input packet, undecoded
|
|
|
|
AVFrame *frame; // Input image, decoded
|
|
|
|
Image *image; // Our internal image oject representing this frame
|
2017-05-17 00:04:56 +08:00
|
|
|
struct timeval timestamp;
|
|
|
|
public:
|
|
|
|
AVPacket *av_packet() { return &packet; }
|
2019-06-24 23:27:47 +08:00
|
|
|
ZMPacket( AVPacket *packet, struct timeval *timestamp );
|
|
|
|
explicit ZMPacket( AVPacket *packet );
|
2017-05-17 00:04:56 +08:00
|
|
|
~ZMPacket();
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* ZM_PACKET_H */
|