[Asterisk-code-review] Streams: Add features for Advanced Codec Negotiation (asterisk[master])
Joshua Colp
asteriskteam at digium.com
Mon Jun 29 07:54:17 CDT 2020
Joshua Colp has posted comments on this change. ( https://gerrit.asterisk.org/c/asterisk/+/14577 )
Change subject: Streams: Add features for Advanced Codec Negotiation
......................................................................
Patch Set 2: Code-Review-1
(16 comments)
https://gerrit.asterisk.org/c/asterisk/+/14577/2/include/asterisk/format_cap.h
File include/asterisk/format_cap.h:
https://gerrit.asterisk.org/c/asterisk/+/14577/2/include/asterisk/format_cap.h@310
PS2, Line 310: * If buf is NULL the function will internally allocate memory for the ast_str and
Is there precedent for doing things like this already? (Just out of curiosity).
https://gerrit.asterisk.org/c/asterisk/+/14577/2/include/asterisk/stream.h
File include/asterisk/stream.h:
https://gerrit.asterisk.org/c/asterisk/+/14577/2/include/asterisk/stream.h@129
PS2, Line 129: /*! Which if the lists to "prefer" */
of
https://gerrit.asterisk.org/c/asterisk/+/14577/2/include/asterisk/stream.h@207
PS2, Line 207: /*!
Spacing these out would be good
https://gerrit.asterisk.org/c/asterisk/+/14577/2/include/asterisk/stream.h@289
PS2, Line 289: enum ast_stream_codec_negotiation_prefs_prefer_values prefer;
These should be doxygenified
https://gerrit.asterisk.org/c/asterisk/+/14577/2/include/asterisk/stream.h@634
PS2, Line 634: * The resulting stream will contain all of the attributes of the pending stream
By attributes do you mean metadata and such as well?
https://gerrit.asterisk.org/c/asterisk/+/14577/2/include/asterisk/stream.h@647
PS2, Line 647: struct ast_stream *configired_stream, struct ast_stream_codec_negotiation_prefs *prefs,
configured_stream
https://gerrit.asterisk.org/c/asterisk/+/14577/2/include/asterisk/stream.h@735
PS2, Line 735: int ast_stream_topology_get_valid_count(const struct ast_stream_topology *topology);
I don't like valid as a name here... what about get_active_count?
https://gerrit.asterisk.org/c/asterisk/+/14577/2/include/asterisk/stream.h@883
PS2, Line 883: * \note The stream topology is NOT altered by this function.
State that the returned format capabilities should be freed by the caller
https://gerrit.asterisk.org/c/asterisk/+/14577/2/main/format_cap.c
File main/format_cap.c:
https://gerrit.asterisk.org/c/asterisk/+/14577/2/main/format_cap.c@61
PS2, Line 61: /*! \brief internal string to hold prefernece names */
preference
https://gerrit.asterisk.org/c/asterisk/+/14577/2/main/format_cap.c@720
PS2, Line 720: if (!cap->preference_names) {
This will come up later - but is this safe to do? What if two threads access it? Would using thread local storage be better so the underlying caps remains protected?
https://gerrit.asterisk.org/c/asterisk/+/14577/2/main/stream.c
File main/stream.c:
https://gerrit.asterisk.org/c/asterisk/+/14577/2/main/stream.c@117
PS2, Line 117: struct ast_str *display_str;
doxygen
https://gerrit.asterisk.org/c/asterisk/+/14577/2/main/stream.c@130
PS2, Line 130: int final;
doxygen
https://gerrit.asterisk.org/c/asterisk/+/14577/2/main/stream.c@353
PS2, Line 353: if (!stream->display_str) {
Does this present a race condition whereby two threads call this at the same time? (Streams are supposed to be immutable)
https://gerrit.asterisk.org/c/asterisk/+/14577/2/main/stream.c@961
PS2, Line 961: if (!topology->display_str) {
Same question here as I had for streams - is this safe?
https://gerrit.asterisk.org/c/asterisk/+/14577/2/main/stream.c@1092
PS2, Line 1092: return ao2_bump(joint_topology);
Must we RAII_VAR? 😄
https://gerrit.asterisk.org/c/asterisk/+/14577/2/tests/test_format_cap.c
File tests/test_format_cap.c:
https://gerrit.asterisk.org/c/asterisk/+/14577/2/tests/test_format_cap.c@1159
PS2, Line 1159: ast_str_reset(buffer);
Has the behavior of the underlying function been altered for ast_format_cap_get_names such that you have to explicitly pass in a new one, or reset it yourself?
--
To view, visit https://gerrit.asterisk.org/c/asterisk/+/14577
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: I2df77dedd0c72c52deb6e329effe057a8e06cd56
Gerrit-Change-Number: 14577
Gerrit-PatchSet: 2
Gerrit-Owner: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: Joshua Colp <jcolp at sangoma.com>
Gerrit-Comment-Date: Mon, 29 Jun 2020 12:54:17 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20200629/282cbdb4/attachment.html>
More information about the asterisk-code-review
mailing list