From bc986839fcbfd26919edc30fc7a1fded1246bfcd Mon Sep 17 00:00:00 2001 From: Lina Sun Date: Sun, 29 Sep 2024 08:08:44 +0000 Subject: [PATCH] Add dump functions for encoder and decoder Add functions to dump input & output buffer for encoder and decoder. Tracked-On: OAM-124732 Signed-off-by: Lina Sun --- c2_components/include/mfx_c2_component.h | 2 + .../include/mfx_c2_decoder_component.h | 6 + .../include/mfx_c2_encoder_component.h | 7 +- .../src/mfx_c2_decoder_component.cpp | 145 ++++++++++++++++++ .../src/mfx_c2_encoder_component.cpp | 71 ++++++++- .../android.hardware.media.c2@1.0-arm.policy | 1 + ...android.hardware.media.c2@1.0-arm64.policy | 1 + .../android.hardware.media.c2@1.0-x86.policy | 1 + ...ndroid.hardware.media.c2@1.0-x86_64.policy | 1 + c2_store/src/mfx_c2_store.cpp | 2 + c2_utils/include/mfx_c2_defs.h | 5 +- c2_utils/include/mfx_c2_xml_parser.h | 6 +- c2_utils/src/mfx_c2_xml_parser.cpp | 54 ++++++- 13 files changed, 283 insertions(+), 19 deletions(-) diff --git a/c2_components/include/mfx_c2_component.h b/c2_components/include/mfx_c2_component.h index 4d1ad096..50171642 100755 --- a/c2_components/include/mfx_c2_component.h +++ b/c2_components/include/mfx_c2_component.h @@ -37,6 +37,8 @@ class MfxC2Component : public C2ComponentInterface, { int flags{0}; bool dump_output{false}; + bool dump_input{false}; + uint32_t dump_frames_count{0}; uint32_t concurrent_instances{0}; bool low_power_mode{false}; }; diff --git a/c2_components/include/mfx_c2_decoder_component.h b/c2_components/include/mfx_c2_decoder_component.h index f9b26273..485dd574 100755 --- a/c2_components/include/mfx_c2_decoder_component.h +++ b/c2_components/include/mfx_c2_decoder_component.h @@ -29,6 +29,7 @@ #include "mfx_frame_pool_allocator.h" #include "mfx_gralloc_instance.h" #include "mfx_c2_setters.h" +#include "mfx_c2_utils.h" #include class MfxC2DecoderComponent : public MfxC2Component @@ -252,6 +253,11 @@ class MfxC2DecoderComponent : public MfxC2Component MFXVideoVPP* m_vpp; bool m_vppConversion = false; + std::unique_ptr m_outputWriter; + std::unique_ptr m_inputWriter; + + uint32_t m_dump_count = 0; + /* -----------------------C2Parameters--------------------------- */ std::shared_ptr m_name; std::shared_ptr m_kind; diff --git a/c2_components/include/mfx_c2_encoder_component.h b/c2_components/include/mfx_c2_encoder_component.h index ed2de8fb..6b01a2aa 100755 --- a/c2_components/include/mfx_c2_encoder_component.h +++ b/c2_components/include/mfx_c2_encoder_component.h @@ -202,8 +202,6 @@ class MfxC2EncoderComponent : public MfxC2Component std::shared_ptr m_c2Allocator; - std::unique_ptr m_outputWriter; - bool m_bHeaderSent{false}; mfxFrameSurface1 *m_encSrfPool; @@ -220,6 +218,11 @@ class MfxC2EncoderComponent : public MfxC2Component // Input frame info with width or height not 16byte aligned mfxFrameInfo m_mfxInputInfo; + std::unique_ptr m_outputWriter; + std::unique_ptr m_inputWriter; + + uint32_t m_dump_count = 0; + /* -----------------------C2Parameters--------------------------- */ std::mutex m_c2ParameterMutex; std::shared_ptr m_name; diff --git a/c2_components/src/mfx_c2_decoder_component.cpp b/c2_components/src/mfx_c2_decoder_component.cpp index 140846db..b07698ef 100755 --- a/c2_components/src/mfx_c2_decoder_component.cpp +++ b/c2_components/src/mfx_c2_decoder_component.cpp @@ -757,6 +757,56 @@ c2_status_t MfxC2DecoderComponent::DoStart() m_waitingQueue.Start(); } while(false); + // Dump input/output for decoder/encoder steps: + // 1. $adb shell + // 2. $vi /vendor/etc/media_codecs_intel_c2_video.xml, config dump options by + // setting lines like below in specific decoder/encoder configure sections. + // "dump-frmaes-count" is for setting yuv frames number to dump for encoder + // input or decoder output. + // + // "" + // "" + // "" + // + // 3. $adb reboot + // 4. $adb shell && setenforce 0 + // 5. Run encode/decode, dumped files can be found in /data/local/traces. Files are + // named in "decoder/encoder name - year - month - day - hour - minute - second". + // Dumped files will not be automatically deleted/overwritten in next run, will + // need be deleted manually. + // 6. When viewing yuv frames, check surface width & height in logs if needed. + + if (m_createConfig.dump_output || m_createConfig.dump_input) { + + std::chrono::system_clock::time_point now = std::chrono::system_clock::now(); + std::time_t now_c = std::chrono::system_clock::to_time_t(now); + std::ostringstream oss; + std::tm local_tm; + localtime_r(&now_c, &local_tm); + + if(m_createConfig.dump_output) { + oss << m_name->m.value << "-" << std::put_time(std::localtime(&now_c), "%Y-%m-%d-%H-%M-%S") << ".yuv"; + + MFX_DEBUG_TRACE_STREAM("Decoder output dump is started to " << + MFX_C2_DUMP_DIR << "/" << MFX_C2_DUMP_OUTPUT_SUB_DIR << "/" << + oss.str()); + + m_outputWriter = std::make_unique(MFX_C2_DUMP_DIR, + std::vector({MFX_C2_DUMP_OUTPUT_SUB_DIR}), oss.str()); + } + + if(m_createConfig.dump_input) { + oss << m_name->m.value << "-" << std::put_time(std::localtime(&now_c), "%Y-%m-%d-%H-%M-%S") << ".bin"; + + MFX_DEBUG_TRACE_STREAM("Decoder input dump is started to " << + MFX_C2_DUMP_DIR << "/" << MFX_C2_DUMP_INPUT_SUB_DIR << "/" << + oss.str()); + + m_inputWriter = std::make_unique(MFX_C2_DUMP_DIR, + std::vector({MFX_C2_DUMP_INPUT_SUB_DIR}), oss.str()); + } + } + m_OperationState = OperationState::RUNNING; return C2_OK; @@ -801,6 +851,9 @@ c2_status_t MfxC2DecoderComponent::DoStop(bool abort) m_c2Bitstream->GetFrameConstructor()->Close(); } + m_outputWriter.reset(); + m_inputWriter.reset(); + m_OperationState = OperationState::STOPPED; return C2_OK; } @@ -2093,6 +2146,11 @@ void MfxC2DecoderComponent::DoWork(std::unique_ptr&& work) if (!m_bSetHdrStatic) UpdateHdrStaticInfo(); mfxBitstream *bs = m_c2Bitstream->GetFrameConstructor()->GetMfxBitstream().get(); + + if (m_inputWriter && NULL != bs && bs->DataLength > 0) { + m_inputWriter->Write(bs->Data, bs->DataLength); + } + MfxC2FrameOut frame_out; do { // check bitsream is empty @@ -2266,6 +2324,47 @@ void MfxC2DecoderComponent::Drain(std::unique_ptr&& work) } } +const u_int16_t ytile_width = 16; +const u_int16_t ytile_height = 32; +void one_ytiled_to_linear(const unsigned char *src, char *dst, u_int16_t x, u_int16_t y, u_int16_t width, u_int16_t height, uint32_t offset) +{ + // x and y follow linear + u_int32_t count = x + y * width / ytile_width; + + for (int j = 0; j < ytile_width * ytile_height; j += ytile_width) { + memcpy(dst + offset + width * ytile_height * y + width * j / ytile_width + x * ytile_width, + src + offset + j + ytile_width * ytile_height * count, ytile_width); + } +} + +void* ytiled_to_linear(uint32_t total_size, uint32_t y_size, uint32_t stride, const unsigned char * src) +{ + char* dst = (char*)malloc(total_size * 2); + if (NULL == dst) return NULL; + + memset(dst, 0, total_size * 2); + + u_int16_t height = y_size / stride; + + // Y + u_int16_t y_hcount = height / ytile_height + (height % ytile_height != 0); + for (u_int16_t x = 0; x < stride / ytile_width; x ++) { + for (u_int16_t y = 0; y < y_hcount; y ++) { + one_ytiled_to_linear(src, dst, x, y, stride, height, 0); + } + } + + // UV + u_int16_t uv_hcount = (height / ytile_height / 2) + (height % (ytile_height * 2) != 0); + for (u_int16_t x = 0; x < stride / ytile_width; x ++) { + for (u_int16_t y = 0; y < uv_hcount; y ++) { + one_ytiled_to_linear(src, dst, x, y, stride, height / 2, y_size); + } + } + + return dst; +} + void MfxC2DecoderComponent::WaitWork(MfxC2FrameOut&& frame_out, mfxSyncPoint sync_point) { MFX_DEBUG_TRACE_FUNC; @@ -2424,6 +2523,52 @@ void MfxC2DecoderComponent::WaitWork(MfxC2FrameOut&& frame_out, mfxSyncPoint syn } m_updatingC2Configures.clear(); + if (m_createConfig.dump_output && m_dump_count < m_createConfig.dump_frames_count) { + const C2GraphicView& output_view = block->map().get(); + + const uint8_t* srcY = output_view.data()[C2PlanarLayout::PLANE_Y]; + const uint8_t* srcUV = output_view.data()[C2PlanarLayout::PLANE_U]; + + if(MFX_IOPATTERN_OUT_VIDEO_MEMORY == m_mfxVideoParams.IOPattern) { + const uint32_t align_width = 128; + const uint32_t align_height = 32; + + uint32_t surface_width = mfx_surface->Info.Width % align_width == 0? mfx_surface->Info.Width : + (mfx_surface->Info.Width / align_width + 1) * align_width; + uint32_t surface_height = mfx_surface->Info.Height % align_height == 0? mfx_surface->Info.Height : + (mfx_surface->Info.Height / align_height + 1) * align_height; + + uint32_t pix_len = (MFX_FOURCC_P010 == mfx_surface->Info.FourCC) ? 2 : 1; + + uint32_t total_size = surface_width * pix_len * surface_height * 3 / 2; + uint32_t y_size = surface_width * pix_len * surface_height; + uint32_t stride = surface_width * pix_len; + + uint8_t* srcY_linear = (uint8_t*)ytiled_to_linear(total_size, y_size, stride, srcY); + + if (NULL != srcY_linear) { + m_outputWriter->Write(srcY_linear, total_size); + free(srcY_linear); + + MFX_DEBUG_TRACE_PRINTF("############# dumping #%d decoded buffer in size: %dx%d #################", + m_dump_count, surface_width, surface_height); + m_dump_count ++; + } + } else { // IOPattern is system memory + if (NULL != srcY && NULL != srcUV) { + m_outputWriter->Write(srcY, mfx_surface->Data.PitchLow * m_mfxVideoParams.mfx.FrameInfo.CropH); + m_outputWriter->Write(srcUV, mfx_surface->Data.PitchLow * m_mfxVideoParams.mfx.FrameInfo.CropH / 2); + + uint32_t dump_width = (MFX_FOURCC_P010 == mfx_surface->Info.FourCC) ? + mfx_surface->Data.PitchLow / 2 : mfx_surface->Data.PitchLow; + + MFX_DEBUG_TRACE_PRINTF("############# dumping #%d decoded buffer in size: %dx%d #################", + m_dump_count, dump_width, m_mfxVideoParams.mfx.FrameInfo.CropH); + m_dump_count ++; + } + } + } + worklet->output.buffers.push_back(out_buffer); block = nullptr; } diff --git a/c2_components/src/mfx_c2_encoder_component.cpp b/c2_components/src/mfx_c2_encoder_component.cpp index 5278935f..d90941cf 100755 --- a/c2_components/src/mfx_c2_encoder_component.cpp +++ b/c2_components/src/mfx_c2_encoder_component.cpp @@ -656,7 +656,26 @@ c2_status_t MfxC2EncoderComponent::DoStart() m_workingQueue.Start(); m_waitingQueue.Start(); - if (m_createConfig.dump_output) { + // Dump input/output for decoder/encoder steps: + // 1. $adb shell + // 2. $vi /vendor/etc/media_codecs_intel_c2_video.xml, config dump options by + // setting lines like below in specific decoder/encoder configure sections. + // "dump-frmaes-count" is for setting yuv frames number to dump for encoder + // input or decoder output. + // + // "" + // "" + // "" + // + // 3. $adb reboot + // 4. $adb shell && setenforce 0 + // 5. Run encode/decode, dumped files can be found in /data/local/traces. Files are + // named in "decoder/encoder name - year - month - day - hour - minute - second". + // Dumped files will not be automatically deleted/overwritten in next run, will + // need be deleted manually. + // 6. When viewing yuv frames, check surface width & height in logs if needed. + + if (m_createConfig.dump_output || m_createConfig.dump_input) { std::chrono::system_clock::time_point now = std::chrono::system_clock::now(); std::time_t now_c = std::chrono::system_clock::to_time_t(now); @@ -664,16 +683,28 @@ c2_status_t MfxC2EncoderComponent::DoStart() std::tm local_tm; localtime_r(&now_c, &local_tm); - oss << m_name << "-" << std::put_time(std::localtime(&now_c), "%Y%m%d%H%M%S") << ".bin"; + if(m_createConfig.dump_output) { + oss << m_name->m.value << "-" << std::put_time(std::localtime(&now_c), "%Y-%m-%d-%H-%M-%S") << ".bin"; - MFX_DEBUG_TRACE_STREAM("Encoder output dump is started to " << - MFX_C2_DUMP_DIR << "/" << MFX_C2_DUMP_OUTPUT_SUB_DIR << "/" << - oss.str()); + MFX_DEBUG_TRACE_STREAM("Encoder output dump is started to " << + MFX_C2_DUMP_DIR << "/" << MFX_C2_DUMP_OUTPUT_SUB_DIR << "/" << + oss.str()); - m_outputWriter = std::make_unique(MFX_C2_DUMP_DIR, - std::vector({MFX_C2_DUMP_OUTPUT_SUB_DIR}), oss.str()); - } + m_outputWriter = std::make_unique(MFX_C2_DUMP_DIR, + std::vector({MFX_C2_DUMP_OUTPUT_SUB_DIR}), oss.str()); + } + + if(m_createConfig.dump_input) { + oss << m_name->m.value << "-" << std::put_time(std::localtime(&now_c), "%Y-%m-%d-%H-%M-%S") << ".yuv"; + + MFX_DEBUG_TRACE_STREAM("Encoder input dump is started to " << + MFX_C2_DUMP_DIR << "/" << MFX_C2_DUMP_INPUT_SUB_DIR << "/" << + oss.str()); + m_inputWriter = std::make_unique(MFX_C2_DUMP_DIR, + std::vector({MFX_C2_DUMP_INPUT_SUB_DIR}), oss.str()); + } + } } while(false); return C2_OK; @@ -706,6 +737,7 @@ c2_status_t MfxC2EncoderComponent::DoStop(bool abort) FreeEncoder(); m_outputWriter.reset(); + m_inputWriter.reset(); return C2_OK; } @@ -1432,6 +1464,29 @@ void MfxC2EncoderComponent::DoWork(std::unique_ptr&& work) } } + if (m_inputWriter && m_dump_count < m_createConfig.dump_frames_count + && MFX_IOPATTERN_IN_SYSTEM_MEMORY == m_mfxVideoParamsConfig.IOPattern + && (MFX_FOURCC_NV12 == m_mfxVideoParamsState.mfx.FrameInfo.FourCC + || MFX_FOURCC_P010 == m_mfxVideoParamsState.mfx.FrameInfo.FourCC)) { + + mfxFrameSurface1* mfx_surface = mfx_frame_in.GetMfxFrameSurface(); + const uint8_t* srcY = mfx_surface->Data.Y; + const uint8_t* srcUV = mfx_surface->Data.UV; + + if (NULL != srcY && NULL != srcUV) { + m_inputWriter->Write(srcY, mfx_surface->Data.PitchLow * mfx_surface->Info.CropH); + m_inputWriter->Write(srcUV, mfx_surface->Data.PitchLow * mfx_surface->Info.CropH / 2); + + uint32_t dump_width = (MFX_FOURCC_P010 == m_mfxVideoParamsState.mfx.FrameInfo.FourCC) ? + mfx_surface->Data.PitchLow / 2 : mfx_surface->Data.PitchLow; + + MFX_DEBUG_TRACE_PRINTF("############# dumping #%d encoder input buffer in size: %dx%d #################", + m_dump_count, dump_width, mfx_surface->Info.CropH); + } + + m_dump_count ++; + } + MfxC2BitstreamOut mfx_bitstream; res = AllocateBitstream(work, &mfx_bitstream); if(C2_OK != res) break; diff --git a/c2_store/seccomp_policy/android.hardware.media.c2@1.0-arm.policy b/c2_store/seccomp_policy/android.hardware.media.c2@1.0-arm.policy index 9042cd77..408121d2 100644 --- a/c2_store/seccomp_policy/android.hardware.media.c2@1.0-arm.policy +++ b/c2_store/seccomp_policy/android.hardware.media.c2@1.0-arm.policy @@ -64,6 +64,7 @@ restart_syscall: 1 rt_sigreturn: 1 getrandom: 1 madvise: 1 +mkdirat: 1 # crash dump policy additions sigreturn: 1 diff --git a/c2_store/seccomp_policy/android.hardware.media.c2@1.0-arm64.policy b/c2_store/seccomp_policy/android.hardware.media.c2@1.0-arm64.policy index 5d0284f6..241d6385 100644 --- a/c2_store/seccomp_policy/android.hardware.media.c2@1.0-arm64.policy +++ b/c2_store/seccomp_policy/android.hardware.media.c2@1.0-arm64.policy @@ -60,6 +60,7 @@ restart_syscall: 1 rt_sigreturn: 1 getrandom: 1 madvise: 1 +mkdirat: 1 # crash dump policy additions clock_gettime: 1 diff --git a/c2_store/seccomp_policy/android.hardware.media.c2@1.0-x86.policy b/c2_store/seccomp_policy/android.hardware.media.c2@1.0-x86.policy index 50edbde8..8547727d 100644 --- a/c2_store/seccomp_policy/android.hardware.media.c2@1.0-x86.policy +++ b/c2_store/seccomp_policy/android.hardware.media.c2@1.0-x86.policy @@ -63,6 +63,7 @@ uname: 1 memfd_create: 1 ftruncate: 1 ftruncate64: 1 +mkdirat: 1 # Required by AddressSanitizer gettid: 1 diff --git a/c2_store/seccomp_policy/android.hardware.media.c2@1.0-x86_64.policy b/c2_store/seccomp_policy/android.hardware.media.c2@1.0-x86_64.policy index 0c196092..e5581eed 100644 --- a/c2_store/seccomp_policy/android.hardware.media.c2@1.0-x86_64.policy +++ b/c2_store/seccomp_policy/android.hardware.media.c2@1.0-x86_64.policy @@ -63,6 +63,7 @@ uname: 1 memfd_create: 1 ftruncate: 1 ftruncate64: 1 +mkdirat: 1 # Required by AddressSanitizer gettid: 1 diff --git a/c2_store/src/mfx_c2_store.cpp b/c2_store/src/mfx_c2_store.cpp index 38103cdc..9670f470 100755 --- a/c2_store/src/mfx_c2_store.cpp +++ b/c2_store/src/mfx_c2_store.cpp @@ -328,6 +328,8 @@ c2_status_t MfxC2ComponentStore::readConfigFile() MfxC2Component::CreateConfig config; config.flags = flags; config.dump_output = m_xmlParser.dumpOutputEnabled(name.c_str()); + config.dump_input = m_xmlParser.dumpInputEnabled(name.c_str()); + config.dump_frames_count = m_xmlParser.getDumpFramesCount(name.c_str()); config.concurrent_instances = m_xmlParser.getConcurrentInstances(name.c_str()); config.low_power_mode = m_xmlParser.getLowPowerMode(name.c_str()); diff --git a/c2_utils/include/mfx_c2_defs.h b/c2_utils/include/mfx_c2_defs.h index 48809dad..9befacf9 100755 --- a/c2_utils/include/mfx_c2_defs.h +++ b/c2_utils/include/mfx_c2_defs.h @@ -34,8 +34,11 @@ #define MFX_C2_CONFIG_XML_FILE_NAME "media_codecs_intel_c2_video.xml" #define MFX_C2_CONFIG_XML_FILE_PATH "/vendor/etc" -#define MFX_C2_DUMP_DIR "/data/local/tmp" +#define MFX_C2_DUMP_DIR "/data/local/traces" #define MFX_C2_DUMP_OUTPUT_SUB_DIR "c2-output" +#define MFX_C2_DUMP_INPUT_SUB_DIR "c2-input" + +constexpr uint32_t DEFAULT_DUMP_FRAMES_COUNT = 1; const c2_nsecs_t MFX_SECOND_NS = 1000000000; // 1e9 diff --git a/c2_utils/include/mfx_c2_xml_parser.h b/c2_utils/include/mfx_c2_xml_parser.h index dd18cdbd..f42a582d 100755 --- a/c2_utils/include/mfx_c2_xml_parser.h +++ b/c2_utils/include/mfx_c2_xml_parser.h @@ -51,6 +51,8 @@ class MfxXmlParser C2String getMediaType(const char *name); uint32_t getConcurrentInstances(const char *name); bool dumpOutputEnabled(const char *name); + bool dumpInputEnabled(const char *name); + uint32_t getDumpFramesCount(const char *name); bool getLowPowerMode(const char *name); private: @@ -61,7 +63,9 @@ class MfxXmlParser bool isEncoder; // whether this codec is an encoder or a decoder size_t order; // order of appearance in the file (starting from 0) std::map typeMap; // map of types supported by this codec - bool dump_output{false}; + bool dumpOutput{false}; + bool dumpInput{false}; + uint32_t dumpFramesCount{0}; uint32_t concurrentInstance{0}; bool lowPowerMode{false}; }; diff --git a/c2_utils/src/mfx_c2_xml_parser.cpp b/c2_utils/src/mfx_c2_xml_parser.cpp index 18a14342..edfdc3ab 100755 --- a/c2_utils/src/mfx_c2_xml_parser.cpp +++ b/c2_utils/src/mfx_c2_xml_parser.cpp @@ -103,7 +103,31 @@ bool MfxXmlParser::dumpOutputEnabled(const char *name) { MFX_DEBUG_TRACE_STREAM("codec " << name << "wasn't found"); return false; } - return codec->second.dump_output; + return codec->second.dumpOutput; +} + +bool MfxXmlParser::dumpInputEnabled(const char *name) { + + MFX_DEBUG_TRACE_FUNC; + + auto codec = m_codecMap.find(name); + if (codec == m_codecMap.end()) { + MFX_DEBUG_TRACE_STREAM("codec " << name << "wasn't found"); + return false; + } + return codec->second.dumpInput; +} + +uint32_t MfxXmlParser::getDumpFramesCount(const char *name) { + MFX_DEBUG_TRACE_FUNC; + + auto codec = m_codecMap.find(name); + if (codec == m_codecMap.end() || 0 == codec->second.dumpFramesCount) { + MFX_DEBUG_TRACE_STREAM("dump frames count wasn't found, using default value " << DEFAULT_DUMP_FRAMES_COUNT); + return DEFAULT_DUMP_FRAMES_COUNT; + } + + return codec->second.dumpFramesCount; } bool MfxXmlParser::getLowPowerMode(const char *name) { @@ -190,20 +214,36 @@ c2_status_t MfxXmlParser::addLimits(const char **attrs) { MFX_DEBUG_TRACE_MSG("concurrent-instances is null"); return C2_BAD_VALUE; } - } else if (strcmp(attrs[i], "dumpOutput") == 0) { + } else if (strcmp(attrs[i], "dump-output") == 0) { + if (strcmp(attrs[++i], "value") == 0) { + m_currentCodec->second.dumpOutput = parseBoolean(attrs[++i]); + MFX_DEBUG_TRACE_PRINTF("m_currentCodec->second.dumpOutput = %d", m_currentCodec->second.dumpOutput); + } else { + MFX_DEBUG_TRACE_MSG("dump-output is null"); + return C2_BAD_VALUE; + } + } else if (strcmp(attrs[i], "dump-input") == 0) { + if (strcmp(attrs[++i], "value") == 0) { + m_currentCodec->second.dumpInput = parseBoolean(attrs[++i]); + MFX_DEBUG_TRACE_PRINTF("_currentCodec->second.dumpInput = %d", m_currentCodec->second.dumpInput); + } else { + MFX_DEBUG_TRACE_MSG("dump-input is null"); + return C2_BAD_VALUE; + } + } else if (strcmp(attrs[i], "dump-frames-count") == 0) { if (strcmp(attrs[++i], "value") == 0) { - m_currentCodec->second.dump_output = parseBoolean(attrs[++i]); - MFX_DEBUG_TRACE_PRINTF("m_currentCodec->second.dump_output = %d", m_currentCodec->second.dump_output); + m_currentCodec->second.dumpFramesCount = std::atoi(attrs[++i]); + MFX_DEBUG_TRACE_PRINTF("m_currentCodec->second.dumpFramesCount = %d", m_currentCodec->second.dumpFramesCount); } else { - MFX_DEBUG_TRACE_MSG("dumpOutput is null"); + MFX_DEBUG_TRACE_MSG("dump-frames-count is null"); return C2_BAD_VALUE; } - } else if (strcmp(attrs[i], "lowPowerMode") == 0) { + } else if (strcmp(attrs[i], "low-power-mode") == 0) { if (strcmp(attrs[++i], "value") == 0) { m_currentCodec->second.lowPowerMode = parseBoolean(attrs[++i]); MFX_DEBUG_TRACE_PRINTF("m_currentCodec->second.lowPowerMode = %d ", m_currentCodec->second.lowPowerMode); } else { - MFX_DEBUG_TRACE_MSG("lowPowerMode is null"); + MFX_DEBUG_TRACE_MSG("low-power-mode is null"); return C2_BAD_VALUE; } }