winlin

refine code according to inspect of clion. 0.9.219

... ... @@ -23,11 +23,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <srs_app_avc_aac.hpp>
#include <stdlib.h>
#include <srs_kernel_error.hpp>
#include <srs_kernel_log.hpp>
#include <srs_kernel_codec.hpp>
#include <srs_kernel_stream.hpp>
#include <srs_protocol_amf0.hpp>
... ...
... ... @@ -30,9 +30,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
using namespace std;
#include <srs_protocol_rtmp.hpp>
#include <srs_kernel_error.hpp>
#include <srs_protocol_amf0.hpp>
#include <srs_protocol_stack.hpp>
#include <srs_app_config.hpp>
#include <srs_core_autofree.hpp>
#include <srs_kernel_utility.hpp>
... ... @@ -319,7 +317,7 @@ int SrsBandwidth::play_checking(SrsBandwidthSample* sample, SrsKbpsLimit* limit)
return ret;
}
int SrsBandwidth::play_stop(SrsBandwidthSample* sample, SrsKbpsLimit* limit)
int SrsBandwidth::play_stop(SrsBandwidthSample* sample, SrsKbpsLimit* /*limit*/)
{
int ret = ERROR_SUCCESS;
... ... @@ -405,7 +403,7 @@ int SrsBandwidth::publish_checking(SrsBandwidthSample* sample, SrsKbpsLimit* lim
return ret;
}
int SrsBandwidth::publish_stop(SrsBandwidthSample* sample, SrsKbpsLimit* limit)
int SrsBandwidth::publish_stop(SrsBandwidthSample* sample, SrsKbpsLimit* /*limit*/)
{
int ret = ERROR_SUCCESS;
... ...
... ... @@ -23,8 +23,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <srs_app_conn.hpp>
#include <arpa/inet.h>
#include <srs_kernel_log.hpp>
#include <srs_kernel_error.hpp>
#include <srs_app_server.hpp>
... ...
... ... @@ -30,12 +30,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
using namespace std;
#include <srs_app_config.hpp>
#include <srs_kernel_error.hpp>
#include <srs_protocol_rtmp.hpp>
#include <srs_protocol_stack.hpp>
#include <srs_app_source.hpp>
#include <srs_core_autofree.hpp>
#include <srs_kernel_stream.hpp>
#include <srs_kernel_utility.hpp>
#include <srs_app_http_hooks.hpp>
#include <srs_kernel_codec.hpp>
... ... @@ -268,7 +264,7 @@ int SrsDvrPlan::on_video(SrsSharedPtrMessage* video)
return ret;
}
int SrsDvrPlan::on_reload_vhost_dvr(std::string vhost)
int SrsDvrPlan::on_reload_vhost_dvr(std::string /*vhost*/)
{
int ret = ERROR_SUCCESS;
... ...
... ... @@ -32,20 +32,14 @@ using namespace std;
#include <srs_kernel_error.hpp>
#include <srs_protocol_rtmp.hpp>
#include <srs_kernel_log.hpp>
#include <srs_protocol_rtmp.hpp>
#include <srs_protocol_io.hpp>
#include <srs_app_config.hpp>
#include <srs_protocol_utility.hpp>
#include <srs_protocol_rtmp.hpp>
#include <srs_app_st_socket.hpp>
#include <srs_protocol_stack.hpp>
#include <srs_app_source.hpp>
#include <srs_app_pithy_print.hpp>
#include <srs_core_autofree.hpp>
#include <srs_app_st_socket.hpp>
#include <srs_app_kbps.hpp>
#include <srs_kernel_utility.hpp>
#include <srs_protocol_msg_array.hpp>
#include <srs_app_utility.hpp>
#include <srs_protocol_amf0.hpp>
... ...
... ... @@ -31,10 +31,8 @@ using namespace std;
#include <srs_app_config.hpp>
#include <srs_protocol_rtmp.hpp>
#include <srs_app_pithy_print.hpp>
#include <srs_protocol_stack.hpp>
#include <srs_app_ffmpeg.hpp>
#include <srs_kernel_utility.hpp>
#include <srs_kernel_consts.hpp>
#ifdef SRS_AUTO_TRANSCODE
... ...
... ... @@ -35,9 +35,6 @@ using namespace std;
#include <srs_kernel_error.hpp>
#include <srs_kernel_log.hpp>
#include <srs_app_config.hpp>
#include <srs_protocol_rtmp.hpp>
#include <srs_app_pithy_print.hpp>
#include <srs_protocol_stack.hpp>
#ifdef SRS_AUTO_FFMPEG
... ...
... ... @@ -31,18 +31,14 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
using namespace std;
#include <srs_app_source.hpp>
#include <srs_core_autofree.hpp>
#include <srs_app_st_socket.hpp>
#include <srs_kernel_error.hpp>
#include <srs_kernel_log.hpp>
#include <srs_app_config.hpp>
#include <srs_app_pithy_print.hpp>
#include <srs_protocol_rtmp.hpp>
#include <srs_protocol_stack.hpp>
#include <srs_protocol_utility.hpp>
#include <srs_protocol_rtmp.hpp>
#include <srs_app_kbps.hpp>
#include <srs_kernel_utility.hpp>
#include <srs_protocol_msg_array.hpp>
#include <srs_app_utility.hpp>
#include <srs_protocol_amf0.hpp>
... ...
... ... @@ -679,7 +679,7 @@ int SrsHlsMuxer::flush_audio(SrsMpegtsFrame* af, SrsBuffer* ab)
return ret;
}
int SrsHlsMuxer::flush_video(SrsMpegtsFrame* af, SrsBuffer* ab, SrsMpegtsFrame* vf, SrsBuffer* vb)
int SrsHlsMuxer::flush_video(SrsMpegtsFrame* /*af*/, SrsBuffer* /*ab*/, SrsMpegtsFrame* vf, SrsBuffer* vb)
{
int ret = ERROR_SUCCESS;
... ...
... ... @@ -30,11 +30,9 @@ using namespace std;
#include <srs_kernel_log.hpp>
#include <srs_kernel_error.hpp>
#include <srs_app_http.hpp>
#include <srs_app_st_socket.hpp>
#include <srs_core_autofree.hpp>
#include <srs_app_json.hpp>
#include <srs_app_config.hpp>
#include <srs_kernel_utility.hpp>
#include <srs_app_utility.hpp>
... ... @@ -62,7 +60,7 @@ bool SrsApiRoot::is_handler_valid(SrsHttpMessage* req, int& status_code, std::st
return true;
}
bool SrsApiRoot::can_handle(const char* path, int length, const char** pchild)
bool SrsApiRoot::can_handle(const char* path, int /*length*/, const char** pchild)
{
// reset the child path to path,
// for child to reparse the path.
... ...
... ... @@ -36,9 +36,7 @@ using namespace std;
#include <srs_kernel_log.hpp>
#include <srs_kernel_error.hpp>
#include <srs_app_st_socket.hpp>
#include <srs_app_http.hpp>
#include <srs_core_autofree.hpp>
#include <srs_app_json.hpp>
#include <srs_app_config.hpp>
#include <srs_kernel_flv.hpp>
#include <srs_kernel_utility.hpp>
... ... @@ -116,7 +114,7 @@ int SrsHttpRoot::best_match(const char* path, int length, SrsHttpHandlerMatch**
return ERROR_HTTP_HANDLER_MATCH_URL;
}
bool SrsHttpRoot::is_handler_valid(SrsHttpMessage* req, int& status_code, std::string& reason_phrase)
bool SrsHttpRoot::is_handler_valid(SrsHttpMessage* /*req*/, int& status_code, std::string& reason_phrase)
{
status_code = SRS_CONSTS_HTTP_InternalServerError;
reason_phrase = SRS_CONSTS_HTTP_InternalServerError_str;
... ... @@ -124,7 +122,7 @@ bool SrsHttpRoot::is_handler_valid(SrsHttpMessage* req, int& status_code, std::s
return false;
}
int SrsHttpRoot::do_process_request(SrsStSocket* skt, SrsHttpMessage* req)
int SrsHttpRoot::do_process_request(SrsStSocket* /*skt*/, SrsHttpMessage* /*req*/)
{
int ret = ERROR_SUCCESS;
return ret;
... ...
... ... @@ -30,12 +30,10 @@ using namespace std;
#include <srs_kernel_error.hpp>
#include <srs_protocol_rtmp.hpp>
#include <srs_kernel_log.hpp>
#include <srs_app_st_socket.hpp>
#include <srs_app_http.hpp>
#include <srs_app_json.hpp>
#include <srs_app_dvr.hpp>
#include <srs_app_config.hpp>
#include <srs_app_http_client.hpp>
#define SRS_HTTP_RESPONSE_OK "0"
... ...
... ... @@ -33,7 +33,6 @@ using namespace std;
#include <srs_app_ffmpeg.hpp>
#include <srs_app_pithy_print.hpp>
#include <srs_kernel_utility.hpp>
#include <srs_kernel_consts.hpp>
// when error, ingester sleep for a while and retry.
// ingest never sleep a long time, for we must start the stream ASAP.
... ...
... ... @@ -26,7 +26,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
using namespace std;
#include <srs_kernel_log.hpp>
#include <srs_kernel_error.hpp>
#ifdef __SRS_JSON_USE_NXJSON
... ...
... ... @@ -23,9 +23,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <srs_app_kbps.hpp>
#include <srs_kernel_error.hpp>
#include <srs_kernel_log.hpp>
#include <srs_protocol_io.hpp>
#include <srs_kernel_utility.hpp>
#include <srs_app_st.hpp>
... ...
... ... @@ -28,7 +28,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <srs_kernel_log.hpp>
#include <srs_app_config.hpp>
#include <srs_app_reload.hpp>
#include <srs_kernel_error.hpp>
#include <srs_kernel_utility.hpp>
... ...
... ... @@ -33,7 +33,6 @@ using namespace std;
#include <srs_kernel_error.hpp>
#include <srs_kernel_log.hpp>
#include <srs_protocol_rtmp.hpp>
#include <srs_protocol_stack.hpp>
#include <srs_core_autofree.hpp>
#include <srs_app_source.hpp>
#include <srs_app_server.hpp>
... ... @@ -46,13 +45,9 @@ using namespace std;
#include <srs_app_st_socket.hpp>
#include <srs_app_http_hooks.hpp>
#include <srs_app_edge.hpp>
#include <srs_app_kbps.hpp>
#include <srs_app_utility.hpp>
#include <srs_protocol_utility.hpp>
#include <srs_kernel_utility.hpp>
#include <srs_protocol_msg_array.hpp>
#include <srs_protocol_amf0.hpp>
#include <srs_app_utility.hpp>
// when stream is busy, for example, streaming is already
// publishing, when a new client to request to publish,
... ... @@ -987,7 +982,7 @@ int SrsRtmpConn::check_edge_token_traverse_auth()
SrsStSocket* io = new SrsStSocket(stsock);
SrsRtmpClient* client = new SrsRtmpClient(io);
ret = do_token_traverse_auth(io, client);
ret = do_token_traverse_auth(client);
srs_freep(client);
srs_freep(io);
... ... @@ -1030,7 +1025,7 @@ int SrsRtmpConn::connect_server(int origin_index, st_netfd_t* pstsock)
return ret;
}
int SrsRtmpConn::do_token_traverse_auth(SrsStSocket* io, SrsRtmpClient* client)
int SrsRtmpConn::do_token_traverse_auth(SrsRtmpClient* client)
{
int ret = ERROR_SUCCESS;
... ...
... ... @@ -97,7 +97,7 @@ private:
private:
virtual int check_edge_token_traverse_auth();
virtual int connect_server(int origin_index, st_netfd_t* pstsock);
virtual int do_token_traverse_auth(SrsStSocket* io, SrsRtmpClient* client);
virtual int do_token_traverse_auth(SrsRtmpClient* client);
private:
virtual int http_hooks_on_connect();
virtual void http_hooks_on_close();
... ...
... ... @@ -40,12 +40,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <srs_kernel_utility.hpp>
#include <srs_app_http_api.hpp>
#include <srs_app_http_conn.hpp>
#include <srs_app_http.hpp>
#include <srs_app_ingest.hpp>
#include <srs_app_source.hpp>
#include <srs_app_utility.hpp>
#include <srs_app_heartbeat.hpp>
#include <srs_app_kbps.hpp>
// signal defines.
#define SIGNAL_RELOAD SIGHUP
... ... @@ -971,7 +969,7 @@ int SrsServer::on_reload_vhost_added(std::string vhost)
return ret;
}
int SrsServer::on_reload_vhost_removed(std::string vhost)
int SrsServer::on_reload_vhost_removed(std::string /*vhost*/)
{
int ret = ERROR_SUCCESS;
... ...
... ... @@ -29,7 +29,6 @@ using namespace std;
#include <srs_kernel_log.hpp>
#include <srs_protocol_stack.hpp>
#include <srs_core_autofree.hpp>
#include <srs_protocol_amf0.hpp>
#include <srs_kernel_codec.hpp>
#include <srs_app_hls.hpp>
... ...
... ... @@ -24,7 +24,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <srs_app_st_socket.hpp>
#include <srs_kernel_error.hpp>
#include <srs_kernel_utility.hpp>
SrsStSocket::SrsStSocket(st_netfd_t client_stfd)
{
... ...
... ... @@ -26,10 +26,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <srs_kernel_error.hpp>
#include <srs_kernel_log.hpp>
// const time for st to convert to us
#define SRS_TIME_MILLISECONDS 1000
#define SRS_TIME_SECONDS 1000000
ISrsThreadHandler::ISrsThreadHandler()
{
}
... ... @@ -105,7 +101,7 @@ int SrsThread::start()
// wait for cid to ready, for parent thread to get the cid.
while (_cid < 0 && loop) {
st_usleep(10 * SRS_TIME_MILLISECONDS);
st_usleep(10 * 1000);
}
// now, cycle thread can run.
... ... @@ -154,7 +150,7 @@ void SrsThread::thread_cycle()
// wait for cid to ready, for parent thread to get the cid.
while (!can_run && loop) {
st_usleep(10 * SRS_TIME_MILLISECONDS);
st_usleep(10 * 1000);
}
while (loop) {
... ...
... ... @@ -36,7 +36,6 @@ using namespace std;
#include <srs_kernel_error.hpp>
#include <srs_app_kbps.hpp>
#include <srs_app_json.hpp>
#include <srs_kernel_consts.hpp>
int srs_socket_connect(std::string server, int port, int64_t timeout, st_netfd_t* pstfd)
{
... ... @@ -92,18 +91,18 @@ failed:
int srs_get_log_level(std::string level)
{
if ("verbose" == _srs_config->get_log_level()) {
if ("verbose" == level) {
return SrsLogLevel::Verbose;
} else if ("info" == _srs_config->get_log_level()) {
} else if ("info" == level) {
return SrsLogLevel::Info;
} else if ("trace" == _srs_config->get_log_level()) {
} else if ("trace" == level) {
return SrsLogLevel::Trace;
} else if ("warn" == _srs_config->get_log_level()) {
} else if ("warn" == level) {
return SrsLogLevel::Warn;
} else if ("error" == _srs_config->get_log_level()) {
} else if ("error" == level) {
return SrsLogLevel::Error;
} else {
return SrsLogLevel::Trace;
return SrsLogLevel::Disabled;
}
}
... ... @@ -995,8 +994,6 @@ string srs_get_local_ip(int fd)
int srs_get_local_port(int fd)
{
std::string ip;
// discovery client information
sockaddr_in addr;
socklen_t addrlen = sizeof(addr);
... ...
... ... @@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// current release version
#define VERSION_MAJOR "0"
#define VERSION_MINOR "9"
#define VERSION_REVISION "218"
#define VERSION_REVISION "219"
#define RTMP_SIG_SRS_VERSION VERSION_MAJOR"."VERSION_MINOR"."VERSION_REVISION
// server info.
#define RTMP_SIG_SRS_KEY "SRS"
... ...
... ... @@ -26,11 +26,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <string.h>
#include <stdlib.h>
#include <srs_kernel_error.hpp>
#include <srs_kernel_stream.hpp>
#include <srs_kernel_log.hpp>
#include <srs_core_autofree.hpp>
SrsFlvCodec::SrsFlvCodec()
{
}
... ...
... ... @@ -30,9 +30,7 @@ using namespace std;
#include <srs_kernel_log.hpp>
#include <srs_kernel_error.hpp>
#include <srs_core_autofree.hpp>
#include <srs_kernel_stream.hpp>
#include <srs_kernel_utility.hpp>
#include <srs_kernel_file.hpp>
#define SRS_FLV_TAG_HEADER_SIZE 11
... ...
... ... @@ -499,7 +499,6 @@ void SrsUnSortedHashtable::copy(SrsUnSortedHashtable* src)
SrsAmf0ObjectEOF::SrsAmf0ObjectEOF()
{
marker = RTMP_AMF0_ObjectEnd;
utf8_empty = 0x00;
}
SrsAmf0ObjectEOF::~SrsAmf0ObjectEOF()
... ...
... ... @@ -756,8 +756,6 @@ namespace _srs_internal
class SrsAmf0ObjectEOF : public SrsAmf0Any
{
public:
int16_t utf8_empty;
public:
SrsAmf0ObjectEOF();
virtual ~SrsAmf0ObjectEOF();
public:
... ...
... ... @@ -24,12 +24,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <srs_protocol_rtmp.hpp>
#include <srs_core_autofree.hpp>
#include <srs_kernel_log.hpp>
#include <srs_kernel_error.hpp>
#include <srs_protocol_io.hpp>
#include <srs_protocol_amf0.hpp>
#include <srs_protocol_handshake.hpp>
#include <srs_protocol_stack.hpp>
#include <srs_protocol_utility.hpp>
#include <srs_kernel_stream.hpp>
#include <srs_kernel_utility.hpp>
... ... @@ -929,7 +926,7 @@ int SrsRtmpServer::response_connect_app(SrsRequest *req, const char* server_ip)
return ret;
}
void SrsRtmpServer::response_connect_reject(SrsRequest *req, const char* desc)
void SrsRtmpServer::response_connect_reject(SrsRequest* /*req*/, const char* desc)
{
int ret = ERROR_SUCCESS;
... ...
... ... @@ -23,15 +23,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <srs_protocol_stack.hpp>
#include <srs_kernel_log.hpp>
#include <srs_protocol_amf0.hpp>
#include <srs_kernel_error.hpp>
#include <srs_protocol_io.hpp>
#include <srs_kernel_buffer.hpp>
#include <srs_kernel_stream.hpp>
#include <srs_core_autofree.hpp>
#include <srs_kernel_utility.hpp>
#include <srs_kernel_consts.hpp>
using namespace std;
... ...