From patchwork Mon May 25 19:42:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 19864 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 70F88449D0B for ; Mon, 25 May 2020 22:43:18 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4C8DC6882F0; Mon, 25 May 2020 22:43:18 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E3229688079 for ; Mon, 25 May 2020 22:43:11 +0300 (EEST) Received: by mail-wr1-f44.google.com with SMTP id x14so12726372wrp.2 for ; Mon, 25 May 2020 12:43:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=3eQcd0LzWj8wVe4l2H/rZ12opf/2Cq4Ji2SIsntBYQE=; b=EkLMBU2u5qHa6yBlSfR3SsIVhOltOrmYkH6QWEAaQub6eekd314FIjeYd+/a3ewuiF tLj4fitAkXe0nOR4VzotiNnNWR4oTxMQPx0TASe6rqVNSPerlxR8dGBmmS4ncvPW1JdR s6Got+JDFinhrzgYWiD5AYcn0fxlRCcmyYl5m9ZwLwBhCVvAdneT6w0ytAtoygIENlE8 c/YRGpmADpbsyYOPIx81j60EtpHPFr2kuU4mIE6sra2BQ4IrZpsQVx5ohijSp19LetUQ YLAnPqQbj7zG7zi+A9DLW7brv6iPsUGuCNTHE37AhWMIha1eRM5uBR78/gw+h4DpH/tD Fkbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=3eQcd0LzWj8wVe4l2H/rZ12opf/2Cq4Ji2SIsntBYQE=; b=OdrlAoeEbC32RckgT7LndjAVrs11+hYqmFszYTHjGwjx99a6TqUVGt6Z183UsZykJA 38/W0jfxLbCDA02ln9zWkdsxDk/Ha4NNsvpGusd7ZOBaD4eDBjkBp6SEZf9LsK5PwYhm D796am/K50g6QOT4AelPUpe8Iik477AUki0G9kEnW+/FgbZ+gVLdEeiCJ3J8E2V+fetp 1JeMdvv6VRthKPP3HLJHalNMJnER2EXT7MNVJ7srQSVhHU1e45zzIRCQPxyB+ZyivsJN Ldu2vuiwRLp4544KGpLdOmv8Y2ukFAQoLqa+x8Sep5QigTeNzS1mrGelJfsJQ1LXdU+9 XIJQ== X-Gm-Message-State: AOAM530xAbbgnTTRS0+GjDdCdVyXn8g4hKED1BDeIfzLMco6nrBtIO98 hiVbQaiAI61zx9s7+9IyiUTcdw7U X-Google-Smtp-Source: ABdhPJwqKyhGnSIUrQSGDDBryH9FcefTc+D6wbIWFvXMkG/Vy/bWJ7ueGn3g2uY1HwM3tLXcYU86vg== X-Received: by 2002:adf:ef01:: with SMTP id e1mr15734902wro.28.1590435790756; Mon, 25 May 2020 12:43:10 -0700 (PDT) Received: from sblaptop.fritz.box (ipbcc1ab57.dynamic.kabel-deutschland.de. [188.193.171.87]) by smtp.gmail.com with ESMTPSA id l204sm9254368wmf.19.2020.05.25.12.43.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 May 2020 12:43:10 -0700 (PDT) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 25 May 2020 21:42:59 +0200 Message-Id: <20200525194302.24515-1-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/4] avformat/hlsplaylist: Add const where appropriate X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Andreas Rheinhardt --- libavformat/hlsplaylist.c | 27 ++++++++++++++++----------- libavformat/hlsplaylist.h | 23 +++++++++++++---------- 2 files changed, 29 insertions(+), 21 deletions(-) diff --git a/libavformat/hlsplaylist.c b/libavformat/hlsplaylist.c index 43f9d281ba..7a89846369 100644 --- a/libavformat/hlsplaylist.c +++ b/libavformat/hlsplaylist.c @@ -35,8 +35,10 @@ void ff_hls_write_playlist_version(AVIOContext *out, int version) { avio_printf(out, "#EXT-X-VERSION:%d\n", version); } -void ff_hls_write_audio_rendition(AVIOContext *out, char *agroup, - const char *filename, char *language, int name_id, int is_default) { +void ff_hls_write_audio_rendition(AVIOContext *out, const char *agroup, + const char *filename, const char *language, + int name_id, int is_default) +{ if (!out || !agroup || !filename) return; @@ -48,8 +50,10 @@ void ff_hls_write_audio_rendition(AVIOContext *out, char *agroup, avio_printf(out, "URI=\"%s\"\n", filename); } -void ff_hls_write_subtitle_rendition(AVIOContext *out, char *sgroup, - const char *filename, char *language, int name_id, int is_default) { +void ff_hls_write_subtitle_rendition(AVIOContext *out, const char *sgroup, + const char *filename, const char *language, + int name_id, int is_default) +{ if (!out || !filename) return; @@ -61,10 +65,11 @@ void ff_hls_write_subtitle_rendition(AVIOContext *out, char *sgroup, avio_printf(out, "URI=\"%s\"\n", filename); } -void ff_hls_write_stream_info(AVStream *st, AVIOContext *out, - int bandwidth, const char *filename, char *agroup, - char *codecs, char *ccgroup, char *sgroup) { - +void ff_hls_write_stream_info(AVStream *st, AVIOContext *out, int bandwidth, + const char *filename, const char *agroup, + const char *codecs, const char *ccgroup, + const char *sgroup) +{ if (!out || !filename) return; @@ -112,7 +117,7 @@ void ff_hls_write_playlist_header(AVIOContext *out, int version, int allowcache, } } -void ff_hls_write_init_file(AVIOContext *out, char *filename, +void ff_hls_write_init_file(AVIOContext *out, const char *filename, int byterange_mode, int64_t size, int64_t pos) { avio_printf(out, "#EXT-X-MAP:URI=\"%s\"", filename); if (byterange_mode) { @@ -125,8 +130,8 @@ int ff_hls_write_file_entry(AVIOContext *out, int insert_discont, int byterange_mode, double duration, int round_duration, int64_t size, int64_t pos, //Used only if HLS_SINGLE_FILE flag is set - char *baseurl, //Ignored if NULL - char *filename, double *prog_date_time, + const char *baseurl /* Ignored if NULL */, + const char *filename, double *prog_date_time, int64_t video_keyframe_size, int64_t video_keyframe_pos, int iframe_mode) { if (!out || !filename) return AVERROR(EINVAL); diff --git a/libavformat/hlsplaylist.h b/libavformat/hlsplaylist.h index a124bdcffb..4348a26c75 100644 --- a/libavformat/hlsplaylist.h +++ b/libavformat/hlsplaylist.h @@ -37,24 +37,27 @@ typedef enum { } PlaylistType; void ff_hls_write_playlist_version(AVIOContext *out, int version); -void ff_hls_write_audio_rendition(AVIOContext *out, char *agroup, - const char *filename, char *language, int name_id, int is_default); -void ff_hls_write_subtitle_rendition(AVIOContext *out, char *sgroup, - const char *filename, char *language, int name_id, int is_default); -void ff_hls_write_stream_info(AVStream *st, AVIOContext *out, - int bandwidth, const char *filename, char *agroup, - char *codecs, char *ccgroup, char *sgroup); +void ff_hls_write_audio_rendition(AVIOContext *out, const char *agroup, + const char *filename, const char *language, + int name_id, int is_default); +void ff_hls_write_subtitle_rendition(AVIOContext *out, const char *sgroup, + const char *filename, const char *language, + int name_id, int is_default); +void ff_hls_write_stream_info(AVStream *st, AVIOContext *out, int bandwidth, + const char *filename, const char *agroup, + const char *codecs, const char *ccgroup, + const char *sgroup); void ff_hls_write_playlist_header(AVIOContext *out, int version, int allowcache, int target_duration, int64_t sequence, uint32_t playlist_type, int iframe_mode); -void ff_hls_write_init_file(AVIOContext *out, char *filename, +void ff_hls_write_init_file(AVIOContext *out, const char *filename, int byterange_mode, int64_t size, int64_t pos); int ff_hls_write_file_entry(AVIOContext *out, int insert_discont, int byterange_mode, double duration, int round_duration, int64_t size, int64_t pos, //Used only if HLS_SINGLE_FILE flag is set - char *baseurl, //Ignored if NULL - char *filename, double *prog_date_time, + const char *baseurl /* Ignored if NULL */, + const char *filename, double *prog_date_time, int64_t video_keyframe_size, int64_t video_keyframe_pos, int iframe_mode); void ff_hls_write_end_list (AVIOContext *out);