Skip to content

Commit

Permalink
Props handling changes
Browse files Browse the repository at this point in the history
  • Loading branch information
VishwanathB45 committed Jul 14, 2023
1 parent 23e4ef1 commit 13f4dfd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
1 change: 1 addition & 0 deletions base/include/TestSignalGeneratorSrc.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class TestSignalGenerator : public Module
bool produce();
bool validateOutputPins();
void setMetadata(framemetadata_sp &metadata);
bool handlePropsChange(frame_sp &frame);

private:
class Detail;
Expand Down
16 changes: 12 additions & 4 deletions base/src/TestSignalGeneratorSrc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class TestSignalGenerator::Detail
void setProps(const TestSignalGeneratorProps &_props)
{
mProps = _props;
reset();
}
void reset()
{
Expand Down Expand Up @@ -110,11 +111,18 @@ void TestSignalGenerator::setMetadata(framemetadata_sp &metadata)
}
}

void TestSignalGenerator::setProps(TestSignalGeneratorProps &_props)
bool TestSignalGenerator::handlePropsChange(frame_sp &frame)
{
mDetail->setProps(_props);
outputFrameSize = (_props.width * _props.height * 3) >> 1;
mDetail->reset();
TestSignalGeneratorProps props;
bool ret = Module::handlePropsChange(frame, props);
mDetail->setProps(props);
outputFrameSize = (props.width * props.height * 3) >> 1;
return ret;
}

void TestSignalGenerator::setProps(TestSignalGeneratorProps &props)
{
Module::addPropsToQueue(props);
}

TestSignalGeneratorProps TestSignalGenerator::getProps()
Expand Down

0 comments on commit 13f4dfd

Please sign in to comment.