Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Andreas Rheinhardt <ffmpegagent-at-gmail.com@ffmpeg.org>
To: ffmpeg-devel@ffmpeg.org
Cc: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Subject: [FFmpeg-devel] [PATCH 1/4] avcodec/bytestream: Add const where appropriate
Date: Fri, 04 Jul 2025 13:44:54 +0000
Message-ID: <ba820e6eccf46f2a3e1e4afce29073426b5c18cb.1751636697.git.ffmpegagent@gmail.com> (raw)
In-Reply-To: <pull.106.ffstaging.FFmpeg.1751636697.ffmpegagent@gmail.com>

From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/bytestream.h | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/libavcodec/bytestream.h b/libavcodec/bytestream.h
index 67080604b9..9c13a2791b 100644
--- a/libavcodec/bytestream.h
+++ b/libavcodec/bytestream.h
@@ -77,11 +77,11 @@ static av_always_inline type bytestream2_get_ ## name(GetByteContext *g)       \
     }                                                                          \
     return bytestream2_get_ ## name ## u(g);                                   \
 }                                                                              \
-static av_always_inline type bytestream2_peek_ ## name ## u(GetByteContext *g) \
+static av_always_inline type bytestream2_peek_ ## name ## u(const GetByteContext *g) \
 {                                                                              \
     return read(g->buffer);                                                    \
 }                                                                              \
-static av_always_inline type bytestream2_peek_ ## name(GetByteContext *g)      \
+static av_always_inline type bytestream2_peek_ ## name(const GetByteContext *g)\
 {                                                                              \
     if (g->buffer_end - g->buffer < bytes)                                     \
         return 0;                                                              \
@@ -155,12 +155,12 @@ static av_always_inline void bytestream2_init_writer(PutByteContext *p,
     p->eof          = 0;
 }
 
-static av_always_inline int bytestream2_get_bytes_left(GetByteContext *g)
+static av_always_inline int bytestream2_get_bytes_left(const GetByteContext *g)
 {
     return g->buffer_end - g->buffer;
 }
 
-static av_always_inline int bytestream2_get_bytes_left_p(PutByteContext *p)
+static av_always_inline int bytestream2_get_bytes_left_p(const PutByteContext *p)
 {
     return p->buffer_end - p->buffer;
 }
@@ -189,22 +189,22 @@ static av_always_inline void bytestream2_skip_p(PutByteContext *p,
     p->buffer += size2;
 }
 
-static av_always_inline int bytestream2_tell(GetByteContext *g)
+static av_always_inline int bytestream2_tell(const GetByteContext *g)
 {
     return (int)(g->buffer - g->buffer_start);
 }
 
-static av_always_inline int bytestream2_tell_p(PutByteContext *p)
+static av_always_inline int bytestream2_tell_p(const PutByteContext *p)
 {
     return (int)(p->buffer - p->buffer_start);
 }
 
-static av_always_inline int bytestream2_size(GetByteContext *g)
+static av_always_inline int bytestream2_size(const GetByteContext *g)
 {
     return (int)(g->buffer_end - g->buffer_start);
 }
 
-static av_always_inline int bytestream2_size_p(PutByteContext *p)
+static av_always_inline int bytestream2_size_p(const PutByteContext *p)
 {
     return (int)(p->buffer_end - p->buffer_start);
 }
-- 
ffmpeg-codebot

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

  reply	other threads:[~2025-07-04 13:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-04 13:44 [FFmpeg-devel] [PATCH 0/4] Get bits buffer end ffmpegagent
2025-07-04 13:44 ` Andreas Rheinhardt [this message]
2025-07-04 13:44 ` [FFmpeg-devel] [PATCH 2/4] avcodec/vvc/dec: Don't use GetBit-API when byte-aligned Andreas Rheinhardt
2025-07-04 13:44 ` [FFmpeg-devel] [PATCH 3/4] avcodec/get_bits: Add get_bits_bytesize() Andreas Rheinhardt
2025-07-04 13:44 ` [FFmpeg-devel] [PATCH 4/4] avcodec/get_bits: Remove GetBitContext.buffer_end Andreas Rheinhardt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ba820e6eccf46f2a3e1e4afce29073426b5c18cb.1751636697.git.ffmpegagent@gmail.com \
    --to=ffmpegagent-at-gmail.com@ffmpeg.org \
    --cc=andreas.rheinhardt@outlook.com \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git