VLC 4.0.0-dev
Loading...
Searching...
No Matches
libvlc_picture.h
Go to the documentation of this file.
1/*****************************************************************************
2 * libvlc_picture.h: libvlc external API
3 *****************************************************************************
4 * Copyright (C) 2018 VLC authors and VideoLAN
5 *
6 * Authors: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU Lesser General Public License as published by
10 * the Free Software Foundation; either version 2.1 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public License
19 * along with this program; if not, write to the Free Software Foundation,
20 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
21 *****************************************************************************/
22
23#ifndef VLC_LIBVLC_PICTURE_H
24#define VLC_LIBVLC_PICTURE_H 1
25
26# ifdef __cplusplus
27extern "C" {
28# endif
29
32
41
42/**
43 * Increment the reference count of this picture.
44 *
45 * \see libvlc_picture_release()
46 * \param pic A picture object
47 * \return the same object
48 */
51
52/**
53 * Decrement the reference count of this picture.
54 * When the reference count reaches 0, the picture will be released.
55 * The picture must not be accessed after calling this function.
56 *
57 * \see libvlc_picture_retain
58 * \param pic A picture object
59 */
60LIBVLC_API void
62
63/**
64 * Saves this picture to a file. The image format is the same as the one
65 * returned by \link libvlc_picture_type \endlink
66 *
67 * \param pic A picture object
68 * \param path The path to the generated file
69 * \return 0 in case of success, -1 otherwise
70 */
71LIBVLC_API int
72libvlc_picture_save( const libvlc_picture_t* pic, const char* path );
73
74/**
75 * Returns the image internal buffer, including potential padding.
76 * The libvlc_picture_t owns the returned buffer, which must not be modified nor
77 * freed.
78 *
79 * \param pic A picture object
80 * \param size A pointer to a size_t that will hold the size of the buffer [required]
81 * \return A pointer to the internal buffer.
82 */
83LIBVLC_API const unsigned char*
84libvlc_picture_get_buffer( const libvlc_picture_t* pic, size_t *size );
85
86/**
87 * Returns the picture type
88 *
89 * \param pic A picture object
90 * \see libvlc_picture_type_t
91 */
94
95/**
96 * Returns the image stride, ie. the number of bytes per line.
97 * This can only be called on images of type libvlc_picture_Argb
98 *
99 * \param pic A picture object
100 */
101LIBVLC_API unsigned int
103
104/**
105 * Returns the width of the image in pixels
106 *
107 * \param pic A picture object
108 */
109LIBVLC_API unsigned int
111
112/**
113 * Returns the height of the image in pixels
114 *
115 * \param pic A picture object
116 */
117LIBVLC_API unsigned int
119
120/**
121 * Returns the time at which this picture was generated, in milliseconds
122 * \param pic A picture object
123 */
126
127/**
128 * Returns the number of pictures in the list
129 */
131
132/**
133 * Returns the picture at the provided index.
134 *
135 * If the index is out of bound, the result is undefined.
136 */
138 size_t index );
139
140/**
141 * Destroys a picture list and releases the pictures it contains
142 * \param list The list to destroy
143 *
144 * Calling this function with a NULL list is safe and will return immediately
145 */
147
148# ifdef __cplusplus
149}
150# endif
151
152#endif // VLC_LIBVLC_PICTURE_H
struct vlc_param ** list
Definition core.c:402
int64_t libvlc_time_t
Definition libvlc.h:78
#define LIBVLC_API
Definition libvlc.h:42
struct libvlc_picture_t libvlc_picture_t
Definition libvlc_events.h:45
struct libvlc_picture_list_t libvlc_picture_list_t
Definition libvlc_events.h:46
LIBVLC_API libvlc_picture_t * libvlc_picture_list_at(const libvlc_picture_list_t *list, size_t index)
Returns the picture at the provided index.
LIBVLC_API const unsigned char * libvlc_picture_get_buffer(const libvlc_picture_t *pic, size_t *size)
Returns the image internal buffer, including potential padding.
LIBVLC_API libvlc_time_t libvlc_picture_get_time(const libvlc_picture_t *pic)
Returns the time at which this picture was generated, in milliseconds.
LIBVLC_API libvlc_picture_t * libvlc_picture_retain(libvlc_picture_t *pic)
Increment the reference count of this picture.
LIBVLC_API unsigned int libvlc_picture_get_width(const libvlc_picture_t *pic)
Returns the width of the image in pixels.
LIBVLC_API void libvlc_picture_release(libvlc_picture_t *pic)
Decrement the reference count of this picture.
LIBVLC_API unsigned int libvlc_picture_get_stride(const libvlc_picture_t *pic)
Returns the image stride, ie.
libvlc_picture_type_t
Definition libvlc_picture.h:34
@ libvlc_picture_Argb
Definition libvlc_picture.h:35
@ libvlc_picture_Rgba
Definition libvlc_picture.h:39
@ libvlc_picture_Jpg
Definition libvlc_picture.h:37
@ libvlc_picture_Png
Definition libvlc_picture.h:36
@ libvlc_picture_WebP
Definition libvlc_picture.h:38
LIBVLC_API int libvlc_picture_save(const libvlc_picture_t *pic, const char *path)
Saves this picture to a file.
LIBVLC_API void libvlc_picture_list_destroy(libvlc_picture_list_t *list)
Destroys a picture list and releases the pictures it contains.
LIBVLC_API size_t libvlc_picture_list_count(const libvlc_picture_list_t *list)
Returns the number of pictures in the list.
LIBVLC_API unsigned int libvlc_picture_get_height(const libvlc_picture_t *pic)
Returns the height of the image in pixels.
LIBVLC_API libvlc_picture_type_t libvlc_picture_type(const libvlc_picture_t *pic)
Returns the picture type.