From 72d11df3520d1afd8929b167dfa7eabdbe8eed63 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Tue, 5 Apr 2016 18:57:00 +0200 Subject: [PATCH] Small clarification in a variable name. --- httpd.cpp | 16 ++++++++-------- httpd.h | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/httpd.cpp b/httpd.cpp index 70ebaef..cd3d6e1 100644 --- a/httpd.cpp +++ b/httpd.cpp @@ -138,10 +138,10 @@ void HTTPD::request_completed(struct MHD_Connection *connection, void **con_cls, } } -HTTPD::Mux::Mux(AVFormatContext *avctx, int width, int height, Codec codec) +HTTPD::Mux::Mux(AVFormatContext *avctx, int width, int height, Codec video_codec) : avctx(avctx) { - AVCodec *codec_video = avcodec_find_encoder((codec == CODEC_H264) ? AV_CODEC_ID_H264 : AV_CODEC_ID_RAWVIDEO); + AVCodec *codec_video = avcodec_find_encoder((video_codec == CODEC_H264) ? AV_CODEC_ID_H264 : AV_CODEC_ID_RAWVIDEO); avstream_video = avformat_new_stream(avctx, codec_video); if (avstream_video == nullptr) { fprintf(stderr, "avformat_new_stream() failed\n"); @@ -149,10 +149,10 @@ HTTPD::Mux::Mux(AVFormatContext *avctx, int width, int height, Codec codec) } avstream_video->time_base = AVRational{1, TIMEBASE}; avstream_video->codec->codec_type = AVMEDIA_TYPE_VIDEO; - if (codec == CODEC_H264) { + if (video_codec == CODEC_H264) { avstream_video->codec->codec_id = AV_CODEC_ID_H264; } else { - assert(codec == CODEC_NV12); + assert(video_codec == CODEC_NV12); avstream_video->codec->codec_id = AV_CODEC_ID_RAWVIDEO; avstream_video->codec->codec_tag = avcodec_pix_fmt_to_codec_tag(AV_PIX_FMT_NV12); } @@ -246,16 +246,16 @@ HTTPD::Stream::Stream(AVOutputFormat *oformat, int width, int height) uint8_t *buf = (uint8_t *)av_malloc(MUX_BUFFER_SIZE); avctx->pb = avio_alloc_context(buf, MUX_BUFFER_SIZE, 1, this, nullptr, &HTTPD::Stream::write_packet_thunk, nullptr); - Mux::Codec codec; + Mux::Codec video_codec; if (global_flags.uncompressed_video_to_http) { - codec = Mux::CODEC_NV12; + video_codec = Mux::CODEC_NV12; } else { - codec = Mux::CODEC_H264; + video_codec = Mux::CODEC_H264; } avctx->flags = AVFMT_FLAG_CUSTOM_IO; - mux.reset(new Mux(avctx, width, height, codec)); + mux.reset(new Mux(avctx, width, height, video_codec)); } ssize_t HTTPD::Stream::reader_callback_thunk(void *cls, uint64_t pos, char *buf, size_t max) diff --git a/httpd.h b/httpd.h index f5bf55f..695c708 100644 --- a/httpd.h +++ b/httpd.h @@ -67,7 +67,7 @@ private: CODEC_NV12, // Uncompressed 4:2:0. }; - Mux(AVFormatContext *avctx, int width, int height, Codec codec); // Takes ownership of avctx. + Mux(AVFormatContext *avctx, int width, int height, Codec video_codec); // Takes ownership of avctx. ~Mux(); void add_packet(const AVPacket &pkt, int64_t pts, int64_t dts); -- 2.39.2