Added logging control (#667)

* * rocDecode: Added logging control
 - Message output from the core components is now controlled by the logging level, which can be set by an environment variable or other methods.

* * rocDecode/Logging control: Fixed a typo.

* * rocDecode/Logging control: Removed reference to the logger class from RocVideoDecoder utility, which results in build error on non-source install environment.

* * rocDecode/Logging control: Improved some wording in the docs.
This commit is contained in:
Jeff Jiang
2025-10-31 20:50:33 -04:00
zatwierdzone przez GitHub
rodzic a721963b3c
commit 60e6c585ff
24 zmienionych plików z 307 dodań i 214 usunięć
@@ -45,7 +45,7 @@ THE SOFTWARE.
#define CHECK_HIP(call) {\
hipError_t hip_status = call;\
if (hip_status != hipSuccess) {\
std::cout << "HIP failure: " << #call << " failed with 'status: " << hipGetErrorName(hip_status) << "' at " << __FILE__ << ":" << __LINE__ << std::endl;\
logger_.CriticalLog(MakeMsg("HIP failure: " + #call + " failed with 'status: " + STR(hipGetErrorName(hip_status)) + "' at " + __FILE__ + ":" + TOSTR(__LINE__)));\
return ROCDEC_RUNTIME_ERROR;\
}\
}
@@ -53,7 +53,7 @@ THE SOFTWARE.
#define CHECK_VAAPI(call) {\
VAStatus va_status = call;\
if (va_status != VA_STATUS_SUCCESS) {\
std::cout << "VAAPI failure: " << #call << " failed with status: " << std::hex << "0x" << va_status << std::dec << " = '" << vaErrorStr(va_status) << "' at " << __FILE__ << ":" << __LINE__ << std::endl;\
logger_.CriticalLog(MakeMsg("VAAPI failure: " + #call + " failed with 'status: " + TOSTR(va_status) + ": " + vaErrorStr(va_status) + "' at " + __FILE__ + ":" + TOSTR(__LINE__)));\
return ROCDEC_RUNTIME_ERROR;\
}\
}
@@ -115,6 +115,8 @@ private:
uint32_t num_slices_;
VABufferID slice_data_buf_id_;
RocDecLogger logger_;
bool IsCodecConfigSupported(int device_id, rocDecVideoCodec codec_type, rocDecVideoChromaFormat chroma_format, uint32_t bit_depth_minus8, rocDecVideoSurfaceFormat output_format);
rocDecStatus CreateDecoderConfig();
rocDecStatus CreateSurfaces();
@@ -152,6 +154,8 @@ private:
VaContext& operator = (const VaContext) = delete;
~VaContext();
RocDecLogger logger_;
rocDecStatus InitHIP(int device_id, hipDeviceProp_t& hip_dev_prop);
rocDecStatus InitVAAPI(int va_ctx_idx, std::string drm_node);
void GetVisibleDevices(std::vector<int>& visible_devices_vetor);