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

docs(toxav): fix docs of toxav.h #2754

Merged
merged 1 commit into from
Nov 9, 2024

Conversation

Green-Sky
Copy link
Member

@Green-Sky Green-Sky commented Apr 27, 2024

  • fix units to be better readable (Kb/sec -> kbit/sec)
  • use width before height consistently
  • video -> audio typo

for another pr: fix video being actually Mbit/sec #2782


This change is Reviewable

@Green-Sky Green-Sky changed the title fix docs of toxav.h docs(toxav): fix docs of toxav.h Apr 27, 2024
@Green-Sky Green-Sky added this to the v0.2.20 milestone Apr 27, 2024
@Green-Sky Green-Sky requested a review from zoff99 April 27, 2024 10:16
@Green-Sky Green-Sky marked this pull request as ready for review April 27, 2024 10:29
toxav/toxav.h Outdated Show resolved Hide resolved
@zoff99
Copy link

zoff99 commented Apr 27, 2024

acutally "b" (lowercase b) always means bits.
so Kb is always Kilobit(s).
versus KB and KiB

@zoff99
Copy link

zoff99 commented Apr 27, 2024

and video bitrate is correct as Kb/s (kilo bits per second).
its multiplied by 1000 later because vpx codec needs the value as b/s (bits per second)

well i am still checking this. its been a long time. hold on a bit ...

@nurupo
Copy link
Member

nurupo commented Apr 27, 2024

zoff is right, Kb and kbit are the same unit, so that particular unit is not really being fixed, just reworded. I do support the change though, being more explicit/clear in the documentation and spelling it out is probably a good thing.

@Green-Sky
Copy link
Member Author

@zoff99 yea we multiply both audio and video rates by 1000, BUT vpx_encoder.h:

  /*!\brief Target data rate
   *
   * Target bitrate to use for this stream, in kilobits per second.
   */
  unsigned int rc_target_bitrate;

@zoff99
Copy link

zoff99 commented Apr 27, 2024

@zoff99 yea we multiply both audio and video rates by 1000, BUT vpx_encoder.h:

  /*!\brief Target data rate
   *
   * Target bitrate to use for this stream, in kilobits per second.
   */
  unsigned int rc_target_bitrate;

yeah thats why i say im still checking. in my forks i think its correct but let me actually check ...

@zoff99
Copy link

zoff99 commented Apr 27, 2024

yeah its wrong in toktok:

cfg.rc_target_bitrate = bit_rate;

but fixed in mine:

https://github.com/zoff99/c-toxcore/blob/3511870af9928c7d09a47f0196ccb0ed3f0e0e9c/toxav/codecs/vpx/codec.c#L490

cfg2.rc_target_bitrate = (bit_rate / 1000);

@Green-Sky
Copy link
Member Author

sidenote: opus changed, and the new meaningful lower bound for the bitrate is 0.5 ...

@zoff99
Copy link

zoff99 commented Apr 27, 2024

but in any case the toxav PR needs to be merged first. fixes of old bugs come only afterwards.
we made a roadmap and agreed on it to my recollection

@Green-Sky
Copy link
Member Author

@zoff99 do we preserve behavoir and adjust the comments (this pr as-is) or do we fix it and change behavior?

@Green-Sky
Copy link
Member Author

but in any case the toxav PR needs to be merged first. fixes of old bugs come only afterwards. we made a roadmap and agreed on it to my recollection

This pr has no conflicts with your pr, so that does not really matter, only if we change the code.

Also, someone needs to fix circle ci first ...

@zoff99
Copy link

zoff99 commented Apr 27, 2024

i would imagine we rebase and tweak this PR after toxav pr is merged.
what are the blockers now that the toxav PR can't be merged now-ish ? then lets address those, if any.

and which one is "the one" ?
#1431
#2651
(shrug)

@Green-Sky
Copy link
Member Author

and which one is "the one" ? #1431 #2651 (shrug)

Oh I did not even see the other. the newer one has no conflicts, so...

@Green-Sky Green-Sky marked this pull request as draft April 27, 2024 12:54
@Green-Sky
Copy link
Member Author

back to draft, until either toxav prs is merged.

@nurupo nurupo force-pushed the toxav_docs_fix1 branch 2 times, most recently from 1c68998 to 85d1761 Compare April 27, 2024 13:41
toxav/toxav.h Show resolved Hide resolved
@pull-request-attention pull-request-attention bot assigned iphydf and Green-Sky and unassigned Green-Sky May 1, 2024
@iphydf iphydf modified the milestones: v0.2.20, v0.2.21 Nov 6, 2024
@iphydf iphydf modified the milestones: v0.2.21, v0.2.20 Nov 8, 2024
@Green-Sky Green-Sky marked this pull request as ready for review November 8, 2024 10:34
@Green-Sky
Copy link
Member Author

Green-Sky commented Nov 8, 2024

Update: this no longer changes the described bitrate of video to mega bits.
#2782

Copy link

codecov bot commented Nov 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.00%. Comparing base (5f97890) to head (06aea13).
Report is 8 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2754      +/-   ##
==========================================
- Coverage   73.04%   73.00%   -0.04%     
==========================================
  Files         149      149              
  Lines       30478    30478              
==========================================
- Hits        22263    22251      -12     
- Misses       8215     8227      +12     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Green-Sky Green-Sky added toxav Audio/video documentation Changes to the documentation labels Nov 8, 2024
@nurupo
Copy link
Member

nurupo commented Nov 8, 2024

That's good. The Mbit change is API / behavior breaking, so it's good to have it in a separate PR until we are ready to break the API.

@nurupo nurupo requested a review from iphydf November 8, 2024 11:40
Copy link
Member

@nurupo nurupo left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r1, 1 of 1 files at r2, all commit messages.
Reviewable status: 0 of 2 approvals obtained (waiting on @Green-Sky, @iphydf, and @zoff99)

@Green-Sky Green-Sky force-pushed the toxav_docs_fix1 branch 2 times, most recently from 4b26218 to 252dd25 Compare November 8, 2024 16:16
- fix units to be more readable
- use width before height consistently
- video -> audio typo
@Green-Sky Green-Sky removed the request for review from zoff99 November 8, 2024 23:44
@Green-Sky Green-Sky changed the title docs(toxav): fix docs of toxav.h docs(toxav): fix docs of toxav.h Nov 9, 2024
@toktok-releaser toktok-releaser merged commit 7e57328 into TokTok:master Nov 9, 2024
62 checks passed
@nurupo
Copy link
Member

nurupo commented Nov 9, 2024

The Mbit change is API / behavior breaking, so it's good to have it in a separate PR until we are ready to break the API.

I would like to correct my earlier comment that that Mbit change is, in fact, not API breaking.

I thought the API used to say Mbit/s before, due to various force-push diffs in this PR doing the Mbit/s -> kbit/s function doc change, in which case changing it to kbit/s would be API-breaking, but I went and checked 5 years worth of the past revisions of toxav.h and apparently it has always been kbit/s, so no API is being broken.

@Green-Sky
Copy link
Member Author

@nurupo yep, and it's fixed now on master #2782

@Green-Sky Green-Sky deleted the toxav_docs_fix1 branch November 9, 2024 13:21
@nurupo
Copy link
Member

nurupo commented Nov 9, 2024

Yeah, that PR being merged so unceremoniously is what made me go back and double-check if it was actually API breaking or not, before I yell at iphydf for breaking the API. Apparently it wasn't, which is good.

@robinlinden robinlinden changed the title docs(toxav): fix docs of toxav.h docs(toxav): fix docs of toxav.h Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Changes to the documentation toxav Audio/video
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants