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

How to obtain the decoded iFormat in FFI? #74

Open
xlievo opened this issue Mar 25, 2025 · 3 comments
Open

How to obtain the decoded iFormat in FFI? #74

xlievo opened this issue Mar 25, 2025 · 3 comments
Labels
bug Something isn't working question Further information is requested

Comments

@xlievo
Copy link
Contributor

xlievo commented Mar 25, 2025

Can you add the following retrieval method? or did I miss something...?

impl DecodedYUV<'_> {
    /// Return the video format of the current frame.
    #[must_use]
    pub fn format(&self) -> i32{
        self.info.iFormat
    }
}
@ralfbiedert
Copy link
Owner

We can, but:

  • Would that value ever show anything else than videoFormatI420, since AFAIK upstream only supports that?
  • Format should probably return a "nice" VideoFormat enum that has a to_native() -> i32 method

@xlievo
Copy link
Contributor Author

xlievo commented Mar 25, 2025

Okay, maybe this isn't important, at least there isn't enough reason for it yet.
There is an additional question of why the DecodedYUV -> timestamp is always equal to 0.
I see the following code; can you explain it further?

let timestamp = Timestamp::from_millis(buffer_info.uiInBsTimeStamp); // TODO: Is this the right one?

@ralfbiedert
Copy link
Owner

This is an open issue / known bug; also see unit test encode_at_timestamp_roundtrips that for now fails and is ignored.

I suspect the issue is on our side, but unfortunately the upstream documentation isn't very good, so it's a bit hard to tell how this is supposed to work.

A fix (including documentation) would be highly welcome!

@ralfbiedert ralfbiedert added bug Something isn't working question Further information is requested labels Mar 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants