#include "InputVideoFileModule.h"

InputVideoFileModule::InputVideoFileModule(const std::string& videoPath) 
: mInit(false)
, mNumberOfFrame(0)
{
	mInit = mVideoCapture.open(videoPath.c_str());
	double frameCount;
	frameCount = mVideoCapture.get(CV_CAP_PROP_FRAME_COUNT);	
	mSize = cv::Size(mVideoCapture.get(CV_CAP_PROP_FRAME_WIDTH), mVideoCapture.get(CV_CAP_PROP_FRAME_HEIGHT));
	mNumberOfFrame = (unsigned int)frameCount;
}

InputVideoFileModule::~InputVideoFileModule(void)
{

}




bool InputVideoFileModule::getNextFrame(cv::Mat& outputPicture)
{
	bool success = false;
	if(mInit)
	{		
		mVideoCapture >> outputPicture;				
		success = !outputPicture.empty();
	}
	return success;
}

