mpv-player / mpv-player/mpv

gpu-next: Redefinition of //!TYPE ENUM

Open
#12,109 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

vo:gpu-next
Dominant language
C
Stars
37k
Forks
3.5k
Avg merge
1d 10h
Merged PRs (30d)
22

Description

Important Information

https://github.com/shinchiro/mpv-winbuild-cmake/releases/tag/20230808

Reproduction steps
//!PARAM FROM
//!TYPE ENUM DEFINE
BT2020
BT709

//!PARAM TO
//!TYPE ENUM DEFINE
BT709
BT2020
Expected behavior

become to:

#define     FROM_BT2020     0
#define     FROM_BT709      1
#define     FROM            FROM_BT2020
#define     FROM_raw        BT2020

#define     TO_BT709        0
#define     TO_BT2020       1
#define     TO              TO_BT709
#define     TO_raw          BT709

Imagine we have a placeboFX, including a color space transform GUI panel, from and to select boxes will use the same list. So, add a prefix to solve redefinition.

And if it's possible, add PRAMA_raw will give me ability to use it as original code (https://github.com/mpv-player/mpv/issues/12093) without #if.

//!PARAM FROM
//!TYPE ENUM DEFINE
UNSET
BT2020
BT709

//!PARAM TO
//!TYPE ENUM DEFINE
UNSET
BT2020
BT709

//!HOOK OUTPUT
//!BIND HOOKED
//!WHEN FROM TO - FROM TO + 0 = +
//!DESC csp

#define from    FROM ? FROM_raw : BT2020
#define to      TO   ? TO_raw   : BT709

...
Actual behavior

They got become to:

#define FROM   0
#define BT2020 0
#define BT709  1

#define TO     0
#define BT709  0
#define BT2020 1
Log file
Sample files

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing gpu-next handling of //!PARAM with //!TYPE ENUM DEFINE, using the reproduction as the minimal case. Compare the generated defines with the expected prefixed and *_raw forms; done means FROM and TO no longer redefine shared enum names while preserving access to the original values.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
computer-graphics
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.