Commit 8d599e76 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

stream: fix stream_MemoryNew() prototype

parent 8981edb4
......@@ -196,11 +196,18 @@ static inline char *stream_ContentType( stream_t *s )
}
/**
* Create a stream_t reading from memory.
* You must delete it using stream_Delete.
* Create a stream from a memory buffer.
*
* \param obj parent VLC object
* \param base start address of the memory buffer to read from
* \param size size in bytes of the memory buffer
* \param preserve if false, free(base) will be called when the stream is
* destroyed; if true, the memory buffer is preserved
*/
VLC_API stream_t * stream_MemoryNew(vlc_object_t *p_obj, uint8_t *p_buffer, uint64_t i_size, bool b_preserve_memory );
#define stream_MemoryNew( a, b, c, d ) stream_MemoryNew( VLC_OBJECT(a), b, c, d )
VLC_API stream_t *stream_MemoryNew(vlc_object_t *obj, uint8_t *base,
size_t size, bool preserve) VLC_USED;
#define stream_MemoryNew(a, b, c, d) \
stream_MemoryNew(VLC_OBJECT(a), b, c, d)
/**
* Create a stream_t reading from a URL.
......
......@@ -41,18 +41,8 @@ static int Seek( stream_t *, uint64_t );
static int Control( stream_t *, int i_query, va_list );
static void Delete ( stream_t * );
#undef stream_MemoryNew
/**
* Create a stream from a memory buffer
*
* \param p_this the calling vlc_object
* \param p_buffer the memory buffer for the stream
* \param i_buffer the size of the buffer
* \param i_preserve_memory if this is set to false the memory buffer
* pointed to by p_buffer is freed on stream_Destroy
*/
stream_t *stream_MemoryNew( vlc_object_t *p_this, uint8_t *p_buffer,
uint64_t i_size, bool i_preserve_memory )
stream_t *(stream_MemoryNew)(vlc_object_t *p_this, uint8_t *p_buffer,
size_t i_size, bool i_preserve_memory)
{
stream_t *s = stream_CommonNew( p_this, Delete );
stream_sys_t *p_sys;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment