This commit is contained in:
Isaac Connor
2017-11-13 12:14:57 -05:00
parent 0e799233d2
commit aee2b148f0
5 changed files with 88 additions and 143 deletions

View File

@@ -29,8 +29,8 @@ ZMPacket::ZMPacket( ) {
image = NULL;
frame = NULL;
av_init_packet( &packet );
packet.size = 0;
gettimeofday( &timestamp, NULL );
packet.size = 0; // So we can detect whether it has been filled.
timestamp = (struct timeval){0};
}
ZMPacket::ZMPacket( Image *i ) {
@@ -38,7 +38,7 @@ ZMPacket::ZMPacket( Image *i ) {
image = i;
frame = NULL;
av_init_packet( &packet );
gettimeofday( &timestamp, NULL );
timestamp = (struct timeval){0};
}
ZMPacket::ZMPacket( AVPacket *p ) {
@@ -71,6 +71,13 @@ ZMPacket::~ZMPacket() {
//}
}
void ZMPacket::reset() {
zm_av_packet_unref( &packet );
if ( frame ) {
av_frame_free( &frame );
}
}
int ZMPacket::decode( AVCodecContext *ctx ) {
Debug(4, "about to decode video" );