VLC  4.0.0-dev
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
27 extern "C" {
28 # endif
29 
31 
33 {
38 
39 /**
40  * Increment the reference count of this picture.
41  *
42  * \see libvlc_picture_release()
43  * \param pic A picture object
44  */
45 LIBVLC_API void
47 
48 /**
49  * Decrement the reference count of this picture.
50  * When the reference count reaches 0, the picture will be released.
51  * The picture must not be accessed after calling this function.
52  *
53  * \see libvlc_picture_retain
54  * \param pic A picture object
55  */
56 LIBVLC_API void
58 
59 /**
60  * Saves this picture to a file. The image format is the same as the one
61  * returned by \link libvlc_picture_type \endlink
62  *
63  * \param pic A picture object
64  * \param path The path to the generated file
65  * \return 0 in case of success, -1 otherwise
66  */
67 LIBVLC_API int
68 libvlc_picture_save( const libvlc_picture_t* pic, const char* path );
69 
70 /**
71  * Returns the image internal buffer, including potential padding.
72  * The libvlc_picture_t owns the returned buffer, which must not be modified nor
73  * freed.
74  *
75  * \param pic A picture object
76  * \param size A pointer to a size_t that will hold the size of the buffer [required]
77  * \return A pointer to the internal buffer.
78  */
79 LIBVLC_API const unsigned char*
80 libvlc_picture_get_buffer( const libvlc_picture_t* pic, size_t *size );
81 
82 /**
83  * Returns the picture type
84  *
85  * \param pic A picture object
86  * \see libvlc_picture_type_t
87  */
88 LIBVLC_API libvlc_picture_type_t
90 
91 /**
92  * Returns the image stride, ie. the number of bytes per line.
93  * This can only be called on images of type libvlc_picture_Argb
94  *
95  * \param pic A picture object
96  */
97 LIBVLC_API unsigned int
99 
100 /**
101  * Returns the width of the image in pixels
102  *
103  * \param pic A picture object
104  */
105 LIBVLC_API unsigned int
107 
108 /**
109  * Returns the height of the image in pixels
110  *
111  * \param pic A picture object
112  */
113 LIBVLC_API unsigned int
115 
116 /**
117  * Returns the time at which this picture was generated, in milliseconds
118  * \param pic A picture object
119  */
122 
123 # ifdef __cplusplus
124 }
125 # endif
126 
127 #endif // VLC_LIBVLC_PICTURE_H
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 unsigned int libvlc_picture_get_height(const libvlc_picture_t *pic)
Returns the height of the image in pixels.
#define LIBVLC_API
Definition: libvlc.h:42
Definition: libvlc_picture.h:35
struct libvlc_picture_t libvlc_picture_t
Definition: libvlc_picture.h:30
LIBVLC_API int libvlc_picture_save(const libvlc_picture_t *pic, const char *path)
Saves this picture to a file.
Definition: libvlc_picture.h:34
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.
Definition: libvlc_picture.h:36
libvlc_picture_type_t
Definition: libvlc_picture.h:32
LIBVLC_API void libvlc_picture_retain(libvlc_picture_t *pic)
Increment 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_API libvlc_picture_type_t libvlc_picture_type(const libvlc_picture_t *pic)
Returns the picture type.
LIBVLC_API unsigned int libvlc_picture_get_width(const libvlc_picture_t *pic)
Returns the width of the image in pixels.
int64_t libvlc_time_t
Definition: libvlc.h:78
LIBVLC_API void libvlc_picture_release(libvlc_picture_t *pic)
Decrement the reference count of this picture.