@@ -224,7 +224,7 @@ class PluginBackend: public IBackend
224
224
return ;
225
225
}
226
226
#ifdef HAVE_FFMPEG_WRAPPER
227
- if (plugin_api_->captureAPI == CAP_FFMPEG)
227
+ if (plugin_api_->v0 . captureAPI == CAP_FFMPEG)
228
228
{
229
229
// no checks for OpenCV minor version
230
230
}
@@ -409,11 +409,11 @@ void PluginBackendFactory::loadPlugin()
409
409
Ptr<PluginBackend> pluginBackend = makePtr<PluginBackend>(lib);
410
410
if (pluginBackend && pluginBackend->plugin_api_ )
411
411
{
412
- if (pluginBackend->plugin_api_ ->captureAPI != id_)
412
+ if (pluginBackend->plugin_api_ ->v0 . captureAPI != id_)
413
413
{
414
414
CV_LOG_ERROR (NULL , " Video I/O: plugin '" << pluginBackend->plugin_api_ ->api_header .api_description <<
415
415
" ': unexpected backend ID: " <<
416
- pluginBackend->plugin_api_ ->captureAPI << " vs " << (int )id_ << " (expected)" );
416
+ pluginBackend->plugin_api_ ->v0 . captureAPI << " vs " << (int )id_ << " (expected)" );
417
417
}
418
418
else
419
419
{
@@ -444,10 +444,10 @@ class PluginCapture : public cv::IVideoCapture
444
444
{
445
445
CV_Assert (plugin_api);
446
446
CvPluginCapture capture = NULL ;
447
- if (plugin_api->Capture_open )
447
+ if (plugin_api->v0 . Capture_open )
448
448
{
449
- CV_Assert (plugin_api->Capture_release );
450
- if (CV_ERROR_OK == plugin_api->Capture_open (filename.empty () ? 0 : filename.c_str (), camera, &capture))
449
+ CV_Assert (plugin_api->v0 . Capture_release );
450
+ if (CV_ERROR_OK == plugin_api->v0 . Capture_open (filename.empty () ? 0 : filename.c_str (), camera, &capture))
451
451
{
452
452
CV_Assert (capture);
453
453
return makePtr<PluginCapture>(plugin_api, capture);
@@ -464,30 +464,30 @@ class PluginCapture : public cv::IVideoCapture
464
464
465
465
~PluginCapture ()
466
466
{
467
- CV_DbgAssert (plugin_api_->Capture_release );
468
- if (CV_ERROR_OK != plugin_api_->Capture_release (capture_))
467
+ CV_DbgAssert (plugin_api_->v0 . Capture_release );
468
+ if (CV_ERROR_OK != plugin_api_->v0 . Capture_release (capture_))
469
469
CV_LOG_ERROR (NULL , " Video I/O: Can't release capture by plugin '" << plugin_api_->api_header .api_description << " '" );
470
470
capture_ = NULL ;
471
471
}
472
472
double getProperty (int prop) const CV_OVERRIDE
473
473
{
474
474
double val = -1 ;
475
- if (plugin_api_->Capture_getProperty )
476
- if (CV_ERROR_OK != plugin_api_->Capture_getProperty (capture_, prop, &val))
475
+ if (plugin_api_->v0 . Capture_getProperty )
476
+ if (CV_ERROR_OK != plugin_api_->v0 . Capture_getProperty (capture_, prop, &val))
477
477
val = -1 ;
478
478
return val;
479
479
}
480
480
bool setProperty (int prop, double val) CV_OVERRIDE
481
481
{
482
- if (plugin_api_->Capture_setProperty )
483
- if (CV_ERROR_OK == plugin_api_->Capture_setProperty (capture_, prop, val))
482
+ if (plugin_api_->v0 . Capture_setProperty )
483
+ if (CV_ERROR_OK == plugin_api_->v0 . Capture_setProperty (capture_, prop, val))
484
484
return true ;
485
485
return false ;
486
486
}
487
487
bool grabFrame () CV_OVERRIDE
488
488
{
489
- if (plugin_api_->Capture_grab )
490
- if (CV_ERROR_OK == plugin_api_->Capture_grab (capture_))
489
+ if (plugin_api_->v0 . Capture_grab )
490
+ if (CV_ERROR_OK == plugin_api_->v0 . Capture_grab (capture_))
491
491
return true ;
492
492
return false ;
493
493
}
@@ -503,8 +503,8 @@ class PluginCapture : public cv::IVideoCapture
503
503
bool retrieveFrame (int idx, cv::OutputArray img) CV_OVERRIDE
504
504
{
505
505
bool res = false ;
506
- if (plugin_api_->Capture_retreive )
507
- if (CV_ERROR_OK == plugin_api_->Capture_retreive (capture_, idx, retrieve_callback, (cv::_OutputArray*)&img))
506
+ if (plugin_api_->v0 . Capture_retreive )
507
+ if (CV_ERROR_OK == plugin_api_->v0 . Capture_retreive (capture_, idx, retrieve_callback, (cv::_OutputArray*)&img))
508
508
res = true ;
509
509
return res;
510
510
}
@@ -514,7 +514,7 @@ class PluginCapture : public cv::IVideoCapture
514
514
}
515
515
int getCaptureDomain () CV_OVERRIDE
516
516
{
517
- return plugin_api_->captureAPI ;
517
+ return plugin_api_->v0 . captureAPI ;
518
518
}
519
519
};
520
520
@@ -534,23 +534,23 @@ class PluginWriter : public cv::IVideoWriter
534
534
{
535
535
CV_Assert (plugin_api);
536
536
CvPluginWriter writer = NULL ;
537
- if (plugin_api->api_header .api_version >= 1 && plugin_api->Writer_open_with_params )
537
+ if (plugin_api->api_header .api_version >= 1 && plugin_api->v1 . Writer_open_with_params )
538
538
{
539
- CV_Assert (plugin_api->Writer_release );
539
+ CV_Assert (plugin_api->v0 . Writer_release );
540
540
CV_Assert (!filename.empty ());
541
541
std::vector<int > vint_params = params.getIntVector ();
542
542
int * c_params = &vint_params[0 ];
543
543
unsigned n_params = (unsigned )(vint_params.size () / 2 );
544
544
545
- if (CV_ERROR_OK == plugin_api->Writer_open_with_params (filename.c_str (), fourcc, fps, sz.width , sz.height , c_params, n_params, &writer))
545
+ if (CV_ERROR_OK == plugin_api->v1 . Writer_open_with_params (filename.c_str (), fourcc, fps, sz.width , sz.height , c_params, n_params, &writer))
546
546
{
547
547
CV_Assert (writer);
548
548
return makePtr<PluginWriter>(plugin_api, writer);
549
549
}
550
550
}
551
- else if (plugin_api->Writer_open )
551
+ else if (plugin_api->v0 . Writer_open )
552
552
{
553
- CV_Assert (plugin_api->Writer_release );
553
+ CV_Assert (plugin_api->v0 . Writer_release );
554
554
CV_Assert (!filename.empty ());
555
555
const bool isColor = params.get (VIDEOWRITER_PROP_IS_COLOR, true );
556
556
const int depth = params.get (VIDEOWRITER_PROP_DEPTH, CV_8U);
@@ -559,7 +559,7 @@ class PluginWriter : public cv::IVideoWriter
559
559
CV_LOG_WARNING (NULL , " Video I/O plugin doesn't support (due to lower API level) creation of VideoWriter with depth != CV_8U" );
560
560
return Ptr<PluginWriter>();
561
561
}
562
- if (CV_ERROR_OK == plugin_api->Writer_open (filename.c_str (), fourcc, fps, sz.width , sz.height , isColor, &writer))
562
+ if (CV_ERROR_OK == plugin_api->v0 . Writer_open (filename.c_str (), fourcc, fps, sz.width , sz.height , isColor, &writer))
563
563
{
564
564
CV_Assert (writer);
565
565
return makePtr<PluginWriter>(plugin_api, writer);
@@ -576,23 +576,23 @@ class PluginWriter : public cv::IVideoWriter
576
576
577
577
~PluginWriter ()
578
578
{
579
- CV_DbgAssert (plugin_api_->Writer_release );
580
- if (CV_ERROR_OK != plugin_api_->Writer_release (writer_))
579
+ CV_DbgAssert (plugin_api_->v0 . Writer_release );
580
+ if (CV_ERROR_OK != plugin_api_->v0 . Writer_release (writer_))
581
581
CV_LOG_ERROR (NULL , " Video I/O: Can't release writer by plugin '" << plugin_api_->api_header .api_description << " '" );
582
582
writer_ = NULL ;
583
583
}
584
584
double getProperty (int prop) const CV_OVERRIDE
585
585
{
586
586
double val = -1 ;
587
- if (plugin_api_->Writer_getProperty )
588
- if (CV_ERROR_OK != plugin_api_->Writer_getProperty (writer_, prop, &val))
587
+ if (plugin_api_->v0 . Writer_getProperty )
588
+ if (CV_ERROR_OK != plugin_api_->v0 . Writer_getProperty (writer_, prop, &val))
589
589
val = -1 ;
590
590
return val;
591
591
}
592
592
bool setProperty (int prop, double val) CV_OVERRIDE
593
593
{
594
- if (plugin_api_->Writer_setProperty )
595
- if (CV_ERROR_OK == plugin_api_->Writer_setProperty (writer_, prop, val))
594
+ if (plugin_api_->v0 . Writer_setProperty )
595
+ if (CV_ERROR_OK == plugin_api_->v0 . Writer_setProperty (writer_, prop, val))
596
596
return true ;
597
597
return false ;
598
598
}
@@ -604,16 +604,16 @@ class PluginWriter : public cv::IVideoWriter
604
604
{
605
605
cv::Mat img = arr.getMat ();
606
606
CV_DbgAssert (writer_);
607
- CV_Assert (plugin_api_->Writer_write );
608
- if (CV_ERROR_OK != plugin_api_->Writer_write (writer_, img.data , (int )img.step [0 ], img.cols , img.rows , img.channels ()))
607
+ CV_Assert (plugin_api_->v0 . Writer_write );
608
+ if (CV_ERROR_OK != plugin_api_->v0 . Writer_write (writer_, img.data , (int )img.step [0 ], img.cols , img.rows , img.channels ()))
609
609
{
610
610
CV_LOG_DEBUG (NULL , " Video I/O: Can't write frame by plugin '" << plugin_api_->api_header .api_description << " '" );
611
611
}
612
612
// TODO return bool result?
613
613
}
614
614
int getCaptureDomain () const CV_OVERRIDE
615
615
{
616
- return plugin_api_->captureAPI ;
616
+ return plugin_api_->v0 . captureAPI ;
617
617
}
618
618
};
619
619
0 commit comments