[asterisk-dev] [Code Review] 3665: media_formats: Core updates, plus format_cache/channel/and some other stuff

Corey Farrell reviewboard at asterisk.org
Mon Jun 23 00:10:30 CDT 2014


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/3665/#review12269
-----------------------------------------------------------


Sorry to hit so many issues, I did tell you I was not so confident with the changes I made to the last 3 files.  Looking at it a second time has helped find stuff.  Feel free to BUGBUG things where possible.  I've clicked "open an issue" on a couple findings that aren't necessarily issues, I did this so they could be fixed or dropped and nothing will be missed.

I also checked this against /team/group/media_formats-reviewed-trunk, it only has 3 patch chunks that failed (1 in rtp_engine.c and 3 in channel.c).  Your call if you want to switch the branch for this change or not.


/team/group/media_formats-reviewed/include/asterisk/format_cache.h
<https://reviewboard.asterisk.org/r/3665/#comment22366>

    If SLIN is an acronym for signed, abbreviation for linear (S. lin), then it's "an" SLIN format.  a/an is used based on the immediate next sound, like an FBI agent or a Federal Agent.
    
    On the other hand maybe I've been pronouncing slin wrong and it actually sounds similar to slim?



/team/group/media_formats-reviewed/main/asterisk.c
<https://reviewboard.asterisk.org/r/3665/#comment22367>

    Since the implementation is gone I say lets remove from here and _private.h.



