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

Create Decoders #1

Merged
merged 16 commits into from
Jun 27, 2024
Merged

Create Decoders #1

merged 16 commits into from
Jun 27, 2024

Conversation

Noarkhh
Copy link
Collaborator

@Noarkhh Noarkhh commented Jun 14, 2024

The decoding nifs are mostly based on this example

@Noarkhh Noarkhh changed the title Setup project Create Decoders Jun 18, 2024
@Noarkhh Noarkhh marked this pull request as ready for review June 18, 2024 14:08
@Noarkhh Noarkhh requested review from mat-hek and varsill June 18, 2024 14:08
c_src/membrane_vpx_plugin/vpx_decoder.spec.exs Outdated Show resolved Hide resolved
test/membrane_vpx_plugin/vpx_decoder_test.exs Outdated Show resolved Hide resolved
lib/membrane_vpx/decoder/vp9_decoder.ex Outdated Show resolved Hide resolved
lib/membrane_vpx/decoder/vpx_decoder.ex Outdated Show resolved Hide resolved
[]
end

buffers = Enum.map(decoded_frames, &%Buffer{payload: &1, pts: pts})
Copy link

Choose a reason for hiding this comment

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

Do we have a guarantee that Native.decode_frame won't return some "buffered" frames, that should have different PTS? (I am slightly worried of that as decode_frame returns a list of frames)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I believe we do, since there is no flushing mechanism

Copy link

Choose a reason for hiding this comment

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

Ok, so could we match on [decoded_frame] = decoded_frames? This way we will have a clear error message if for some reason decoder returns more than one frame, that could potentially mess up timestamps

c_src/membrane_vpx_plugin/vpx_decoder.c Outdated Show resolved Hide resolved
c_src/membrane_vpx_plugin/vpx_decoder.c Show resolved Hide resolved
c_src/membrane_vpx_plugin/vpx_decoder.c Outdated Show resolved Hide resolved
@mat-hek mat-hek removed their request for review June 20, 2024 12:27
@Noarkhh Noarkhh requested a review from varsill June 21, 2024 09:32
Copy link

@varsill varsill left a comment

Choose a reason for hiding this comment

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

Just one tiny new comment and one follow up on a conversation from the last review's round

state.framerate || raise("Framerate not provided")
}

%^codec_module{width: width, height: height, framerate: framerate} ->
Copy link

Choose a reason for hiding this comment

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

do we really need that codec_module here? It's only stored in the state to be used here.
You could match on %{width: width, height: height, framerate: framerate} and the stream format definition will make sure that no other module than VP8 or VP9 can be applied here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I did this to ensure the stream format is actually matching the codec, but i guess accepted_format is enough

@Noarkhh Noarkhh merged commit a7f0baa into master Jun 27, 2024
3 checks passed
@Noarkhh Noarkhh deleted the setup-project branch June 27, 2024 09:33
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.

2 participants