Skip to content

Commit 8ffc4a6

Browse files
authored
Merge pull request opencv#26652 from mshabunin:fix-ffmpeg-plugin
videoio: fixed writer setProperty with FFmpeg plugin
2 parents 6a0affd + b53fa94 commit 8ffc4a6

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

modules/videoio/src/cap_ffmpeg.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,8 +515,19 @@ CvResult CV_API_CALL cv_writer_get_prop(CvPluginWriter handle, int prop, CV_OUT
515515
}
516516

517517
static
518-
CvResult CV_API_CALL cv_writer_set_prop(CvPluginWriter /*handle*/, int /*prop*/, double /*val*/)
518+
CvResult CV_API_CALL cv_writer_set_prop(CvPluginWriter handle, int prop, double val)
519519
{
520+
if (!handle)
521+
return CV_ERROR_FAIL;
522+
try
523+
{
524+
CvVideoWriter_FFMPEG_proxy* instance = (CvVideoWriter_FFMPEG_proxy*)handle;
525+
return (instance->setProperty(prop, val) ? CV_ERROR_OK : CV_ERROR_FAIL);
526+
}
527+
catch (...)
528+
{
529+
return CV_ERROR_FAIL;
530+
}
520531
return CV_ERROR_FAIL;
521532
}
522533

0 commit comments

Comments
 (0)