-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,6 +72,11 @@ | |
"xstring": "cpp", | ||
"xtr1common": "cpp", | ||
"xtree": "cpp", | ||
"xutility": "cpp" | ||
"xutility": "cpp", | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
mohammedzakikochargi
Author
Collaborator
|
||
"*.ipp": "cpp", | ||
"any": "cpp", | ||
"filesystem": "cpp", | ||
"array": "cpp", | ||
"variant": "cpp" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,14 +74,49 @@ class Mp4ReaderDetailAbs | |
void setProps(Mp4ReaderSourceProps& props) | ||
{ | ||
This comment has been minimized.
Sorry, something went wrong.
mraduldubey
Collaborator
|
||
mProps = props; | ||
mState.mVideoPath = mProps.videoPath; | ||
|
||
mState.direction = mProps.direction; | ||
|
||
std::chrono::time_point<std::chrono::system_clock> t = std::chrono::system_clock::now(); | ||
auto dur = std::chrono::duration_cast<std::chrono::milliseconds>(t.time_since_epoch()); | ||
uint64_t nowTS = dur.count(); | ||
reloadFileAfter = calcReloadFileAfter(); | ||
auto canonicalVideoPath = boost::filesystem::canonical(mProps.videoPath); | ||
This comment has been minimized.
Sorry, something went wrong.
mraduldubey
Collaborator
|
||
if (mState.mVideoPath != mProps.videoPath && mState.mVideoPath != "") | ||
{ | ||
mState.mVideoPath = canonicalVideoPath.string(); | ||
This comment has been minimized.
Sorry, something went wrong.
mraduldubey
Collaborator
|
||
sentEOSSignal = false; | ||
|
||
if (mProps.parseFS) | ||
This comment has been minimized.
Sorry, something went wrong. |
||
{ | ||
auto boostVideoTS = boost::filesystem::path(mState.mVideoPath).stem().string(); | ||
uint64_t start_parsing_ts = 0; | ||
try | ||
{ | ||
start_parsing_ts = std::stoull(boostVideoTS); | ||
} | ||
catch (std::invalid_argument) | ||
{ | ||
auto msg = "Video File name not in proper format.Check the filename sent as props. \ | ||
If you want to read a file with custom name instead, please disable parseFS flag."; | ||
LOG_ERROR << msg; | ||
throw AIPException(AIP_FATAL, msg); | ||
} | ||
auto skipDir = boost::filesystem::path(mState.mVideoPath).parent_path().parent_path().parent_path().string(); | ||
if (mProps.skipDir != skipDir) | ||
This comment has been minimized.
Sorry, something went wrong. |
||
{ | ||
This comment has been minimized.
Sorry, something went wrong.
mraduldubey
Collaborator
|
||
mProps.skipDir = skipDir; | ||
cof = boost::shared_ptr<OrderedCacheOfFiles>(new OrderedCacheOfFiles(mProps.skipDir)); | ||
cof->clearCache(); | ||
cof->parseFiles(start_parsing_ts, mState.direction, true, false); | ||
initNewVideo(true); | ||
This comment has been minimized.
Sorry, something went wrong. |
||
return; | ||
} | ||
cof->parseFiles(start_parsing_ts, mState.direction, true, false); | ||
} | ||
initNewVideo(); | ||
This comment has been minimized.
Sorry, something went wrong.
mraduldubey
Collaborator
|
||
} | ||
mState.mVideoPath = canonicalVideoPath.string(); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong. |
||
} | ||
|
||
std::string getOpenVideoPath() | ||
|
@@ -1417,7 +1452,8 @@ Mp4ReaderSourceProps Mp4ReaderSource::getProps() | |
|
||
bool Mp4ReaderSource::handlePropsChange(frame_sp& frame) | ||
{ | ||
Mp4ReaderSourceProps props(mDetail->mProps.videoPath, mDetail->mProps.reInitInterval, mDetail->mProps.direction, mDetail->mProps.readLoop, mDetail->mProps.giveLiveTS, mDetail->mProps.parseFSTimeoutDuration, mDetail->mProps.bFramesEnabled); | ||
bool direction = getPlayDirection(); | ||
Mp4ReaderSourceProps props(mDetail->mProps.videoPath, mDetail->mProps.reInitInterval, direction, mDetail->mProps.readLoop, mDetail->mProps.giveLiveTS, mDetail->mProps.parseFSTimeoutDuration, mDetail->mProps.bFramesEnabled); | ||
bool ret = Module::handlePropsChange(frame, props); | ||
mDetail->setProps(props); | ||
//mDetail->Init(); | ||
|
2 comments
on commit e3088f2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add one more test - where getSetProps fails (new root dir does not exist) & the reader should continue from the correct older state (before changed prop)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
two cases - parseFS on and parseFS off (old state)
why is this file committed at all ?