Add initialization of the roc_decoder member variable in the DecHandle class constructor. (#13)
Этот коммит содержится в:
1 родитель
8bab60ee0f
Коммит
e5dec6dff4
3 files changed
+13
-3
No files matched your search
@@ -32,7 +32,7 @@ THE SOFTWARE.
|
|||||||
*/
|
*/
|
||||||
struct DecHandle {
|
struct DecHandle {
|
||||||
|
|
||||||
explicit DecHandle() {}; //constructor
|
explicit DecHandle() : roc_decoder(std::make_shared<RocDecoder>()) {}; //constructor
|
||||||
~DecHandle() { clear_errors(); }
|
~DecHandle() { clear_errors(); }
|
||||||
std::shared_ptr<RocDecoder> roc_decoder; // class instantiation
|
std::shared_ptr<RocDecoder> roc_decoder; // class instantiation
|
||||||
bool no_error() { return error.empty(); }
|
bool no_error() { return error.empty(); }
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ THE SOFTWARE.
|
|||||||
#include "../commons.h"
|
#include "../commons.h"
|
||||||
#include "roc_decoder.h"
|
#include "roc_decoder.h"
|
||||||
|
|
||||||
RocDecoder::RocDecoder(int device_id, int num_devices):device_id_ {device_id}, num_devices_{num_devices} {
|
RocDecoder::RocDecoder(int device_id):device_id_ {device_id}, num_devices_{0} {
|
||||||
// todo::
|
// todo::
|
||||||
if (ROCDEC_SUCCESS != initHIP(device_id_)) {
|
if (ROCDEC_SUCCESS != initHIP(device_id_)) {
|
||||||
THROW("Failed to initilize the HIP");
|
THROW("Failed to initilize the HIP");
|
||||||
@@ -32,6 +32,16 @@ RocDecoder::RocDecoder(int device_id, int num_devices):device_id_ {device_id}, n
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RocDecoder::~RocDecoder() {
|
||||||
|
// todo::
|
||||||
|
hipError_t hipStatus = hipSuccess;
|
||||||
|
if (hip_stream_) {
|
||||||
|
hipStatus = hipStreamDestroy(hip_stream_);
|
||||||
|
if (hipStatus != hipSuccess) {
|
||||||
|
ERR("ERROR: hipStreamDestroy failed! (" + TOSTR(hipStatus) + ")");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
rocDecStatus RocDecoder::getDecoderCaps(RocdecDecodeCaps *pdc) {
|
rocDecStatus RocDecoder::getDecoderCaps(RocdecDecodeCaps *pdc) {
|
||||||
// todo:: return appropriate decStatus if fails
|
// todo:: return appropriate decStatus if fails
|
||||||
//vaQueryConfigProfiles
|
//vaQueryConfigProfiles
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ THE SOFTWARE.
|
|||||||
|
|
||||||
class RocDecoder {
|
class RocDecoder {
|
||||||
public:
|
public:
|
||||||
RocDecoder(int device_id, int num_devices);
|
RocDecoder(int device_id = 0);
|
||||||
~RocDecoder();
|
~RocDecoder();
|
||||||
rocDecStatus getDecoderCaps(RocdecDecodeCaps *pdc);
|
rocDecStatus getDecoderCaps(RocdecDecodeCaps *pdc);
|
||||||
rocDecStatus decodeFrame(RocdecPicParams *pPicParams);
|
rocDecStatus decodeFrame(RocdecPicParams *pPicParams);
|
||||||
|
|||||||
Reference in new issue
Block a user