Commit 1cf827db authored by Laurent Aimar's avatar Laurent Aimar

Clean up vout object creation/destruction.

parent 0ae5c1cd
This diff is collapsed.
......@@ -42,15 +42,25 @@
/* */
struct vout_thread_sys_t
{
/* module */
char *psz_module_name;
/* Video output configuration */
config_chain_t *p_cfg;
/* Splitter module if used */
char *splitter_name;
/* */
video_format_t original; /* Original format ie coming from the decoder */
/* Snapshot interface */
vout_snapshot_t snapshot;
/* Statistics */
vout_statistic_t statistic;
/* Subpicture unit */
spu_t *p_spu;
/* Monitor Pixel Aspect Ratio */
unsigned int i_par_num;
unsigned int i_par_den;
/* Thread & synchronization */
vlc_thread_t thread;
bool dead;
......@@ -90,26 +100,12 @@ struct vout_thread_sys_t
} title;
/* */
unsigned int i_par_num; /**< monitor pixel aspect-ratio */
unsigned int i_par_den; /**< monitor pixel aspect-ratio */
bool is_late_dropped;
/* Statistics */
vout_statistic_t statistic;
/* Filter chain */
char *psz_filter_chain;
/* Video filter2 chain */
vlc_mutex_t vfilter_lock;
filter_chain_t *vfilter_chain;
/* Snapshot interface */
vout_snapshot_t snapshot;
/* Subpicture unit */
spu_t *p_spu;
/* */
vlc_mouse_t mouse;
......@@ -132,6 +128,7 @@ void vout_ControlChangeSampleAspectRatio(vout_thread_t *, unsigned num, unsigned
void vout_ControlChangeCropRatio(vout_thread_t *, unsigned num, unsigned den);
void vout_ControlChangeCropWindow(vout_thread_t *, int x, int y, int width, int height);
void vout_ControlChangeCropBorder(vout_thread_t *, int left, int top, int right, int bottom);
void vout_ControlChangeFilters(vout_thread_t *, const char *);
/* */
void vout_IntfInit( vout_thread_t * );
......
......@@ -69,6 +69,10 @@ static int FullscreenCallback( vlc_object_t *, char const *,
vlc_value_t, vlc_value_t, void * );
static int SnapshotCallback( vlc_object_t *, char const *,
vlc_value_t, vlc_value_t, void * );
static int VideoFilterCallback( vlc_object_t *, char const *,
vlc_value_t, vlc_value_t, void * );
static int VideoSplitterCallback( vlc_object_t *, char const *,
vlc_value_t, vlc_value_t, void * );
static int TitleShowCallback( vlc_object_t *, char const *,
vlc_value_t, vlc_value_t, void * );
......@@ -351,6 +355,20 @@ void vout_IntfInit( vout_thread_t *p_vout )
var_Change( p_vout, "video-snapshot", VLC_VAR_SETTEXT, &text, NULL );
var_AddCallback( p_vout, "video-snapshot", SnapshotCallback, NULL );
/* Add a video-filter variable */
var_Create( p_vout, "video-filter",
VLC_VAR_STRING | VLC_VAR_DOINHERIT | VLC_VAR_ISCOMMAND );
var_AddCallback( p_vout, "video-filter", VideoFilterCallback, NULL );
var_TriggerCallback( p_vout, "video-filter" );
/* Add a video-splitter variable
* TODO rename vout-filter into vout-splitter */
var_Create( p_vout, "vout-filter",
VLC_VAR_STRING | VLC_VAR_DOINHERIT | VLC_VAR_ISCOMMAND );
text.psz_string = _("Video splitter");
var_Change( p_vout, "vout-filter", VLC_VAR_SETTEXT, &text, NULL );
var_AddCallback( p_vout, "vout-filter", VideoSplitterCallback, NULL );
/* Mouse coordinates */
var_Create( p_vout, "mouse-button-down", VLC_VAR_INTEGER );
var_Create( p_vout, "mouse-moved", VLC_VAR_COORDS );
......@@ -727,6 +745,42 @@ static int SnapshotCallback( vlc_object_t *p_this, char const *psz_cmd,
return VLC_SUCCESS;
}
static int VideoFilterCallback( vlc_object_t *p_this, char const *psz_cmd,
vlc_value_t oldval, vlc_value_t newval, void *p_data)
{
vout_thread_t *p_vout = (vout_thread_t *)p_this;
VLC_UNUSED(psz_cmd); VLC_UNUSED(oldval); VLC_UNUSED(p_data);
vout_ControlChangeFilters( p_vout, newval.psz_string );
return VLC_SUCCESS;
}
static int VideoSplitterCallback( vlc_object_t *p_this, char const *psz_cmd,
vlc_value_t oldval, vlc_value_t newval, void *p_data )
{
vout_thread_t *p_vout = (vout_thread_t *)p_this;
input_thread_t *p_input;
(void)psz_cmd; (void)oldval; (void)p_data;
p_input = (input_thread_t *)vlc_object_find( p_this, VLC_OBJECT_INPUT,
FIND_PARENT );
if (!p_input)
{
msg_Err( p_vout, "Input not found" );
return VLC_EGENERIC;
}
/* Modify input as well because the vout might have to be restarted */
var_Create( p_input, "vout-filter", VLC_VAR_STRING );
var_SetString( p_input, "vout-filter", newval.psz_string );
/* Now restart current video stream */
input_Control( p_input, INPUT_RESTART_ES, -VIDEO_ES );
vlc_object_release( p_input );
return VLC_SUCCESS;
}
static int TitleShowCallback( vlc_object_t *p_this, char const *psz_cmd,
vlc_value_t oldval, vlc_value_t newval, void *p_data )
{
......
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