mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-21 17:09:19 +02:00
Add videostream dev code
This commit is contained in:
41
extras/VS_Dev.cpp
Normal file
41
extras/VS_Dev.cpp
Normal file
@@ -0,0 +1,41 @@
|
||||
#include "VS_Dev.h"
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
||||
using namespace std;
|
||||
|
||||
VSDev::VSDev()
|
||||
{
|
||||
ifstream DevFile;
|
||||
DevFile.open("test01.bin");
|
||||
DevFile.read(this->Frame1TestBuf, sizeof(this->Frame1TestBuf));
|
||||
DevFile.close();
|
||||
DevFile.open("test02.bin");
|
||||
DevFile.read(this->Frame2TestBuf, sizeof(this->Frame2TestBuf));
|
||||
DevFile.close();
|
||||
}
|
||||
|
||||
int VSDev::GetFrameFromStream(char ** Buffer)
|
||||
{
|
||||
if ((this->GetFrameCallNum % 2) == 0)
|
||||
{
|
||||
*Buffer = this->Frame1TestBuf;
|
||||
this->GetFrameCallNum++;
|
||||
return sizeof(this->Frame1TestBuf);
|
||||
}
|
||||
else if ((this->GetFrameCallNum % 3) == 0)
|
||||
{
|
||||
*Buffer = this->Frame2TestBuf;
|
||||
this->GetFrameCallNum++;
|
||||
return sizeof(this->Frame2TestBuf);
|
||||
}
|
||||
else
|
||||
{
|
||||
this->GetFrameCallNum++;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
void VSDev::FreeFrameBuffer(char * Buffer) {
|
||||
//For dev do nothing...
|
||||
}
|
||||
Reference in New Issue
Block a user