ADTF  3.18.2
Test for ADTF2 Video Decompressor Filter Plugin
Description
This examples test the ADTF2 Video Decompressor Filter Plugin
Location
./src/examples/src/adtf/filters/deserializer/adtf2_video_decompressor_filter/test/
Namespace for entire ADTF SDK.
Build Environment
To see how to set up the build environment have a look at ADTF CMake Environment
this implementation shows:
Implementation
#include "../stream_meta_type_compressed_video.h"
#include <vector>
#include <chrono>
using namespace adtf_file::adtf2::compressed_video;
using namespace adtf::system::testing;
using namespace adtf::streaming::testing;
using namespace adtf::filter::testing;
using namespace adtf::ucom;
using namespace adtf::streaming;
using namespace adtf::services;
using namespace adtf::base;
using namespace adtf::util;
struct cMySessionTestSystem : cSessionTestSystem
{
cMySessionTestSystem()
{
CreateSession(ADTF_TESTING_SOURCE_DIR "/test_compressed_video_project"
"/adtfsessions/demo_video_decompressor_filter_test.adtfsession");
}
};
TEST_CASE_METHOD(cMySessionTestSystem, "Deserialization of compressed video", "[req:ACORE-8497],[req:ACORE-8498]")
{
object_ptr<adtf::services::IPlayer> pPlayer;
REQUIRE_OK(_runtime->GetObject(pPlayer));
auto pPlaybackInput = GetGraphObject("compressed_video_player");
cOutputRecorder oPlaybackRecorder(pPlaybackInput, "compressed_video");
auto pDecompressorFilter = GetGraphObject("demo_video_decompressor_filter_test_filter_graph.video_decompressor_filter");
cOutputRecorder oDecomopressorRecorder(pDecompressorFilter, "decompressed_video");
SetRunLevel(tADTFRunLevel::RL_Running);
while (pPlayer->GetCurrentState() == IPlayer::tState::Streaming)
{
std::this_thread::sleep_for(std::chrono::milliseconds(100));
}
auto oInputTypes = oPlaybackRecorder.GetCurrentOutput().GetTypes();
REQUIRE(!oInputTypes.empty());
cString strMetaTypeName;
REQUIRE_OK(oInputTypes.front()->GetMetaTypeName(adtf_string_intf(strMetaTypeName)));
REQUIRE(strMetaTypeName == cString(stream_meta_type_video_compressed::MetaTypeName));
auto oDecompressorFilterOutput = oDecomopressorRecorder.GetCurrentOutput();
auto oDecompressorTypes = oDecompressorFilterOutput.GetTypes();
REQUIRE(!oDecompressorTypes.empty());
REQUIRE_OK(oDecompressorTypes.front()->GetMetaTypeName(adtf_string_intf(strMetaTypeName)));
REQUIRE(strMetaTypeName == cString(stream_meta_type_image::MetaTypeName));
auto oDecompressorSamples = oDecompressorFilterOutput.GetSamples();
REQUIRE(149 == oDecompressorSamples.size());
for (auto sample : oDecompressorSamples)
{
object_ptr_shared_locked<const ISampleBuffer> buffer;
REQUIRE_OK(sample->Lock(buffer));
REQUIRE(0x12C00 == buffer->GetSize());
}
}
Copyright © Audi Electronics Venture GmbH.
Copyright © Audi Electronics Venture GmbH.
virtual tResult GetObject(iobject_ptr< IObject > &pObject, const char *strNameOID) const =0
Get registered object from object registry.
string_base< cStackString > cString
cString implementation for a stack string which works on stack if string is lower than A_UTILS_DEFAUL...
Definition: string.h:2778
@ RL_FilterGraph
The Filtergraph level.
Definition: adtf_runtime.h:34
Namespace for the ADTF Base SDK.
Namespace for all testing functionality of the ADTF Filter SDK.
Namespace for a summary of all service interfaces (System Service) provided by ADTF.
Namespace for all testing functionality provided within the ADTF Streaming SDK.
Namespace for the ADTF Streaming SDK.
Namespace for all testing functionality of the ADTF System SDK.
Namespace for the ADTF uCOM3 SDK.
alias namespace for the A_UTILS Library.
Copyright © Audi Electronics Venture GmbH.
adtf::ucom::IRuntime * _runtime
Global Runtime Pointer to reference to the current runtime.
#define adtf_string_intf(__string__)
The adtf_string_intf Macro helps to easily create a rvalue reference of a adtf::util::cString.
Definition: string_intf.h:371
Copyright © Audi Electronics Venture GmbH.