Skip to content

Commit

Permalink
uncommented tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mohammedzakikochargi committed Aug 17, 2023
1 parent 944a40e commit 1d889b6
Showing 1 changed file with 91 additions and 91 deletions.
182 changes: 91 additions & 91 deletions base/test/h264Encodernvcodec_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,96 +272,96 @@ BOOST_AUTO_TEST_CASE(mono_1920x960,
Test_Utils::saveOrCompare(fileComparePath.c_str(), (const unsigned char*)frameData, (size_t)frameSize, 0);
}

//BOOST_AUTO_TEST_CASE(yuv420_640x360_pipeline, *boost::unit_test::disabled())
//{
// std::cout << "starting performance measurement" << std::endl;
// auto cuContext = apracucontext_sp(new ApraCUcontext());
// // metadata is known
// auto width = 640;
// auto height = 360;
//
// auto fileReaderProps = FileReaderModuleProps("./data/Raw_YUV420_640x360/Image???_YUV420.raw");
// fileReaderProps.fps = 10000;
// auto fileReader = boost::shared_ptr<FileReaderModule>(new FileReaderModule(fileReaderProps));
// auto metadata = framemetadata_sp(new RawImagePlanarMetadata(width, height, ImageMetadata::ImageType::YUV420, size_t(0), CV_8U));
//
// auto rawImagePin = fileReader->addOutputPin(metadata);
//
// cudastream_sp cudaStream_ = boost::shared_ptr<ApraCudaStream>(new ApraCudaStream());;
// auto copyProps = CudaMemCopyProps(cudaMemcpyHostToDevice, cudaStream_);
// copyProps.sync = true;
// auto copy = boost::shared_ptr<Module>(new CudaMemCopy(copyProps));
// fileReader->setNext(copy);
//
// H264EncoderNVCodecProps encoderProps(cuContext);
// encoderProps.logHealth = true;
// auto encoder = boost::shared_ptr<Module>(new H264EncoderNVCodec(encoderProps));
// copy->setNext(encoder);
//
// auto sink = boost::shared_ptr<Module>(new StatSink());
// encoder->setNext(sink);
//
// PipeLine p("test");
// p.appendModule(fileReader);
// BOOST_TEST(p.init());
//
// Logger::setLogLevel(boost::log::trivial::severity_level::info);
// p.run_all_threaded();
//
// boost::this_thread::sleep_for(boost::chrono::seconds(20));
// p.stop();
// p.term();
//
// p.wait_for_all();
//
//}
//
//BOOST_AUTO_TEST_CASE(mono_1920x960_pipeline, *boost::unit_test::disabled())
//{
// auto cuContext = apracucontext_sp(new ApraCUcontext());
// auto width = 1920;
// auto height = 960;
//
// auto fileReaderProps = FileReaderModuleProps("./data/mono_1920x960.raw");
// fileReaderProps.fps = 10000;
// auto fileReader = boost::shared_ptr<FileReaderModule>(new FileReaderModule(fileReaderProps));
// auto metadata = framemetadata_sp(new RawImageMetadata(width, height, ImageMetadata::ImageType::MONO, CV_8UC1, 0, CV_8U, FrameMetadata::HOST, true));
//
// auto rawImagePin = fileReader->addOutputPin(metadata);
//
// cudastream_sp cudaStream_ = boost::shared_ptr<ApraCudaStream>(new ApraCudaStream());
// auto copyProps = CudaMemCopyProps(cudaMemcpyHostToDevice, cudaStream_);
// auto copy = boost::shared_ptr<Module>(new CudaMemCopy(copyProps));
// fileReader->setNext(copy);
//
// auto cc = boost::shared_ptr<Module>(new CCNPPI(CCNPPIProps(ImageMetadata::YUV420, cudaStream_)));
// copy->setNext(cc);
//
// auto sync = boost::shared_ptr<Module>(new CudaStreamSynchronize(CudaStreamSynchronizeProps(cudaStream_)));
// cc->setNext(sync);
//
// H264EncoderNVCodecProps encoderProps(cuContext);
// encoderProps.logHealth = true;
// auto encoder = boost::shared_ptr<Module>(new H264EncoderNVCodec(encoderProps));
// sync->setNext(encoder);
//
// auto sink = boost::shared_ptr<Module>(new StatSink());
// encoder->setNext(sink);
//
// PipeLine p("test");
// p.appendModule(fileReader);
// BOOST_TEST(p.init());
//
// Logger::setLogLevel(boost::log::trivial::severity_level::info);
// p.run_all_threaded();
//
// boost::this_thread::sleep_for(boost::chrono::seconds(20));
//
// p.stop();
// p.term();
//
// p.wait_for_all();
//
//}
BOOST_AUTO_TEST_CASE(yuv420_640x360_pipeline, *boost::unit_test::disabled())
{
std::cout << "starting performance measurement" << std::endl;
auto cuContext = apracucontext_sp(new ApraCUcontext());
// metadata is known
auto width = 640;
auto height = 360;

auto fileReaderProps = FileReaderModuleProps("./data/Raw_YUV420_640x360/Image???_YUV420.raw");
fileReaderProps.fps = 10000;
auto fileReader = boost::shared_ptr<FileReaderModule>(new FileReaderModule(fileReaderProps));
auto metadata = framemetadata_sp(new RawImagePlanarMetadata(width, height, ImageMetadata::ImageType::YUV420, size_t(0), CV_8U));

auto rawImagePin = fileReader->addOutputPin(metadata);

cudastream_sp cudaStream_ = boost::shared_ptr<ApraCudaStream>(new ApraCudaStream());;
auto copyProps = CudaMemCopyProps(cudaMemcpyHostToDevice, cudaStream_);
copyProps.sync = true;
auto copy = boost::shared_ptr<Module>(new CudaMemCopy(copyProps));
fileReader->setNext(copy);

H264EncoderNVCodecProps encoderProps(cuContext);
encoderProps.logHealth = true;
auto encoder = boost::shared_ptr<Module>(new H264EncoderNVCodec(encoderProps));
copy->setNext(encoder);

auto sink = boost::shared_ptr<Module>(new StatSink());
encoder->setNext(sink);

PipeLine p("test");
p.appendModule(fileReader);
BOOST_TEST(p.init());

Logger::setLogLevel(boost::log::trivial::severity_level::info);
p.run_all_threaded();

boost::this_thread::sleep_for(boost::chrono::seconds(20));
p.stop();
p.term();

p.wait_for_all();

}

