mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2026-10-27 16:58:31 -04:00
reintroduce FfmpegInterruptCallBack so that av_read_frame can be made to quit
This commit is contained in:
1 parent
5242b17b03
commit
190ac69975
2 files changed
+9
-2
No files matched your search
@@ -341,11 +341,13 @@ int FfmpegCamera::OpenFfmpeg() {
|
||||
|
||||
Debug(1, "Calling avformat_open_input for %s", mPath.c_str());
|
||||
|
||||
//mFormatContext = avformat_alloc_context( );
|
||||
mFormatContext = avformat_alloc_context( );
|
||||
// Speed up find_stream_info
|
||||
//FIXME can speed up initial analysis but need sensible parameters...
|
||||
//mFormatContext->probesize = 32;
|
||||
//mFormatContext->max_analyze_duration = 32;
|
||||
mFormatContext->interrupt_callback.callback = FfmpegInterruptCallback;
|
||||
mFormatContext->interrupt_callback.opaque = this;
|
||||
|
||||
if ( avformat_open_input(&mFormatContext, mPath.c_str(), NULL, &opts) != 0 )
|
||||
#endif
|
||||
@@ -978,6 +980,10 @@ int FfmpegCamera::CaptureAndRecord( Image &image, timeval recording, char* event
|
||||
return frameCount;
|
||||
} // end FfmpegCamera::CaptureAndRecord
|
||||
|
||||
int FfmpegCamera::FfmpegInterruptCallback(void *ctx) {
|
||||
//FfmpegCamera* camera = reinterpret_cast<FfmpegCamera*>(ctx);
|
||||
|
||||
return zm_terminate;
|
||||
}
|
||||
|
||||
#endif // HAVE_LIBAVFORMAT
|
||||
@@ -99,11 +99,12 @@ class FfmpegCamera : public Camera {
|
||||
void Initialise();
|
||||
void Terminate();
|
||||
|
||||
static int FfmpegInterruptCallback(void*ctx);
|
||||
|
||||
int PrimeCapture();
|
||||
int PreCapture();
|
||||
int Capture( Image &image );
|
||||
int CaptureAndRecord( Image &image, timeval recording, char* event_directory );
|
||||
int PostCapture();
|
||||
};
|
||||
|
||||
#endif // ZM_FFMPEG_CAMERA_H
|
||||
Reference in new issue
Block a user