Skip to content

Use portable bit-rate logging in ffmpeg_encoder_decoder - #13

Merged
berndpfrommer merged 1 commit into
ros-misc-utilities:masterfrom
Tobias-Fischer:codex/robostack-rolling-ffmpeg-encoder-decoder-bit-rate-log
Jul 20, 2026
Merged

Use portable bit-rate logging in ffmpeg_encoder_decoder#13
berndpfrommer merged 1 commit into
ros-misc-utilities:masterfrom
Tobias-Fischer:codex/robostack-rolling-ffmpeg-encoder-decoder-bit-rate-log

Conversation

@Tobias-Fischer

Copy link
Copy Markdown

This PR is part of an effort to contribute RoboStack downstream patches back upstream.

Origin: RoboStack patch/ros-rolling-ffmpeg-encoder-decoder.unix.patch, authored by Daisuke Nishimatsu.

Best-guess rationale: bitRate_ is int64_t, so logging it through a long-specific format can warn or fail on platforms where long and int64_t differ; casting to long long with a matching format keeps the log statement portable.

@Tobias-Fischer

Copy link
Copy Markdown
Author

FYI @wep21 and @traversaro, this upstream PR comes from the RoboStack patch upstreaming tracker: RoboStack/robostack.github.io#16.

Origin patch: RoboStack patch/ros-rolling-ffmpeg-encoder-decoder.unix.patch, authored by Daisuke Nishimatsu.

@berndpfrommer

berndpfrommer commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

First, thank you for the PR!
There is an uglier solution, but apparently a better one. Should we implement that instead?
Point in case: the CI checks fail :(

@Tobias-Fischer
Tobias-Fischer force-pushed the codex/robostack-rolling-ffmpeg-encoder-decoder-bit-rate-log branch from fcfe108 to 2a8ad78 Compare July 19, 2026 21:28
@Tobias-Fischer

Copy link
Copy Markdown
Author

Sure, done. Thanks for the quick review @berndpfrommer

This upstreams RoboStack downstream patch `patch/ros-rolling-ffmpeg-encoder-decoder.unix.patch`.

bitRate_ is int64_t, so logging it through a long-specific format can warn or fail on platforms where long and int64_t differ. Use the PRId64 format macro from <cinttypes> so the printf-style log format matches the fixed-width integer type portably.

Signed-off-by: Tobias Fischer <info@tobiasfischer.info>
@Tobias-Fischer
Tobias-Fischer force-pushed the codex/robostack-rolling-ffmpeg-encoder-decoder-bit-rate-log branch from 2a8ad78 to 5291ae7 Compare July 19, 2026 22:45
@berndpfrommer
berndpfrommer merged commit da09f5d into ros-misc-utilities:master Jul 20, 2026
5 checks passed
@berndpfrommer

Copy link
Copy Markdown
Contributor

Thanks for the PR!

@Tobias-Fischer
Tobias-Fischer deleted the codex/robostack-rolling-ffmpeg-encoder-decoder-bit-rate-log branch July 20, 2026 03:55
@Tobias-Fischer

Copy link
Copy Markdown
Author

Thanks for the PR!

Thanks for the quick review + merge, amazing!

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