*****************************************************************************/
#include <stdlib.h> /* malloc(), free() */
#include <string.h>
-#include <unistd.h>
#include <vlc/vlc.h>
+
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+
#include <vlc/decoder.h>
+#include <vlc/input.h>
#include <vlc/intf.h>
#include <vlc/vout.h>
#include <osd.h>
-#include "stream_control.h"
-#include "input_ext-intf.h"
-#include "input_ext-dec.h"
-
#include "vlc_keys.h"
#include "browser_open.h"
#undef CMML_INTF_USE_TIMED_URIS
#undef CMML_INTF_DEBUG
-#undef CMML_INTF_SUBPICTURE_DEBUG
#undef CMML_INTF_HISTORY_DEBUG
/*****************************************************************************
msg_Dbg( p_intf, "freeing CMML interface" );
#endif
- /* Erase the anchor text description from the video output if it exists */
+ /* erase the anchor text description from the video output if it exists */
p_vout = vlc_object_find( p_intf, VLC_OBJECT_VOUT, FIND_ANYWHERE );
- if( p_vout != NULL && p_vout->p_subpicture != NULL )
+ if( p_vout )
{
- subpicture_t *p_subpic;
- int i_subpic;
-
- for( i_subpic = 0; i_subpic < VOUT_MAX_SUBPICTURES; i_subpic++ )
- {
- p_subpic = &p_vout->p_subpicture[i_subpic];
-
- if( p_subpic != NULL &&
- ( p_subpic->i_status == RESERVED_SUBPICTURE
- || p_subpic->i_status == READY_SUBPICTURE ) )
- {
- vout_DestroySubPicture( p_vout, p_subpic );
- }
- }
+ /* enable CMML as a subtitle track */
+ spu_Control( p_vout->p_spu, SPU_CHANNEL_CLEAR, DEFAULT_CHAN );
+ vlc_object_release( p_vout );
}
- if( p_vout ) vlc_object_release( p_vout );
var_DelCallback( p_intf->p_vlc, "key-pressed", KeyEvent, p_intf );
vlc_object_release( p_intf->p_sys->p_cmml_decoder );
-
+
free( p_intf->p_sys );
}
if( var_Get( p_primary_intf, "intf-displays-cmml-description", &val )
== VLC_SUCCESS )
{
- if( val.b_bool == VLC_TRUE ) return TRUE;
+ if( val.b_bool == VLC_TRUE )
+ {
+ vlc_object_release( p_primary_intf );
+ return VLC_TRUE;
+ }
}
+
+ vlc_object_release( p_primary_intf );
}
/* display anchor as subtitle on-screen */
history_t *p_history = NULL;
history_item_t *p_history_item = NULL;
char *psz_timed_url;
-
+
p_history = GetHistory( p_playlist );
/* create history item */
msg_Dbg( p_intf, "calling browser_Open with \"%s\"", psz_url );
#endif
(void) browser_Open( psz_url );
- playlist_Command( p_playlist, PLAYLIST_PAUSE, 0 );
+ playlist_Control( p_playlist, PLAYLIST_PAUSE, 0 );
}
free( psz_uri_to_load );
if( psz_anchor_url )
{
- /* Should display subtitle underlined and in blue,
- * but it looks like VLC doesn't implement any
- * text styles yet. D'oh! */
+ /* Should display subtitle underlined and in blue, but it looks
+ * like VLC doesn't implement any text styles yet. D'oh! */
p_style = &blue_with_underline;
}
/* TODO: p_subpicture doesn't have the proper i_x and i_y
* coordinates. Need to look at the subpicture display system to
* work out why. */
- if ( vout_ShowTextAbsolute( p_vout,
- psz_anchor_description, p_style, OSD_ALIGN_BOTTOM,
+ if ( vout_ShowTextAbsolute( p_vout, DEFAULT_CHAN,
+ psz_anchor_description, p_style, OSD_ALIGN_BOTTOM,
i_margin_h, i_margin_v, i_now, 0 ) == VLC_SUCCESS )
{
/* Displayed successfully */
-#ifdef CMML_INTF_SUBPICTURE_DEBUG
- msg_Dbg( p_intf, "subpicture created at (%d, %d) (%d, %d)",
- p_subpicture->i_x, p_subpicture->i_y,
- p_subpicture->i_width, p_subpicture->i_height );
-#endif
}
else
{