Merge pull request #26287 from CrystalP/ref-savefilestatejob
[xbmc.git] / xbmc / cores / RetroPlayer / streams / IRetroPlayerStream.h
blobdddf3ff83f9f6a3ec659ca9834328d610dc3806a
1 /*
2 * Copyright (C) 2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
7 */
9 #pragma once
11 #include "RetroPlayerStreamTypes.h"
13 namespace KODI
15 namespace RETRO
18 struct StreamProperties
22 struct StreamBuffer
26 struct StreamPacket
30 class IRetroPlayerStream
32 public:
33 virtual ~IRetroPlayerStream() = default;
35 /*!
36 * \brief Open a stream
38 * \return True if the stream was opened, false otherwise
40 virtual bool OpenStream(const StreamProperties& properties) = 0;
42 /*!
43 * \brief Get a buffer for zero-copy stream data
45 * \param width The framebuffer width, or 0 for no width specified
46 * \param height The framebuffer height, or 0 for no height specified
47 * \param[out] buffer The buffer, or unmodified if false is returned
49 * \return True if a buffer was returned, false otherwise
51 virtual bool GetStreamBuffer(unsigned int width, unsigned int height, StreamBuffer& buffer) = 0;
53 /*!
54 * \brief Add a data packet to a stream
56 * \param packet The data packet
58 virtual void AddStreamData(const StreamPacket& packet) = 0;
60 /*!
61 * \brief Close the stream
63 virtual void CloseStream() = 0;
66 } // namespace RETRO
67 } // namespace KODI