Commit f1faf78d authored by Thomas Guillem's avatar Thomas Guillem

vout: hide vout_Request/vout_Close

So that we can use private structs to initialize the vout.
parent 815afd60
......@@ -45,17 +45,6 @@
* Video output thread interface
*/
/**
* Vout configuration
*/
typedef struct {
vout_thread_t *vout;
vlc_object_t *input;
bool change_fmt;
const video_format_t *fmt;
unsigned dpb_size;
} vout_configuration_t;
/**
* Video output thread private structure
*/
......@@ -87,45 +76,6 @@ struct vout_thread_t {
* Prototypes
*****************************************************************************/
/**
* Returns a suitable vout or release the given one.
*
* If cfg->fmt is non NULL and valid, a vout will be returned, reusing cfg->vout
* is possible, otherwise it returns NULL.
* If cfg->vout is not used, it will be closed and released.
*
* You can release the returned value either by vout_Request or vout_Close()
* followed by a vlc_object_release() or shorter vout_CloseAndRelease()
*
* \param object a vlc object
* \param cfg the video configuration requested.
* \return a vout
*/
VLC_API vout_thread_t * vout_Request( vlc_object_t *object, const vout_configuration_t *cfg );
#define vout_Request(a,b) vout_Request(VLC_OBJECT(a),b)
/**
* This function will close a vout created by vout_Request.
* The associated vout module is closed.
* Note: It is not released yet, you'll have to call vlc_object_release()
* or use the convenient vout_CloseAndRelease().
*
* \param p_vout the vout to close
*/
VLC_API void vout_Close( vout_thread_t *p_vout );
/**
* This function will close a vout created by vout_Create
* and then release it.
*
* \param p_vout the vout to close and release
*/
static inline void vout_CloseAndRelease( vout_thread_t *p_vout )
{
vout_Close( p_vout );
vlc_object_release( p_vout );
}
/**
* This function will handle a snapshot request.
*
......
......@@ -703,7 +703,6 @@ vlm_MessageNew
vlm_MessageSimpleNew
vlm_New
vout_ChangeAspectRatio
vout_Close
vout_GetPicture
vout_PutPicture
vout_PutSubpicture
......@@ -715,7 +714,6 @@ vout_OSDMessage
vout_OSDEpg
vout_OSDSlider
vout_OSDText
vout_Request
vout_window_New
vout_window_Delete
vout_display_GetDefaultDisplaySize
......
......@@ -27,7 +27,7 @@
#include <vlc_common.h>
#include <vlc_vout.h>
#include "control.h"
#include "vout_internal.h"
/* */
void vout_control_cmd_Init(vout_control_cmd_t *cmd, int type)
......
......@@ -29,7 +29,6 @@
#include <vlc_picture_pool.h>
#include <vlc_vout_display.h>
#include <vlc_vout_wrapper.h>
#include "control.h"
#include "snapshot.h"
#include "statistic.h"
#include "chrono.h"
......@@ -42,6 +41,18 @@
*/
#define VOUT_MAX_PICTURES (20)
/**
* Vout configuration
*/
typedef struct {
vout_thread_t *vout;
vlc_object_t *input;
bool change_fmt;
const video_format_t *fmt;
unsigned dpb_size;
} vout_configuration_t;
#include "control.h"
/* */
struct vout_thread_sys_t
{
......@@ -137,6 +148,45 @@ struct vout_thread_sys_t
vout_chrono_t render; /**< picture render time estimator */
};
/**
* Returns a suitable vout or release the given one.
*
* If cfg->fmt is non NULL and valid, a vout will be returned, reusing cfg->vout
* is possible, otherwise it returns NULL.
* If cfg->vout is not used, it will be closed and released.
*
* You can release the returned value either by vout_Request or vout_Close()
* followed by a vlc_object_release() or shorter vout_CloseAndRelease()
*
* \param object a vlc object
* \param cfg the video configuration requested.
* \return a vout
*/
vout_thread_t * vout_Request( vlc_object_t *object, const vout_configuration_t *cfg );
#define vout_Request(a,b) vout_Request(VLC_OBJECT(a),b)
/**
* This function will close a vout created by vout_Request.
* The associated vout module is closed.
* Note: It is not released yet, you'll have to call vlc_object_release()
* or use the convenient vout_CloseAndRelease().
*
* \param p_vout the vout to close
*/
void vout_Close( vout_thread_t *p_vout );
/**
* This function will close a vout created by vout_Create
* and then release it.
*
* \param p_vout the vout to close and release
*/
static inline void vout_CloseAndRelease( vout_thread_t *p_vout )
{
vout_Close( p_vout );
vlc_object_release( p_vout );
}
/* TODO to move them to vlc_vout.h */
void vout_ControlChangeFullscreen(vout_thread_t *, bool fullscreen);
void vout_ControlChangeWindowState(vout_thread_t *, unsigned state);
......
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