Rr/roc video decode class (#20)

* WIP: class implementation

* add more definitions

* rocvideodecode implementation

* formatting fixes

* address review comments

[ROCm/rocdecode commit: d0e6743872]
This commit is contained in:
Rajy Rawther
2023-10-23 09:16:45 -07:00
committed by GitHub
parent 9b158f2b07
commit db6dbf7076
18 changed files with 1144 additions and 44 deletions
@@ -36,6 +36,7 @@ public:
const char* error_msg() { return error.c_str(); }
void capture_error(const std::string& err_msg) { error = err_msg; }
rocDecStatus ParseVideoData(RocdecSourceDataPacket *pPacket) { return roc_parser_->ParseVideoData(pPacket); }
rocDecStatus DestroyParser() { return destroy_parser(); };
private:
std::shared_ptr<RocVideoParser> roc_parser_ = nullptr; // class instantiation
@@ -59,5 +60,15 @@ private:
THROW("rocParser Initialization failed with error: "+ TOSTR(ret));
}
}
rocDecStatus destroy_parser() {
rocDecStatus ret = ROCDEC_NOT_INITIALIZED;
if (roc_parser_ ) {
ret = roc_parser_->UnInitialize();
if (ret != ROCDEC_SUCCESS)
THROW("rocParser UnInitialization failed with error: "+ TOSTR(ret));
}
return ret;
}
std::string error;
};