input/InputStream: pass std::span<std::byte> to Read()

This commit is contained in:
Max Kellermann
2024-05-13 10:47:57 +02:00
parent f28d10d934
commit 34f7b38f39
66 changed files with 248 additions and 274 deletions

View File

@@ -1,14 +1,15 @@
// SPDX-License-Identifier: GPL-2.0-or-later
// Copyright The Music Player Daemon Project
#ifndef MPD_FFMPEG_IO_HXX
#define MPD_FFMPEG_IO_HXX
#pragma once
extern "C" {
#include "libavformat/avio.h"
}
#include <cstddef>
#include <cstdint>
#include <span>
class DecoderClient;
class InputStream;
@@ -27,11 +28,9 @@ struct AvioStream {
bool Open();
private:
int Read(void *buffer, int size);
int Read(std::span<std::byte> dest);
int64_t Seek(int64_t pos, int whence);
static int _Read(void *opaque, uint8_t *buf, int size);
static int64_t _Seek(void *opaque, int64_t pos, int whence);
};
#endif