/team/group/media_formats-reviewed/main/channel.c
<https://reviewboard.asterisk.org/r/3665/#comment22368>

    Please split line (I know it was already too big but now it's huge).



/team/group/media_formats-reviewed/main/channel.c
<https://reviewboard.asterisk.org/r/3665/#comment22369>

    Please split line



/team/group/media_formats-reviewed/main/channel.c
<https://reviewboard.asterisk.org/r/3665/#comment22370>

    can optimize / ao2_ref(tmp_cap, -1)



/team/group/media_formats-reviewed/main/channel.c
<https://reviewboard.asterisk.org/r/3665/#comment22372>

    Candidates for RAII_VAR's?



/team/group/media_formats-reviewed/main/channel.c
<https://reviewboard.asterisk.org/r/3665/#comment22371>

    previous best_src_fmt reference leak?



/team/group/media_formats-reviewed/main/channel.c
<https://reviewboard.asterisk.org/r/3665/#comment22373>

    need to ao2_cleanup state->old_write_format



/team/group/media_formats-reviewed/main/codec.c
<https://reviewboard.asterisk.org/r/3665/#comment22374>

    Why?



/team/group/media_formats-reviewed/main/format.c
<https://reviewboard.asterisk.org/r/3665/#comment22375>

    Red



/team/group/media_formats-reviewed/main/format_cache.c
<https://reviewboard.asterisk.org/r/3665/#comment22376>

    I'd prefer we just use George's ao2_replace.



/team/group/media_formats-reviewed/main/format_cache.c
<https://reviewboard.asterisk.org/r/3665/#comment22378>

    Do we still want to block ast_format_cache_set(name, NULL) ?



/team/group/media_formats-reviewed/main/format_cache.c
<https://reviewboard.asterisk.org/r/3665/#comment22379>

    Is this good enough or do we need ast_format_cmp?



/team/group/media_formats-reviewed/main/rtp_engine.c
<https://reviewboard.asterisk.org/r/3665/#comment22380>

    red



/team/group/media_formats-reviewed/main/rtp_engine.c
<https://reviewboard.asterisk.org/r/3665/#comment22382>

    Need a destructor to handle format ref



/team/group/media_formats-reviewed/main/rtp_engine.c
<https://reviewboard.asterisk.org/r/3665/#comment22383>

    Destructor here too



/team/group/media_formats-reviewed/main/rtp_engine.c
<https://reviewboard.asterisk.org/r/3665/#comment22384>

    Destructor here too



/team/group/media_formats-reviewed/main/rtp_engine.c
<https://reviewboard.asterisk.org/r/3665/#comment22381>

    type->format could be leaking a reference here.



/team/group/media_formats-reviewed/main/rtp_engine.c
<https://reviewboard.asterisk.org/r/3665/#comment22385>

    Destructor here too



/team/group/media_formats-reviewed/main/rtp_engine.c
<https://reviewboard.asterisk.org/r/3665/#comment22386>

    References



/team/group/media_formats-reviewed/main/rtp_engine.c
<https://reviewboard.asterisk.org/r/3665/#comment22387>

    This is probably my doing, but I'm not sure we should directly use ao2_bump instead of ast_format_copy.



/team/group/media_formats-reviewed/main/rtp_engine.c
<https://reviewboard.asterisk.org/r/3665/#comment22388>

    BUGBUG



/team/group/media_formats-reviewed/main/rtp_engine.c
<https://reviewboard.asterisk.org/r/3665/#comment22389>

    We will need a shutdown procedure to clear these references



/team/group/media_formats-reviewed/main/rtp_engine.c
<https://reviewboard.asterisk.org/r/3665/#comment22390>

    Also clean this at shutdown



/team/group/media_formats-reviewed/main/rtp_engine.c
<https://reviewboard.asterisk.org/r/3665/#comment22391>

    need to release format reference



/team/group/media_formats-reviewed/main/translate.c
<https://reviewboard.asterisk.org/r/3665/#comment22392>

    might as well switch this to codec_name also in the next ast_cli message.



/team/group/media_formats-reviewed/main/translate.c
<https://reviewboard.asterisk.org/r/3665/#comment22393>

    Looks like we're missing completion for sample_rate.  Let's BUGBUG it so we remember to consider adding it later.


- Corey Farrell


On June 22, 2014, 9:35 p.m., Matt Jordan wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/3665/
> -----------------------------------------------------------
> 
> (Updated June 22, 2014, 9:35 p.m.)
> 
> 
> Review request for Asterisk Developers, Corey Farrell and Joshua Colp.
> 
> 
> Repository: Asterisk
> 
> 
> Description
> -------
> 
> This patch includes all of Corey's fine work on r3625, more that he did in channel/rtp_engine/dsp, and enough work in format_cache/elsewhere to get Asterisk's core to compile, along with some improvements in translate.
> 
> With this patch, Asterisk (with very little loaded) should run and generally display the codec path translations. I'm still not convinced we're computing computational complexity correctly for everything - particularly translations provided by codec_resample - but the table produced matches Asterisk 11/12, so that's a good step.
> 
> Major changes made in this patch:
> * Removed ast_best_codec, as it was a farce [1]. All channel drivers will now use the first codec listed in their configured set of codecs as their preferred codec.
> * Formats now store their name, as it can differ from the codec. This now has the accessor ast_format_get_name; codecs get the new ast_format_get_codec_name. Similarly, formats can now be constructed either entirely from the codec, or from a codec + name.
> * Updated the format_cache with the expected short-hand pointers to the cached formats.
> * channel.c was updated. That's large. Note that this was done mostly by Corey Farrell
> * Codecs can do an explicit name match without their sample rate. This is done to make it a bit easier for CLI commands to query codecs with singular but odd sample rates (looking at you Opus)
> * CLI commands in translate.c should now mostly work. translate.c will now correctly register translation paths - previously, it used the passed in codecs, which did not contain the codec->id field.
> 
> 
> [1] http://lists.digium.com/pipermail/asterisk-dev/2014-June/068133.html
> 
> 
> Diffs
> -----
> 
>   /team/group/media_formats-reviewed/tests/test_format_cache.c 417056 
>   /team/group/media_formats-reviewed/main/translate.c 417056 
>   /team/group/media_formats-reviewed/main/slinfactory.c 417056 
>   /team/group/media_formats-reviewed/main/rtp_engine.c 417056 
>   /team/group/media_formats-reviewed/main/frame.c 417056 
>   /team/group/media_formats-reviewed/main/format_cap.c 417056 
>   /team/group/media_formats-reviewed/main/format_cache.c 417056 
>   /team/group/media_formats-reviewed/main/format.c 417056 
>   /team/group/media_formats-reviewed/main/dsp.c 417056 
>   /team/group/media_formats-reviewed/main/core_unreal.c 417056 
>   /team/group/media_formats-reviewed/main/codec_builtin.c 417056 
>   /team/group/media_formats-reviewed/main/codec.c 417056 
>   /team/group/media_formats-reviewed/main/channel.c 417056 
>   /team/group/media_formats-reviewed/main/asterisk.c 417056 
>   /team/group/media_formats-reviewed/include/asterisk/format_cache.h 417056 
>   /team/group/media_formats-reviewed/include/asterisk/format.h 417056 
>   /team/group/media_formats-reviewed/include/asterisk/channel.h 417056 
>   /team/group/media_formats-reviewed/channels/chan_unistim.c 417056 
>   /team/group/media_formats-reviewed/channels/chan_skinny.c 417056 
>   /team/group/media_formats-reviewed/channels/chan_phone.c 417056 
>   /team/group/media_formats-reviewed/channels/chan_multicast_rtp.c 417056 
>   /team/group/media_formats-reviewed/channels/chan_misdn.c 417056 
>   /team/group/media_formats-reviewed/channels/chan_mgcp.c 417056 
>   /team/group/media_formats-reviewed/channels/chan_jingle.c 417056 
>   /team/group/media_formats-reviewed/channels/chan_iax2.c 417056 
>   /team/group/media_formats-reviewed/channels/chan_h323.c 417056 
>   /team/group/media_formats-reviewed/channels/chan_gtalk.c 417056 
>   /team/group/media_formats-reviewed/addons/chan_ooh323.c 417056 
> 
> Diff: https://reviewboard.asterisk.org/r/3665/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Matt Jordan
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20140623/2f16aa18/attachment-0001.html>


More information about the asterisk-dev mailing list