Fix play once video player

This commit is contained in:
2026-04-23 08:36:52 +10:00
parent c625898f61
commit 91bdb3f96b
2 changed files with 21 additions and 6 deletions

View File

@@ -1499,6 +1499,7 @@ int VideoPlayerClientTest() {
auto start = std::chrono::system_clock::now();
cv::Mat* image = nullptr; // ✅ Use a pointer to hold the allocated image
GetVideoPlayerCVImage(&videoClient, width, height, pts,&image);
std::cout<<"pts: "<<pts<<std::endl;
auto end1 = std::chrono::system_clock::now();
auto elapsed1 = std::chrono::duration_cast<std::chrono::milliseconds>(end1 - start);
if (elapsed1.count() > 0)std::cout << "Time to get image:" << elapsed1.count() << "ms" << std::endl;
@@ -1579,9 +1580,11 @@ int FilePlayerClientCVTest() {
if ((index == 1800) || (index == 2200) || (index == 2500)) { StopFilePlayer(&filePlayerClient); }
if ((index == 2000) || (index == 2300) || (index == 2700)) { StartFilePlayer(&filePlayerClient); }
if (index > 20000) break;*/
if (index > 2000) break;
auto start = std::chrono::system_clock::now();
cv::Mat* image = nullptr;
GetFilePlayerCVImage(&filePlayerClient, width, height, pts, &image);
std::cout<<"pts: "<<pts<<std::endl;
auto end1 = std::chrono::system_clock::now();
auto elapsed1 = std::chrono::duration_cast<std::chrono::milliseconds>(end1 - start);
if (elapsed1.count() > 0) std::cout << "Time to get image:" << elapsed1.count() << "ms" << std::endl;
@@ -1644,10 +1647,10 @@ int main()
// resolved inside ANSCV.dll (which is linked against libavcodec etc.),
// so this works without the unit test having to link FFmpeg itself.
//ANSCV_PrintFFmpegLicense_S();
//FilePlayerClientDoubleDestroy();
FilePlayerClientDoubleDestroy();
FilePlayerClientCVTest();
// VideoPlayerClientDoubleDestroy();
//VideoPlayerClientTest();
VideoPlayerClientDoubleDestroy();
VideoPlayerClientTest();
//OpenCVFunctionTest();
//GenerateVideo();
//VideoTestClient();