Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include <unistd.h>
#include <memory>
#include <unordered_map>
#include "im2d.hpp"
#include "im2d.h"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Critical Issue: This change from im2d.hpp (C++) to im2d.h (C) introduces an API compatibility problem that should cause compilation failure.

Root Problem: Line 129 in this file uses:

buffer = wrapbuffer_handle(handle, w, h, RK_FORMAT_RGB_888);

This 4-argument call requires C++ default parameters from im2d.hpp. The C header im2d.h requires all 6 parameters: wrapbuffer_handle(handle, width, height, format, wstride, hstride).

Research findings:

  1. Standard Rockchip librga repositories (rockchip-linux/librga, airockchip/librga) provide both headers
  2. For C++ projects, im2d.hpp is the recommended choice
  3. The C++ header offers default arguments and better type safety

Recommended Solution:

Option A (Preferred): Fix the build environment to include im2d.hpp

  • Revert this change back to #include "im2d.hpp"
  • Ensure the librga package in your Android NDK includes C++ headers
  • This maintains the intended API usage

Option B: If im2d.hpp is truly unavailable, fix the function call:

  • Keep #include "im2d.h"
  • Update line 129 to: buffer = wrapbuffer_handle(handle, w, h, RK_FORMAT_RGB_888, w, h);
  • Add a comment explaining the environment constraint

Verification Request:
Please confirm that the build actually passes with this change alone. The code should fail to compile without fixing line 129. If it compiles, your librga version may have non-standard function signatures.

actions

Feedback: Rate this comment to help me improve future code reviews:

  • 👍 Good - Helpful and accurate
  • 👎 Poor - Wrong, unclear, or unhelpful
  • Skip if you don't have any strong opinions either way.

#include "im2d_single.h"
#include "RgaUtils.h"
#include "rga/utils.h"
Expand Down