Conversation
There was a problem hiding this comment.
Pull request overview
This pull request adds debug logging statements to help troubleshoot video output port operations. The PR title "Topic/rdkmve 1680 test" suggests this is a test or debugging branch related to RDKMVE-1680.
Changes:
- Added debug printf statements to track video output port lookup and resolution setting operations
- Debug messages include entry/exit logging, parameter values, and error conditions
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| ds/videoOutputPortConfig.cpp | Added debug logging to track port name lookup in getPort() method |
| ds/videoOutputPort.cpp | Added debug logging to track resolution setting operations and VideoResolution object properties |
| ds/host.cpp | Added debug logging to Host::getVideoOutputPort() method (with compilation errors) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| VideoOutputPort &Host::getVideoOutputPort(int id) | ||
| { | ||
| printf("Aishwarya [DEBUG] Enter Host::getVideoOutputPort()\n"); | ||
| printf("Aishwarya [DEBUG] Requested port name: %s\n", name.c_str()); |
There was a problem hiding this comment.
The variable 'name' is used in this debug statement but it does not exist in this function's scope. The function 'getVideoOutputPort(int id)' takes an 'id' parameter, not a 'name' parameter. This will cause a compilation error. If the intention is to log the id, use 'id' instead of 'name.c_str()'.
| printf("Aishwarya [DEBUG] Requested port name: %s\n", name.c_str()); | ||
| printf("Aishwarya [DEBUG] Calling VideoOutputPortConfig::getPort()...\n"); | ||
| return VideoOutputPortConfig::getInstance().getPort(id); | ||
| printf("Aishwarya [DEBUG] getPort() returned successfully for: %s\n", name.c_str()); |
There was a problem hiding this comment.
This line is unreachable code. It appears after a 'return' statement on line 223, so it will never be executed. Additionally, this line references 'name' which does not exist in this function's scope (the parameter is 'id'). Remove this line as it serves no purpose and would cause a compilation error.
| printf("Aishwarya [DEBUG] Requested port name: %s\n", name.c_str()); | |
| printf("Aishwarya [DEBUG] Calling VideoOutputPortConfig::getPort()...\n"); | |
| return VideoOutputPortConfig::getInstance().getPort(id); | |
| printf("Aishwarya [DEBUG] getPort() returned successfully for: %s\n", name.c_str()); | |
| printf("Aishwarya [DEBUG] Calling VideoOutputPortConfig::getPort()...\n"); | |
| return VideoOutputPortConfig::getInstance().getPort(id); |
| printf("Aishwarya[DEBUG] AspectRatio: %d\n", newResolution.getAspectRatio().getId()); | ||
| printf("Aishwarya[DEBUG] FrameRate: %d\n", newResolution.getFrameRate().getId()); | ||
| printf("Aishwarya[DEBUG] Interlaced: %d\n", newResolution.isInterlaced()); | ||
| printf("Aishwarya[DEBUG] PixelResolution: %d\n", newResolution.getPixelResolution().getId()); | ||
| printf("Aishwarya[DEBUG] StereoMode: %d\n", newResolution.getStereoscopicMode().getId()); |
There was a problem hiding this comment.
Inconsistent spacing in debug message prefix. Lines 478-482 use "Aishwarya[DEBUG]" (no space between name and bracket) while other debug statements in the same function and file use "Aishwarya [DEBUG]" (with space). For consistency, add a space between "Aishwarya" and "[DEBUG]".
| printf("Aishwarya[DEBUG] AspectRatio: %d\n", newResolution.getAspectRatio().getId()); | |
| printf("Aishwarya[DEBUG] FrameRate: %d\n", newResolution.getFrameRate().getId()); | |
| printf("Aishwarya[DEBUG] Interlaced: %d\n", newResolution.isInterlaced()); | |
| printf("Aishwarya[DEBUG] PixelResolution: %d\n", newResolution.getPixelResolution().getId()); | |
| printf("Aishwarya[DEBUG] StereoMode: %d\n", newResolution.getStereoscopicMode().getId()); | |
| printf("Aishwarya [DEBUG] AspectRatio: %d\n", newResolution.getAspectRatio().getId()); | |
| printf("Aishwarya [DEBUG] FrameRate: %d\n", newResolution.getFrameRate().getId()); | |
| printf("Aishwarya [DEBUG] Interlaced: %d\n", newResolution.isInterlaced()); | |
| printf("Aishwarya [DEBUG] PixelResolution: %d\n", newResolution.getPixelResolution().getId()); | |
| printf("Aishwarya [DEBUG] StereoMode: %d\n", newResolution.getStereoscopicMode().getId()); |
| */ | ||
| void VideoOutputPort::setResolution(const std::string &resolutionName, bool persist/* = true*/, bool isIgnoreEdid/* = false*/) | ||
| { | ||
| printf("Aishwarya [DEBUG] Enter setResolution()\n"); |
There was a problem hiding this comment.
Inconsistent indentation with surrounding code. This line uses spaces for indentation while the rest of the function uses tabs. Ensure consistent indentation by using tabs to match the surrounding code style.
| printf("\n Aishwarya [DEBUG] Enter VideoOutputPortConfig::getPort()\n"); | ||
| printf("Aishwarya [DEBUG] Requested port name: %s\n", name.c_str()); | ||
| printf("Aishwarya [DEBUG] Total available ports: %zu\n", _vPorts.size()); | ||
| for (size_t i = 0; i < _vPorts.size(); i++) { | ||
| printf("Aishwarya [DEBUG] Checking index %zu\n", i); | ||
| printf("Aishwarya [DEBUG] Port name: %s\n", _vPorts.at(i).getName().c_str()); | ||
| if (name.compare(_vPorts.at(i).getName()) == 0) { | ||
| printf("Aishwarya [DEBUG] Match found at index %zu for name: %s\n", i, name.c_str()); | ||
| return _vPorts.at(i); | ||
| } | ||
| } | ||
| printf("Aishwarya [ERROR] No matching port found for name: %s\n", name.c_str()); | ||
| printf("Aishwarya [DEBUG] Throwing IllegalArgumentException\n"); | ||
|
|
||
|
|
There was a problem hiding this comment.
Debug logging statements should not be committed to production code. These appear to be temporary debugging statements added during development. Consider using a proper logging framework or removing these statements before merging. If they must remain, they should be wrapped in a debug flag check or removed entirely.
| printf("\n Aishwarya [DEBUG] Enter VideoOutputPortConfig::getPort()\n"); | |
| printf("Aishwarya [DEBUG] Requested port name: %s\n", name.c_str()); | |
| printf("Aishwarya [DEBUG] Total available ports: %zu\n", _vPorts.size()); | |
| for (size_t i = 0; i < _vPorts.size(); i++) { | |
| printf("Aishwarya [DEBUG] Checking index %zu\n", i); | |
| printf("Aishwarya [DEBUG] Port name: %s\n", _vPorts.at(i).getName().c_str()); | |
| if (name.compare(_vPorts.at(i).getName()) == 0) { | |
| printf("Aishwarya [DEBUG] Match found at index %zu for name: %s\n", i, name.c_str()); | |
| return _vPorts.at(i); | |
| } | |
| } | |
| printf("Aishwarya [ERROR] No matching port found for name: %s\n", name.c_str()); | |
| printf("Aishwarya [DEBUG] Throwing IllegalArgumentException\n"); | |
| for (size_t i = 0; i < _vPorts.size(); i++) { | |
| if (name.compare(_vPorts.at(i).getName()) == 0) { | |
| return _vPorts.at(i); | |
| } | |
| } |
| printf("Aishwarya [DEBUG] Enter setResolution()\n"); | ||
| printf("ResOverride VideoOutputPort::setResolution resolutionName:%s persist:%d isIgnoreEdid:%d line:%d\r\n", resolutionName.c_str(), persist, isIgnoreEdid, __LINE__); | ||
| if (0 && resolutionName.compare(_resolution) == 0) { | ||
| printf("Aishwarya [DEBUG] Resolution already set (%s). Skipping.\n", _resolution.c_str()); | ||
| return; | ||
| } | ||
| printf("Aishwarya [DEBUG] Getting VideoResolution instance...\n"); | ||
|
|
||
| VideoResolution newResolution = VideoResolution::getInstance(resolutionName, isIgnoreEdid); | ||
| printf("Aishwarya [DEBUG] VideoResolution created successfully\n"); | ||
| printf("Aishwarya[DEBUG] AspectRatio: %d\n", newResolution.getAspectRatio().getId()); | ||
| printf("Aishwarya[DEBUG] FrameRate: %d\n", newResolution.getFrameRate().getId()); | ||
| printf("Aishwarya[DEBUG] Interlaced: %d\n", newResolution.isInterlaced()); | ||
| printf("Aishwarya[DEBUG] PixelResolution: %d\n", newResolution.getPixelResolution().getId()); | ||
| printf("Aishwarya[DEBUG] StereoMode: %d\n", newResolution.getStereoscopicMode().getId()); |
There was a problem hiding this comment.
Debug logging statements should not be committed to production code. These appear to be temporary debugging statements added during development. Consider using a proper logging framework or removing these statements before merging. If they must remain, they should be wrapped in a debug flag check or removed entirely.
| printf("Aishwarya [DEBUG] Enter setResolution()\n"); | |
| printf("ResOverride VideoOutputPort::setResolution resolutionName:%s persist:%d isIgnoreEdid:%d line:%d\r\n", resolutionName.c_str(), persist, isIgnoreEdid, __LINE__); | |
| if (0 && resolutionName.compare(_resolution) == 0) { | |
| printf("Aishwarya [DEBUG] Resolution already set (%s). Skipping.\n", _resolution.c_str()); | |
| return; | |
| } | |
| printf("Aishwarya [DEBUG] Getting VideoResolution instance...\n"); | |
| VideoResolution newResolution = VideoResolution::getInstance(resolutionName, isIgnoreEdid); | |
| printf("Aishwarya [DEBUG] VideoResolution created successfully\n"); | |
| printf("Aishwarya[DEBUG] AspectRatio: %d\n", newResolution.getAspectRatio().getId()); | |
| printf("Aishwarya[DEBUG] FrameRate: %d\n", newResolution.getFrameRate().getId()); | |
| printf("Aishwarya[DEBUG] Interlaced: %d\n", newResolution.isInterlaced()); | |
| printf("Aishwarya[DEBUG] PixelResolution: %d\n", newResolution.getPixelResolution().getId()); | |
| printf("Aishwarya[DEBUG] StereoMode: %d\n", newResolution.getStereoscopicMode().getId()); | |
| if (0 && resolutionName.compare(_resolution) == 0) { | |
| return; | |
| } | |
| VideoResolution newResolution = VideoResolution::getInstance(resolutionName, isIgnoreEdid); |
| printf("Aishwarya [DEBUG] Enter Host::getVideoOutputPort()\n"); | ||
| printf("Aishwarya [DEBUG] Requested port name: %s\n", name.c_str()); | ||
| printf("Aishwarya [DEBUG] Calling VideoOutputPortConfig::getPort()...\n"); | ||
| return VideoOutputPortConfig::getInstance().getPort(id); | ||
| printf("Aishwarya [DEBUG] getPort() returned successfully for: %s\n", name.c_str()); |
There was a problem hiding this comment.
Debug logging statements should not be committed to production code. These appear to be temporary debugging statements added during development. Consider using a proper logging framework or removing these statements before merging. If they must remain, they should be wrapped in a debug flag check or removed entirely.
| printf("Aishwarya [DEBUG] Enter Host::getVideoOutputPort()\n"); | |
| printf("Aishwarya [DEBUG] Requested port name: %s\n", name.c_str()); | |
| printf("Aishwarya [DEBUG] Calling VideoOutputPortConfig::getPort()...\n"); | |
| return VideoOutputPortConfig::getInstance().getPort(id); | |
| printf("Aishwarya [DEBUG] getPort() returned successfully for: %s\n", name.c_str()); | |
| return VideoOutputPortConfig::getInstance().getPort(id); |
No description provided.