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
40
41/**
42 * Increment the reference count of this picture.
43 *
44 * \see libvlc_picture_release()
45 * \param pic A picture object
46 * \return the same object
47 */
50
51/**
52 * Decrement the reference count of this picture.
53 * When the reference count reaches 0, the picture will be released.
54 * The picture must not be accessed after calling this function.
55 *
56 * \see libvlc_picture_retain
57 * \param pic A picture object
58 */
59LIBVLC_API void
61
62/**
63 * Saves this picture to a file. The image format is the same as the one
64 * returned by \link libvlc_picture_type \endlink
65 *
66 * \param pic A picture object
67 * \param path The path to the generated file
68 * \return 0 in case of success, -1 otherwise
69 */
70LIBVLC_API int
71libvlc_picture_save( const libvlc_picture_t* pic, const char* path );
72
73/**
74 * Returns the image internal buffer, including potential padding.
75 * The libvlc_picture_t owns the returned buffer, which must not be modified nor
76 * freed.
77 *
78 * \param pic A picture object
79 * \param size A pointer to a size_t that will hold the size of the buffer [required]
80 * \return A pointer to the internal buffer.
81 */
82LIBVLC_API const unsigned char*
83libvlc_picture_get_buffer( const libvlc_picture_t* pic, size_t *size );
84
85/**
86 * Returns the picture type
87 *
88 * \param pic A picture object
89 * \see libvlc_picture_type_t
90 */
93
94/**
95 * Returns the image stride, ie. the number of bytes per line.
96 * This can only be called on images of type libvlc_picture_Argb
97 *
98 * \param pic A picture object
99 */
100LIBVLC_API unsigned int
102
103/**
104 * Returns the width of the image in pixels
105 *
106 * \param pic A picture object
107 */
108LIBVLC_API unsigned int
110
111/**
112 * Returns the height of the image in pixels
113 *
114 * \param pic A picture object
115 */
116LIBVLC_API unsigned int
118
119/**
120 * Returns the time at which this picture was generated, in milliseconds
121 * \param pic A picture object
122 */
125
126/**
127 * Returns the number of pictures in the list
128 */
130
131/**
132 * Returns the picture at the provided index.
133 *
134 * If the index is out of bound, the result is undefined.
135 */
137 size_t index );
138
139/**
140 * Destroys a picture list and releases the pictures it contains
141 * \param list The list to destroy
142 *
143 * Calling this function with a NULL list is safe and will return immediately
144 */
146
147# ifdef __cplusplus
148}
149# endif
150
151#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_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.