Repository: ossrs/srs
File: trunk/src/app/srs_app_config.hpp (C++)

Code before:
    bool get_rtc_twcc_enabled(std::string vhost);

// vhost specified section
public:
    // Get the vhost directive by vhost name.
    // @param vhost, the name of vhost to get.
    // @param try_default_vhost whether try default when get specified vhost failed.
    virtual SrsConfDirective* get_vhost(std::string vhost, bool try_default_vhost = true);
    // Get all vhosts in config file.
    virtual void get_vhosts(std::vector<SrsConfDirective*>& vhosts);
    // Whether vhost is enabled
    // @param vhost, the vhost name.
    // @return true when vhost is ok; otherwise, false.
    virtual bool get_vhost_enabled(std::string vhost);
    // Whether vhost is enabled
    // @param vhost, the vhost directive.
    // @return true when vhost is ok; otherwise, false.
    virtual bool get_vhost_enabled(SrsConfDirective* conf);
    // Whether gop_cache is enabled of vhost.
    // gop_cache used to cache last gop, for client to fast startup.
    // @return true when gop_cache is ok; otherwise, false.
    // @remark, default true.
    virtual bool get_gop_cache(std::string vhost);
    // to set the max frames limit for gop cache
    // @return gop cache frames limit
    // @remark, default 250 (10s for 25fps)
    virtual int get_gop_cache_max_frames(std::string vhost);
    // Whether debug_srs_upnode is enabled of vhost.
    // debug_srs_upnode is very important feature for tracable log,
    // but some server, for instance, flussonic donot support it.
    // @see https://github.com/ossrs/srs/issues/160
    // @return true when debug_srs_upnode is ok; otherwise, false.
    // @remark, default true.
    virtual bool get_debug_srs_upnode(std::string vhost);
    // Whether atc is enabled of vhost.
    // atc always use encoder timestamp, SRS never adjust the time.
    // @return true when atc is ok; otherwise, false.
    // @remark, default false.
    virtual bool get_atc(std::string vhost);
    // Whether atc_auto is enabled of vhost.
    // atc_auto used to auto enable atc, when metadata specified the bravo_atc.
    // @return true when atc_auto is ok; otherwise, false.
    // @remark, default true.
    virtual bool get_atc_auto(std::string vhost);
    // Get the time_jitter algorithm.
    // @return the time_jitter algorithm, defined in SrsRtmpJitterAlgorithm.
    // @remark, default full.
    virtual int get_time_jitter(std::string vhost);
    // Whether use mix correct algorithm to ensure the timestamp
    // monotonically increase.
    virtual bool get_mix_correct(std::string vhost);

Review comment (suggestion):
Do not write the magic number 250 here, as it has already been written in `full.conf`. Having constants in two places can lead to forgetting to update one when modifying the other.

If it is necessary to write, it can be written in `full.conf`. Configuration files and documentation are as effective as code.

`TRANS_BY_GPT3`

Code after:
    bool get_rtc_twcc_enabled(std::string vhost);

// vhost specified section
public:
    // Get the vhost directive by vhost name.
    // @param vhost, the name of vhost to get.
    // @param try_default_vhost whether try default when get specified vhost failed.
    virtual SrsConfDirective* get_vhost(std::string vhost, bool try_default_vhost = true);
    // Get all vhosts in config file.
    virtual void get_vhosts(std::vector<SrsConfDirective*>& vhosts);
    // Whether vhost is enabled
    // @param vhost, the vhost name.
    // @return true when vhost is ok; otherwise, false.
    virtual bool get_vhost_enabled(std::string vhost);
    // Whether vhost is enabled
    // @param vhost, the vhost directive.
    // @return true when vhost is ok; otherwise, false.
    virtual bool get_vhost_enabled(SrsConfDirective* conf);
    // Whether gop_cache is enabled of vhost.
    // gop_cache used to cache last gop, for client to fast startup.
    // @return true when gop_cache is ok; otherwise, false.
    // @remark, default true.
    virtual bool get_gop_cache(std::string vhost);
    // Get the limit max frames for gop cache.
    virtual int get_gop_cache_max_frames(std::string vhost);
    // Whether debug_srs_upnode is enabled of vhost.
    // debug_srs_upnode is very important feature for tracable log,
    // but some server, for instance, flussonic donot support it.
    // @see https://github.com/ossrs/srs/issues/160
    // @return true when debug_srs_upnode is ok; otherwise, false.
    // @remark, default true.
    virtual bool get_debug_srs_upnode(std::string vhost);
    // Whether atc is enabled of vhost.
    // atc always use encoder timestamp, SRS never adjust the time.
    // @return true when atc is ok; otherwise, false.
    // @remark, default false.
    virtual bool get_atc(std::string vhost);
    // Whether atc_auto is enabled of vhost.
    // atc_auto used to auto enable atc, when metadata specified the bravo_atc.
    // @return true when atc_auto is ok; otherwise, false.
    // @remark, default true.
    virtual bool get_atc_auto(std::string vhost);
    // Get the time_jitter algorithm.
    // @return the time_jitter algorithm, defined in SrsRtmpJitterAlgorithm.
    // @remark, default full.
    virtual int get_time_jitter(std::string vhost);
    // Whether use mix correct algorithm to ensure the timestamp
    // monotonically increase.
    virtual bool get_mix_correct(std::string vhost);
    // Get the cache queue length, in srs_utime_t.
    // when exceed the queue length, drop packet util I frame.