TombEngine/Libs/vlc/libvlc_picture.h

152 lines
4.4 KiB
C
Raw Normal View History

Video playback (#1625) * Work * Work * Update Video.cpp * Update Video.cpp * Update Video.cpp * Update Video.cpp * Update Video.cpp * Working playback * Update Video.cpp * Cleanups * Additions * Update Video.cpp * Formatting * Correct pausing/resuming * Remove .mov extension, as it's not supported * Use vector instead of array * Implement SetIntroVideoPath * Swap intro image and intro video to better reflect original legal sequence * Update Gameflow.lua * Simplify synchronization with VLC thread * Use Vector2i for sizes, only fetch video dimensions once * Rename callbacks, move logging callback to a class * Update Video.cpp * Update CHANGELOG.md * Removed empty OnDisplayFrame event * Rename * Stop video player if user pressed Alt+F4 * Allow background video playback * Update Video.cpp * Update Video.cpp * Fixed init errors * Restore .mov default extension for video playback * Update RendererDraw2D.cpp * Add video streaming for rectangular faces of room geometry * Remove magic and use normalized UVs instead * Use VIDEO_SPRITE_ID instead of NO_VALUE * Added more scripting API functions for video playback * Correct variable names * Shorten notification * Add GetVideoDominantColor * Do proper cleanup when alt+F4ing during video playback * Change game loop deinit to avoid several issues with cleaning up * Organise `VideoHandler` class * Randomize glow angle * Update comment * Update Video.cpp * Update Video.cpp * Fix issues with frame drops in exclusive mode * Optimize CPU usage in exclusive mode --------- Co-authored-by: Sezz <sezzary@outlook.com>
2025-04-20 22:06:07 +03:00
/*****************************************************************************
* libvlc_picture.h: libvlc external API
*****************************************************************************
* Copyright (C) 2018 VLC authors and VideoLAN
*
* Authors: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef VLC_LIBVLC_PICTURE_H
#define VLC_LIBVLC_PICTURE_H 1
# ifdef __cplusplus
extern "C" {
# endif
typedef struct libvlc_picture_t libvlc_picture_t;
typedef struct libvlc_picture_list_t libvlc_picture_list_t;
typedef enum libvlc_picture_type_t
{
libvlc_picture_Argb,
libvlc_picture_Png,
libvlc_picture_Jpg,
libvlc_picture_WebP,
} libvlc_picture_type_t;
/**
* Increment the reference count of this picture.
*
* \see libvlc_picture_release()
* \param pic A picture object
* \return the same object
*/
LIBVLC_API libvlc_picture_t *
libvlc_picture_retain( libvlc_picture_t* pic );
/**
* Decrement the reference count of this picture.
* When the reference count reaches 0, the picture will be released.
* The picture must not be accessed after calling this function.
*
* \see libvlc_picture_retain
* \param pic A picture object
*/
LIBVLC_API void
libvlc_picture_release( libvlc_picture_t* pic );
/**
* Saves this picture to a file. The image format is the same as the one
* returned by \link libvlc_picture_type \endlink
*
* \param pic A picture object
* \param path The path to the generated file
* \return 0 in case of success, -1 otherwise
*/
LIBVLC_API int
libvlc_picture_save( const libvlc_picture_t* pic, const char* path );
/**
* Returns the image internal buffer, including potential padding.
* The libvlc_picture_t owns the returned buffer, which must not be modified nor
* freed.
*
* \param pic A picture object
* \param size A pointer to a size_t that will hold the size of the buffer [required]
* \return A pointer to the internal buffer.
*/
LIBVLC_API const unsigned char*
libvlc_picture_get_buffer( const libvlc_picture_t* pic, size_t *size );
/**
* Returns the picture type
*
* \param pic A picture object
* \see libvlc_picture_type_t
*/
LIBVLC_API libvlc_picture_type_t
libvlc_picture_type( const libvlc_picture_t* pic );
/**
* Returns the image stride, ie. the number of bytes per line.
* This can only be called on images of type libvlc_picture_Argb
*
* \param pic A picture object
*/
LIBVLC_API unsigned int
libvlc_picture_get_stride( const libvlc_picture_t* pic );
/**
* Returns the width of the image in pixels
*
* \param pic A picture object
*/
LIBVLC_API unsigned int
libvlc_picture_get_width( const libvlc_picture_t* pic );
/**
* Returns the height of the image in pixels
*
* \param pic A picture object
*/
LIBVLC_API unsigned int
libvlc_picture_get_height( const libvlc_picture_t* pic );
/**
* Returns the time at which this picture was generated, in milliseconds
* \param pic A picture object
*/
LIBVLC_API libvlc_time_t
libvlc_picture_get_time( const libvlc_picture_t* pic );
/**
* Returns the number of pictures in the list
*/
LIBVLC_API size_t libvlc_picture_list_count( const libvlc_picture_list_t* list );
/**
* Returns the picture at the provided index.
*
* If the index is out of bound, the result is undefined.
*/
LIBVLC_API libvlc_picture_t* libvlc_picture_list_at( const libvlc_picture_list_t* list,
size_t index );
/**
* Destroys a picture list and releases the pictures it contains
* \param list The list to destroy
*
* Calling this function with a NULL list is safe and will return immediately
*/
LIBVLC_API void libvlc_picture_list_destroy( libvlc_picture_list_t* list );
# ifdef __cplusplus
}
# endif
#endif // VLC_LIBVLC_PICTURE_H