Fix MEDIA_LNK_FL_* and MEDIA_PAD_FL_* visibility in CLI translation unit

The CLI is a separate translation unit that doesn't include <linux/media.h>,
so the kernel flag constants were undefined there. Fix by defining our own
public constants in media_ctrl.h:
- MEDIA_LINK_FL_{ENABLED,IMMUTABLE,DYNAMIC} for link flags
- MEDIA_PAD_FLAG_{SINK,SOURCE} for pad flags (distinct names avoid
  redefinition conflict with kernel's MEDIA_PAD_FL_* in media_ctrl.c)

media_ctrl.c now translates kernel flags to our constants on the way out.
Added fallback #defines for kernel constants that were missing them.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-25 21:51:49 +00:00
parent a29c556851
commit 4ba2a8118d
3 changed files with 33 additions and 10 deletions

View File

@@ -33,10 +33,19 @@ struct Media_Pad {
uint32_t flags; /* MEDIA_PAD_FL_SINK / MEDIA_PAD_FL_SOURCE */
};
/* Link flags for Media_Link.flags */
#define MEDIA_LINK_FL_ENABLED (1u << 0)
#define MEDIA_LINK_FL_IMMUTABLE (1u << 1)
#define MEDIA_LINK_FL_DYNAMIC (1u << 2)
/* Pad flags for Media_Pad.flags */
#define MEDIA_PAD_FLAG_SINK (1u << 0)
#define MEDIA_PAD_FLAG_SOURCE (1u << 1)
struct Media_Link {
struct Media_Pad source;
struct Media_Pad sink;
uint32_t flags; /* MEDIA_LNK_FL_ENABLED, MEDIA_LNK_FL_IMMUTABLE */
uint32_t flags;
};
/*