BOOST_AUTO_TEST_CASE(mono_1920x960_pipeline, *boost::unit_test::disabled())
{
auto cuContext = apracucontext_sp(new ApraCUcontext());
auto width = 1920;
auto height = 960;

auto fileReaderProps = FileReaderModuleProps("./data/mono_1920x960.raw");
fileReaderProps.fps = 10000;
auto fileReader = boost::shared_ptr<FileReaderModule>(new FileReaderModule(fileReaderProps));
auto metadata = framemetadata_sp(new RawImageMetadata(width, height, ImageMetadata::ImageType::MONO, CV_8UC1, 0, CV_8U, FrameMetadata::HOST, true));

auto rawImagePin = fileReader->addOutputPin(metadata);

cudastream_sp cudaStream_ = boost::shared_ptr<ApraCudaStream>(new ApraCudaStream());
auto copyProps = CudaMemCopyProps(cudaMemcpyHostToDevice, cudaStream_);
auto copy = boost::shared_ptr<Module>(new CudaMemCopy(copyProps));
fileReader->setNext(copy);

auto cc = boost::shared_ptr<Module>(new CCNPPI(CCNPPIProps(ImageMetadata::YUV420, cudaStream_)));
copy->setNext(cc);

auto sync = boost::shared_ptr<Module>(new CudaStreamSynchronize(CudaStreamSynchronizeProps(cudaStream_)));
cc->setNext(sync);

H264EncoderNVCodecProps encoderProps(cuContext);
encoderProps.logHealth = true;
auto encoder = boost::shared_ptr<Module>(new H264EncoderNVCodec(encoderProps));
sync->setNext(encoder);

auto sink = boost::shared_ptr<Module>(new StatSink());
encoder->setNext(sink);

PipeLine p("test");
p.appendModule(fileReader);
BOOST_TEST(p.init());

Logger::setLogLevel(boost::log::trivial::severity_level::info);
p.run_all_threaded();

boost::this_thread::sleep_for(boost::chrono::seconds(20));

p.stop();
p.term();

p.wait_for_all();

}

BOOST_AUTO_TEST_SUITE_END()

0 comments on commit 1d889b6

Please sign in to comment.