Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactoring in return codes #140

Merged
merged 3 commits into from
Aug 22, 2024
Merged

Refactoring in return codes #140

merged 3 commits into from
Aug 22, 2024

Conversation

dariusz-f
Copy link
Collaborator

  • Use xeve defined return codes in xeve_app
  • Fix return on success in xeve_app

@dariusz-f dariusz-f requested a review from dkozinski August 12, 2024 11:01
@dariusz-f dariusz-f linked an issue Aug 12, 2024 that may be closed by this pull request
@dariusz-f dariusz-f added the wip Do not merge label Aug 13, 2024
@dariusz-f dariusz-f removed the wip Do not merge label Aug 14, 2024
Copy link
Collaborator

@kpchoi kpchoi left a comment

Choose a reason for hiding this comment

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

Any reason why the application return code need to use XEVE library return code?
We can think the application code is one of example how to use XEVE library.
It might not need to use XEVE's error definitions in there.

@dariusz-f
Copy link
Collaborator Author

Currently in xeve_app code is a mix of return codes. Some are from library and some are not. So we need to decide which is preferred way and make whole implementation consistent.

@mpeg5
Copy link
Owner

mpeg5 commented Aug 15, 2024

@dariusz-f ,
I think the application don't have to follow xeve return values.
The popular application in this area is 'ffmpeg' as you know.
ffmpeg is a application using codec libraries, for example libxeve.
it doesn't follow codec libraries' return value. it has own definition of return code.
Of course xeve application can also define own return values internally as like ffmpeg.
But main purpose of xeve application is not commercial level application but testing use-case.
So, the application may not need own return value definition to distinguish many types run-time error.
It is reason why the application code is using the conventional return code like 0 (zero) for success and -1 (negative) for failure.

Again,
#137 is relating to this issue.
The following code may not be correct in xeve_app.c
ret value should not be set to XEVE_ERR_XXX code.

    /* update rate controller parameters */
    if (update_fps_param(args, param))
    {
      logerr("fps is not proper\n");
      ret = XEVE_ERR; goto ERR;
    }

    /* update rate controller parameters */
    if (update_rc_param(args, param))
    {
        logerr("parameters for rate control is not proper\n");
        ret = XEVE_ERR; goto ERR;
    }
    /* update vui parameters */
    if (update_vui_param(args, param))
    {
        logerr("vui parameters is not proper\n");
        ret = XEVE_ERR; goto ERR;
    }
    /* update sei parameters */
    if (update_sei_param(args, param))
    {
        logerr("sei parameters is not proper\n");
        ret = XEVE_ERR; goto ERR;
    }

    /* VUI parameter Range Checking*/
    if (vui_param_check(param))
    {
        logerr("VUI Parameter out of range\n");
        ret = XEVE_ERR; goto ERR;
    }

@dariusz-f
Copy link
Collaborator Author

Ok I will refactor whole app to return 0 and -1 instead of XEVE_OK and XEVE_ERR.

@kpchoi
Copy link
Collaborator

kpchoi commented Aug 20, 2024

@dariusz-f
Could you check #137 issue?
I think there might be code returning library return code in somewhere.
The issue says that return code is XEVE_OK_NO_MORE_FRM.
It might be relating to bumping process...

@dariusz-f
Copy link
Collaborator Author

When there is no error then return is set to 0.
Below line fixes issue #137

ret = 0;

Copy link
Collaborator

@kpchoi kpchoi left a comment

Choose a reason for hiding this comment

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

LGTM

@mpeg5 mpeg5 merged commit ac06330 into master Aug 22, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

xeve_app returns 205 exit code on encoding successful
3 participants