Commit 599cb183 authored by Derk-Jan Hartman's avatar Derk-Jan Hartman

* backported:...

* backported: [16030],[16033],[16049],[16050],[16051],[16067],[16068],[16070],[16075],[16078]-[16080],[16088],[16089],[16099],[16102],[16109],[16110],[16114],[16118],[16120],[16127],[16133],[16134],[16137],[16049],[16152],[16164]-[16167],[16176]

NOT backported: vfilter -> vfilter2, direct3D
parent c8e52e35
......@@ -101,7 +101,7 @@ STDMETHODIMP VLCConnectionPoint::Advise(IUnknown *pUnk, DWORD *pdwCookie)
pUnk->AddRef();
cd.pUnk = pUnk;
*pdwCookie = cd.dwCookie = _connections.size();
*pdwCookie = cd.dwCookie = _connections.size()+1;
_connections.push_back(cd);
......@@ -110,9 +110,9 @@ STDMETHODIMP VLCConnectionPoint::Advise(IUnknown *pUnk, DWORD *pdwCookie)
STDMETHODIMP VLCConnectionPoint::Unadvise(DWORD pdwCookie)
{
if( pdwCookie < _connections.size() )
if( (0 < pdwCookie) && (pdwCookie <= _connections.size()) )
{
CONNECTDATA cd = _connections[pdwCookie];
CONNECTDATA cd = _connections[pdwCookie-1];
if( NULL != cd.pUnk )
{
cd.pUnk->Release();
......
......@@ -39,9 +39,11 @@ public:
// IUnknown methods
STDMETHODIMP QueryInterface(REFIID riid, void **ppv)
{
if( NULL == ppv ) return E_POINTER;
if( NULL == ppv )
return E_POINTER;
if( (IID_IUnknown == riid)
&& (IID_IConnectionPoint == riid) ) {
|| (IID_IConnectionPoint == riid) )
{
AddRef();
*ppv = reinterpret_cast<LPVOID>(this);
return NOERROR;
......@@ -95,9 +97,11 @@ public:
// IUnknown methods
STDMETHODIMP QueryInterface(REFIID riid, void **ppv)
{
if( (NULL != ppv)
&& (IID_IUnknown == riid)
&& (IID_IConnectionPointContainer == riid) ) {
if( NULL == ppv)
return E_POINTER;
if( (IID_IUnknown == riid)
|| (IID_IConnectionPointContainer == riid) )
{
AddRef();
*ppv = reinterpret_cast<LPVOID>(this);
return NOERROR;
......
......@@ -37,9 +37,10 @@ public:
// IUnknown methods
STDMETHODIMP QueryInterface(REFIID riid, void **ppv)
{
if( (NULL != ppv)
&& (IID_IUnknown == riid)
&& (IID_IDataObject == riid) ) {
if( NULL == ppv)
return E_POINTER;
if( (IID_IUnknown == riid)
|| (IID_IDataObject == riid) ) {
AddRef();
*ppv = reinterpret_cast<LPVOID>(this);
return NOERROR;
......
......@@ -67,9 +67,10 @@ public:
// IUnknown methods
STDMETHODIMP QueryInterface(REFIID riid, void **ppv)
{
if( (NULL != ppv)
&& (IID_IUnknown == riid)
&& (IID_IObjectSafety == riid) )
if( NULL == ppv)
return E_POINTER;
if( (IID_IUnknown == riid)
|| (IID_IObjectSafety == riid) )
{
AddRef();
*ppv = reinterpret_cast<LPVOID>(this);
......
......@@ -36,9 +36,10 @@ public:
// IUnknown methods
STDMETHODIMP QueryInterface(REFIID riid, void **ppv)
{
if( (NULL != ppv)
&& (IID_IUnknown == riid)
&& (IID_IOleControl == riid) )
if( NULL == ppv )
return E_POINTER;
if( (IID_IUnknown == riid)
|| (IID_IOleControl == riid) )
{
AddRef();
*ppv = reinterpret_cast<LPVOID>(this);
......
......@@ -36,10 +36,11 @@ public:
// IUnknown methods
STDMETHODIMP QueryInterface(REFIID riid, void **ppv)
{
if( (NULL != ppv)
&& (IID_IUnknown == riid)
&& (IID_IOleWindow == riid)
&& (IID_IOleInPlaceActiveObject == riid) )
if( NULL == ppv )
return E_POINTER;
if( (IID_IUnknown == riid)
|| (IID_IOleWindow == riid)
|| (IID_IOleInPlaceActiveObject == riid) )
{
AddRef();
*ppv = reinterpret_cast<LPVOID>(this);
......
......@@ -34,10 +34,11 @@ public:
// IUnknown methods
STDMETHODIMP QueryInterface(REFIID riid, void **ppv)
{
if( (NULL != ppv)
&& (IID_IUnknown == riid)
&& (IID_IOleWindow == riid)
&& (IID_IOleInPlaceObject == riid) )
if( NULL == ppv )
return E_POINTER;
if( (IID_IUnknown == riid)
|| (IID_IOleWindow == riid)
|| (IID_IOleInPlaceObject == riid) )
{
AddRef();
*ppv = reinterpret_cast<LPVOID>(this);
......
......@@ -34,9 +34,10 @@ public:
// IUnknown methods
STDMETHODIMP QueryInterface(REFIID riid, void **ppv)
{
if( (NULL != ppv)
&& (IID_IUnknown == riid)
&& (IID_IOleObject == riid) )
if( NULL == ppv )
return E_POINTER;
if( (IID_IUnknown == riid)
|| (IID_IOleObject == riid) )
{
AddRef();
*ppv = reinterpret_cast<LPVOID>(this);
......
......@@ -36,10 +36,12 @@ public:
// IUnknown methods
STDMETHODIMP QueryInterface(REFIID riid, void **ppv)
{
if( (NULL != ppv)
&& (IID_IUnknown == riid)
&& (IID_IPersist == riid)
&& (IID_IPersistPropertyBag == riid) ) {
if( NULL == ppv )
return E_POINTER;
if( (IID_IUnknown == riid)
|| (IID_IPersist == riid)
|| (IID_IPersistPropertyBag == riid) )
{
AddRef();
*ppv = reinterpret_cast<LPVOID>(this);
return NOERROR;
......
......@@ -36,10 +36,12 @@ public:
// IUnknown methods
STDMETHODIMP QueryInterface(REFIID riid, void **ppv)
{
if( (NULL != ppv)
&& (IID_IUnknown == riid)
&& (IID_IPersist == riid)
&& (IID_IPersistStorage == riid) ) {
if( NULL == ppv )
return E_POINTER;
if( (IID_IUnknown == riid)
|| (IID_IPersist == riid)
|| (IID_IPersistStorage == riid) )
{
AddRef();
*ppv = reinterpret_cast<LPVOID>(this);
return NOERROR;
......
......@@ -213,7 +213,7 @@ public:
if( NULL == ppv )
return E_POINTER;
if( (IID_IUnknown == riid)
&& (IID_IPropertyBag == riid) )
|| (IID_IPropertyBag == riid) )
{
AddRef();
*ppv = reinterpret_cast<LPVOID>(this);
......
......@@ -36,10 +36,12 @@ public:
// IUnknown methods
STDMETHODIMP QueryInterface(REFIID riid, void **ppv)
{
if( (NULL != ppv)
&& (IID_IUnknown == riid)
&& (IID_IPersist == riid)
&& (IID_IPersistStreamInit == riid) ) {
if( NULL == ppv )
return E_POINTER;
if( (IID_IUnknown == riid)
|| (IID_IPersist == riid)
|| (IID_IPersistStreamInit == riid) )
{
AddRef();
*ppv = reinterpret_cast<LPVOID>(this);
return NOERROR;
......
......@@ -180,7 +180,8 @@ STDMETHODIMP VLCPluginClass::QueryInterface(REFIID riid, void **ppv)
if( NULL == ppv )
return E_INVALIDARG;
if( (IID_IUnknown == riid) || (IID_IClassFactory == riid) )
if( (IID_IUnknown == riid)
|| (IID_IClassFactory == riid) )
{
AddRef();
*ppv = reinterpret_cast<LPVOID>(this);
......
......@@ -36,10 +36,12 @@ public:
// IUnknown methods
STDMETHODIMP QueryInterface(REFIID riid, void **ppv)
{
if( (NULL != ppv)
&& (IID_IUnknown == riid)
&& (IID_IProvideClassInfo == riid)
&& (IID_IProvideClassInfo2 == riid) ) {
if( NULL == ppv )
return E_POINTER;
if( (IID_IUnknown == riid)
|| (IID_IProvideClassInfo == riid)
|| (IID_IProvideClassInfo2 == riid) )
{
AddRef();
*ppv = reinterpret_cast<LPVOID>(this);
return NOERROR;
......
......@@ -108,13 +108,16 @@ VLCEnum<T>& VLCEnum<T>::operator=(const VLCEnum<T> &e)
template<class T>
STDMETHODIMP VLCEnum<T>::QueryInterface(REFIID riid, void **ppv)
{
if( NULL == ppv ) return E_POINTER;
if( NULL == ppv )
return E_POINTER;
if( (IID_IUnknown == riid)
&& ( _riid == riid) ) {
|| (_riid == riid) )
{
AddRef();
*ppv = reinterpret_cast<LPVOID>(this);
return NOERROR;
}
// standalone object
return E_NOINTERFACE;
};
......
......@@ -37,11 +37,12 @@ public:
// IUnknown methods
STDMETHODIMP QueryInterface(REFIID riid, void **ppv)
{
if( (NULL != ppv)
&& (IID_IUnknown == riid)
&& (IID_IPersist == riid)
&& (IID_IViewObject == riid)
&& (IID_IViewObject2 == riid) ) {
if( NULL == ppv )
return E_POINTER;
if( (IID_IUnknown == riid)
|| (IID_IViewObject == riid)
|| (IID_IViewObject2 == riid) )
{
AddRef();
*ppv = reinterpret_cast<LPVOID>(this);
return NOERROR;
......
......@@ -37,10 +37,12 @@ public:
// IUnknown methods
STDMETHODIMP QueryInterface(REFIID riid, void **ppv)
{
if( (NULL != ppv)
&& (IID_IUnknown == riid)
&& (IID_IDispatch == riid)
&& (IID_IVLCControl == riid) ) {
if( NULL == ppv )
return E_POINTER;
if( (IID_IUnknown == riid)
|| (IID_IDispatch == riid)
|| (IID_IVLCControl == riid) )
{
AddRef();
*ppv = reinterpret_cast<LPVOID>(this);
return NOERROR;
......
......@@ -21,8 +21,10 @@ except KeyError:
if not srcdir:
srcdir = '.'
if os.sys.platform in ('win32', 'darwin'):
#if os.sys.platform in ('win32', 'darwin'):
# Do not use PIC version on win32 and Mac OS X
if True:
# PIC version seems to be disabled on all platforms
vlclib=os.path.join( top_builddir, 'src', 'libvlc.a' )
picflag=''
else:
......
......@@ -1181,6 +1181,78 @@ MediaControl_sound_get_volume( PyObject *self, PyObject *args )
return py_retval;
}
static PyObject*
MediaControl_set_rate( PyObject *self, PyObject *args )
{
mediacontrol_Exception* exception = NULL;
int rate;
if( !PyArg_ParseTuple( args, "i", &rate ) )
return NULL;
Py_BEGIN_ALLOW_THREADS
MC_TRY;
mediacontrol_set_rate( SELF->mc, rate, exception );
Py_END_ALLOW_THREADS
MC_EXCEPT;
Py_INCREF( Py_None );
return Py_None;
}
static PyObject*
MediaControl_get_rate( PyObject *self, PyObject *args )
{
mediacontrol_Exception* exception = NULL;
PyObject *py_retval;
int rate;
Py_BEGIN_ALLOW_THREADS
MC_TRY;
rate = mediacontrol_get_rate( SELF->mc, exception );
Py_END_ALLOW_THREADS
MC_EXCEPT;
py_retval = Py_BuildValue( "i", rate );
return py_retval;
}
static PyObject*
MediaControl_set_fullscreen( PyObject *self, PyObject *args )
{
mediacontrol_Exception* exception = NULL;
int fs;
if( !PyArg_ParseTuple( args, "i", &fs ) )
return NULL;
Py_BEGIN_ALLOW_THREADS
MC_TRY;
mediacontrol_set_fullscreen( SELF->mc, fs, exception );
Py_END_ALLOW_THREADS
MC_EXCEPT;
Py_INCREF( Py_None );
return Py_None;
}
static PyObject*
MediaControl_get_fullscreen( PyObject *self, PyObject *args )
{
mediacontrol_Exception* exception = NULL;
PyObject *py_retval;
int fs;
Py_BEGIN_ALLOW_THREADS
MC_TRY;
fs = mediacontrol_get_fullscreen( SELF->mc, exception );
Py_END_ALLOW_THREADS
MC_EXCEPT;
py_retval = Py_BuildValue( "i", fs );
return py_retval;
}
static PyObject*
MediaControl_set_visual( PyObject *self, PyObject *args )
{
......@@ -1235,6 +1307,14 @@ static PyMethodDef MediaControl_methods[] =
"sound_set_volume( int ) Set the volume" },
{ "set_visual", MediaControl_set_visual, METH_VARARGS,
"set_visual( int ) Set the embedding window visual ID" },
{ "get_rate", MediaControl_get_rate, METH_VARARGS,
"get_rate( ) -> int Get the rate" },
{ "set_rate", MediaControl_set_rate, METH_VARARGS,
"set_rate( int ) Set the rate" },
{ "get_fullscreen", MediaControl_get_fullscreen, METH_VARARGS,
"get_fullscreen( ) -> int Get the fullscreen status" },
{ "set_fullscreen", MediaControl_set_fullscreen, METH_VARARGS,
"set_fullscreen( int ) Set the fullscreen status" },
{ NULL, NULL, 0, NULL },
};
......
......@@ -29,11 +29,11 @@ class VLCObject(object):
def tree(self, prefix=" "):
"""Displays all children as a tree of VLCObject
"""
print prefix, self
res=prefix + str(self) + "\n"
for i in self._o.children():
t=VLCObject(i)
t.tree(prefix=prefix + " ")
return
res += t.tree(prefix=prefix + " ")
return res
def __getattribute__(self, attr):
"""Converts attribute access to access to variables.
......
......@@ -3732,7 +3732,7 @@ AC_ARG_ENABLE(svg,
if test "${enable_svg}" = "yes"
then
PKG_CHECK_MODULES(SVG,
librsvg-2.0 >= 2.5.0,
librsvg-2.0 >= 2.9.0,
[
VLC_ADD_LDFLAGS([svg],[$SVG_LIBS])
VLC_ADD_CFLAGS([svg],[$SVG_CFLAGS])
......@@ -4909,6 +4909,10 @@ AS_IF([test "${enable_gnutls}" != "no"], [
])
gnutls_LIBS="-lgcrypt -lz ${gcrypt_LIBS}"
AS_IF([test "${SYS}" = "darwin"], [
gnutls_LIBS="-lintl ${gnutls_LIBS}"
VLC_ADD_LDFLAGS([gnutls],[-lintl])
])
AC_CHECK_HEADER(gcrypt.h, [
AC_CHECK_LIB(gcrypt, gcry_control, [
......@@ -5306,6 +5310,19 @@ AS_IF([test "${enable_shared_libvlc}" != "no" || test "${enable_libtool}" != "no
AC_DEFINE(HAVE_SHARED_LIBVLC, 1, [Define to 1 if libvlc is built as a shared library.])
FILE_LIBVLC_DLL="!define LIBVLC_DLL libvlc.dll"],
FILE_LIBVLC_DLL="" )
dnl
dnl we need pic on amd64 fo the mozilla plugin
case "${target_cpu}" in
x86_64)
pic=pic
;;
*)
pic=""
;;
esac
AC_SUBST(pic)
dnl Import conditional variables generated by bootstrap
VLC_CONDITIONALS
......
......@@ -467,6 +467,32 @@ void libvlc_vlm_set_loop( libvlc_instance_t *, char *, int,
void libvlc_vlm_change_media( libvlc_instance_t *, char *, char *, char* ,
int, char **, int, int, libvlc_exception_t * );
/**
* Plays the named broadcast.
* \param p_instance the instance
* \param psz_name the name of the broadcast
* \param p_exception an initialized exception
*/
void libvlc_vlm_play_media ( libvlc_instance_t *, char *, libvlc_exception_t * );
/**
* Stops the named broadcast.
* \param p_instance the instance
* \param psz_name the name of the broadcast
* \param p_exception an initialized exception
*/
void libvlc_vlm_stop_media ( libvlc_instance_t *, char *, libvlc_exception_t * );
/**
* Pauses the named broadcast.
* \param p_instance the instance
* \param psz_name the name of the broadcast
* \param p_exception an initialized exception
*/
void libvlc_vlm_pause_media( libvlc_instance_t *, char *, libvlc_exception_t * );
/** @} */
/** @} */
......
......@@ -192,6 +192,21 @@ vlc_bool_t mediacontrol_set_visual( mediacontrol_Instance *self,
WINDOWHANDLE visual_id,
mediacontrol_Exception *exception );
/* Rate in percent. 100 is normal rate. */
int mediacontrol_get_rate( mediacontrol_Instance *self,
mediacontrol_Exception *exception );
void mediacontrol_set_rate( mediacontrol_Instance *self,
const int rate,
mediacontrol_Exception *exception );
int mediacontrol_get_fullscreen( mediacontrol_Instance *self,
mediacontrol_Exception *exception );
void mediacontrol_set_fullscreen( mediacontrol_Instance *self,
const int b_fullscreen,
mediacontrol_Exception *exception );
# ifdef __cplusplus
}
# endif
......
......@@ -142,6 +142,13 @@ struct subs_format_t
/**
* ES definition
*/
typedef struct extra_languages_t
{
char *psz_language;
char *psz_description;
} extra_languages_t;
struct es_format_t
{
int i_cat;
......@@ -156,8 +163,11 @@ struct es_format_t
-1 : mean not selected by default even
when no other stream
>=0: priority */
char *psz_language;
char *psz_description;
int i_extra_languages;
extra_languages_t *p_extra_languages;
audio_format_t audio;
video_format_t video;
......@@ -190,6 +200,9 @@ static inline void es_format_Init( es_format_t *fmt,
fmt->psz_language = NULL;
fmt->psz_description = NULL;
fmt->i_extra_languages = 0;
fmt->p_extra_languages = NULL;
memset( &fmt->audio, 0, sizeof(audio_format_t) );
memset( &fmt->video, 0, sizeof(video_format_t) );
memset( &fmt->subs, 0, sizeof(subs_format_t) );
......@@ -202,6 +215,7 @@ static inline void es_format_Init( es_format_t *fmt,
static inline void es_format_Copy( es_format_t *dst, es_format_t *src )
{
int i;
memcpy( dst, src, sizeof( es_format_t ) );
if( src->psz_language )
dst->psz_language = strdup( src->psz_language );
......@@ -229,6 +243,19 @@ static inline void es_format_Copy( es_format_t *dst, es_format_t *src )
memcpy( dst->video.p_palette, src->video.p_palette,
sizeof( video_palette_t ) );
}
dst->i_extra_languages = src->i_extra_languages;
dst->p_extra_languages = (extra_languages_t*) malloc( dst->i_extra_languages * sizeof(*dst->p_extra_languages ) );
for( i = 0; i < dst->i_extra_languages; i++ ) {
if( src->p_extra_languages[i].psz_language )
dst->p_extra_languages[i].psz_language = strdup(src->p_extra_languages[i].psz_language);
else
dst->p_extra_languages[i].psz_language = NULL;
if( src->p_extra_languages[i].psz_description )
dst->p_extra_languages[i].psz_description = strdup(src->p_extra_languages[i].psz_description);
else
dst->p_extra_languages[i].psz_description = NULL;
}
}
static inline void es_format_Clean( es_format_t *fmt )
......@@ -247,6 +274,18 @@ static inline void es_format_Clean( es_format_t *fmt )
if( fmt->subs.psz_encoding ) free( fmt->subs.psz_encoding );
fmt->subs.psz_encoding = NULL;
if( fmt->i_extra_languages && fmt->p_extra_languages ) {
int i = 0;
while( i < fmt->i_extra_languages ) {
if( fmt->p_extra_languages[i].psz_language )
free( fmt->p_extra_languages[i].psz_language );
if( fmt->p_extra_languages[i].psz_description )
free( fmt->p_extra_languages[i].psz_description );
i++;
}
free(fmt->p_extra_languages);
}
}
#endif
......@@ -427,13 +427,13 @@ static int Open ( vlc_object_t *p_this )
bInit = sub->initiate( 4 ); /* Constant ? */
else
bInit = sub->initiate();
if( strcasestr( sub->codecName(), "REAL" ) )
{
msg_Info( p_demux, "real codec detected, using real-RTSP instead" );
delete iter;
goto error;
}
}
if( !bInit )
{
......@@ -596,9 +596,9 @@ static int Open ( vlc_object_t *p_this )
}
#if LIVEMEDIA_LIBRARY_VERSION_INT >= 1141257600
/* Because the "faad" decoder does not handle the LATM data length field
at the start of each returned LATM frame, tell the RTP source to omit it. */
((MPEG4LATMAudioRTPSource*)sub->rtpSource())->omitLATMDataLengthField();
/* Because the "faad" decoder does not handle the LATM data length field
at the start of each returned LATM frame, tell the RTP source to omit it. */
((MPEG4LATMAudioRTPSource*)sub->rtpSource())->omitLATMDataLengthField();
#endif
}
else if( !strcmp( sub->codecName(), "MPEG4-GENERIC" ) )
......@@ -713,10 +713,7 @@ static int Open ( vlc_object_t *p_this )
}
}
if( tk->fmt.i_codec != VLC_FOURCC( 'u', 'n', 'd', 'f' ) )
{
tk->p_es = es_out_Add( p_demux->out, &tk->fmt );
}
tk->p_es = es_out_Add( p_demux->out, &tk->fmt );
if( sub->rtcpInstance() != NULL )
{
......
......@@ -3124,10 +3124,76 @@ static void PMTCallBack( demux_t *p_demux, dvbpsi_pmt_t *p_pmt )
if( p_decoded )
{
#if DR_0A_API_VER >= 2
pid->es->fmt.psz_language = malloc( 4 );
memcpy( pid->es->fmt.psz_language,
p_decoded->code[0].iso_639_code, 3 );
pid->es->fmt.psz_language[3] = 0;
msg_Dbg( p_demux, "found language: %s", pid->es->fmt.psz_language);
switch( p_decoded->code[0].i_audio_type ) {
case 0:
pid->es->fmt.psz_description = NULL;
break;
case 1:
pid->es->fmt.psz_description =
strdup(_("clean effects"));
break;
case 2:
pid->es->fmt.psz_description =
strdup(_("hearing impaired"));
break;
case 3:
pid->es->fmt.psz_description =
strdup(_("visual impaired commentary"));
break;
default:
msg_Dbg( p_demux, "unknown audio type: %d",
p_decoded->code[0].i_audio_type);
pid->es->fmt.psz_description = NULL;
break;
}
pid->es->fmt.i_extra_languages = p_decoded->i_code_count-1;
pid->es->fmt.p_extra_languages =
malloc( sizeof(*pid->es->fmt.p_extra_languages) *
pid->es->fmt.i_extra_languages );
for( i = 0; i < pid->es->fmt.i_extra_languages; i++ ) {
msg_Dbg( p_demux, "bang" );
pid->es->fmt.p_extra_languages[i].psz_language =
malloc(4);
memcpy(pid->es->fmt.p_extra_languages[i].psz_language,
p_decoded->code[i+1].iso_639_code, 3 );
pid->es->fmt.p_extra_languages[i].psz_language[3] = '\0';
switch( p_decoded->code[i].i_audio_type ) {
case 0:
pid->es->fmt.p_extra_languages[i].psz_description =
NULL;
break;
case 1:
pid->es->fmt.p_extra_languages[i].psz_description =
strdup(_("clean effects"));
break;
case 2:
pid->es->fmt.p_extra_languages[i].psz_description =
strdup(_("hearing impaired"));
break;
case 3:
pid->es->fmt.p_extra_languages[i].psz_description =
strdup(_("visual impaired commentary"));
break;
default:
msg_Dbg( p_demux, "unknown audio type: %d",
p_decoded->code[i].i_audio_type);
pid->es->fmt.psz_description = NULL;
break;
}
}
#else
pid->es->fmt.psz_language = malloc( 4 );
memcpy( pid->es->fmt.psz_language,
p_decoded->i_iso_639_code, 3 );
pid->es->fmt.psz_language[3] = 0;
#endif
}
}
}
......
......@@ -13,10 +13,8 @@ const int REMOTE_SWITCH_COOKIE=19;
@implementation AppleRemote
#pragma public interface
- (id) init {
if ( self = [super init] ) {
if ( self == [super init] ) {
openInExclusiveMode = YES;
queue = NULL;
hidDeviceInterface = NULL;
......@@ -154,7 +152,7 @@ static AppleRemote* sharedInstance=nil;
+ (AppleRemote*) sharedRemote {
@synchronized(self) {
if (sharedInstance == nil) {
if( sharedInstance == nil ) {
sharedInstance = [[self alloc] init];
}
}
......@@ -331,7 +329,7 @@ static void QueueCallbackFunction(void* target, IOReturn result, void* refcon,
memset(cookies, 0, sizeof(IOHIDElementCookie) * NUMBER_OF_APPLE_REMOTE_ACTIONS);
*/
allCookies = [[NSMutableArray alloc] init];
int i;
unsigned int i;
for (i=0; i< [elements count]; i++) {
element = [elements objectAtIndex:i];
......@@ -372,7 +370,7 @@ static void QueueCallbackFunction(void* target, IOReturn result, void* refcon,
if (queue) {
result = (*queue)->create(queue, 0, 12); //depth: maximum number of elements in queue before oldest elements in queue begin to be lost.
int i=0;
unsigned int i=0;
for(i=0; i<[allCookies count]; i++) {
IOHIDElementCookie cookie = (IOHIDElementCookie)[[allCookies objectAtIndex:i] intValue];
(*queue)->addElement(queue, cookie, 0);
......
......@@ -7,6 +7,7 @@
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Christophe Massiot <massiot@via.ecp.fr>
* Derk-Jan Hartman <hartman at videolan dot org>
* Felix Khne <fkuehne at videolan dot org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -267,6 +268,18 @@ struct intf_sys_t
IBOutlet id o_dmi_previous;
IBOutlet id o_dmi_mute;
/* vout menu */
IBOutlet id o_vout_menu;
IBOutlet id o_vmi_play;
IBOutlet id o_vmi_stop;
IBOutlet id o_vmi_prev;
IBOutlet id o_vmi_next;
IBOutlet id o_vmi_volup;
IBOutlet id o_vmi_voldown;
IBOutlet id o_vmi_mute;
IBOutlet id o_vmi_fullscreen;
IBOutlet id o_vmi_snapshot;
bool b_small_window;
mtime_t i_end_scroll;
......@@ -290,6 +303,7 @@ struct intf_sys_t
- (id)getBookmarks;
- (id)getEmbeddedList;
- (id)getInteractionList;
- (id)getVoutMenu;
- (void)terminate;
- (NSString *)localizedString:(char *)psz;
- (char *)delocalizeString:(NSString *)psz;
......
......@@ -7,6 +7,7 @@
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Christophe Massiot <massiot@via.ecp.fr>
* Derk-Jan Hartman <hartman at videolan.org>
* Felix Khne <fkuehne at videolan dot org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -613,6 +614,17 @@ static VLCMain *_o_sharedMainInstance = nil;
[o_dmi_next setTitle: _NS("Next")];
[o_dmi_previous setTitle: _NS("Previous")];
[o_dmi_mute setTitle: _NS("Mute")];
/* vout menu */
[o_vmi_play setTitle: _NS("Play")];
[o_vmi_stop setTitle: _NS("Stop")];
[o_vmi_prev setTitle: _NS("Previous")];
[o_vmi_next setTitle: _NS("Next")];
[o_vmi_volup setTitle: _NS("Volume Up")];
[o_vmi_voldown setTitle: _NS("Volume Down")];
[o_vmi_mute setTitle: _NS("Mute")];
[o_vmi_fullscreen setTitle: _NS("Fullscreen")];
[o_vmi_snapshot setTitle: _NS("Snapshot")];
/* error panel */
[o_error setTitle: _NS("Error")];
......@@ -911,6 +923,11 @@ static VLCMain *_o_sharedMainInstance = nil;
return nil;
}
- (id)getVoutMenu
{
return o_vout_menu;
}
- (void)manage
{
playlist_t * p_playlist;
......
......@@ -10,6 +10,7 @@
* Derk-Jan Hartman <hartman at videolan dot org>
* Eric Petit <titer@m0k.org>
* Benjamin Pracht <bigben at videolan dot org>
* Felix Khne <fkuehne at videolan dot org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -41,7 +42,6 @@
#include "intf.h"
#include "vout.h"
/*****************************************************************************
* DeviceCallback: Callback triggered when the video-device variable is changed
*****************************************************************************/
......@@ -456,29 +456,31 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
if( p_vout )
{
switch( [o_event type] )
if( ( [o_event type] == NSLeftMouseDown ) &&
( ! ( [o_event modifierFlags] & NSControlKeyMask ) ) )
{
case NSLeftMouseDown:
if( [o_event clickCount] <= 1 )
{
if( [o_event clickCount] <= 1 )
{
/* single clicking */
var_Get( p_vout, "mouse-button-down", &val );
val.i_int |= 1;
var_Set( p_vout, "mouse-button-down", val );
}
else
{
/* multiple clicking */
[self toggleFullscreen];
}
/* single clicking */
var_Get( p_vout, "mouse-button-down", &val );
val.i_int |= 1;
var_Set( p_vout, "mouse-button-down", val );
}
break;
default:
[super mouseDown: o_event];
break;
else
{
/* multiple clicking */
[self toggleFullscreen];
}
}
else if( ( [o_event type] == NSRightMouseDown ) ||
( ( [o_event type] == NSLeftMouseDown ) &&
( [o_event modifierFlags] & NSControlKeyMask ) ) )
{
msg_Dbg( p_vout, "received NSRightMouseDown (generic method) or Ctrl clic" );
[NSMenu popUpContextMenu: [[VLCMain sharedInstance] getVoutMenu] withEvent: o_event forView: [[[VLCMain sharedInstance] getControls] getVoutView]];
}
else
[super mouseDown: o_event];
}
}
......@@ -507,17 +509,14 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
- (void)rightMouseDown:(NSEvent *)o_event
{
vlc_value_t val;
if( p_vout )
{
switch( [o_event type] )
{
case NSRightMouseDown:
{
var_Get( p_vout, "mouse-button-down", &val );
val.i_int |= 4;
var_Set( p_vout, "mouse-button-down", val );
msg_Dbg( p_vout, "received NSRightMouseDown (specific method)" );
[NSMenu popUpContextMenu: [[VLCMain sharedInstance] getVoutMenu] withEvent: o_event forView: [[[VLCMain sharedInstance] getControls] getVoutView]];
}
break;
......@@ -580,17 +579,16 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
- (void)rightMouseUp:(NSEvent *)o_event
{
vlc_value_t val;
if( p_vout )
{
switch( [o_event type] )
{
case NSRightMouseUp:
{
var_Get( p_vout, "mouse-button-down", &val );
val.i_int &= ~4;
var_Set( p_vout, "mouse-button-down", val );
/* FIXME: this isn't the appropriate place, but we can't receive
* NSRightMouseDown some how */
msg_Dbg( p_vout, "received NSRightMouseUp" );
[NSMenu popUpContextMenu: [[VLCMain sharedInstance] getVoutMenu] withEvent: o_event forView: [[[VLCMain sharedInstance] getControls] getVoutView]];
}
break;
......
......@@ -38,6 +38,7 @@ void CmdChangeSkin::execute()
if( pOldTheme )
{
pOldTheme->getWindowManager().saveVisibility();
pOldTheme->getWindowManager().hideAll();
}
......@@ -57,7 +58,7 @@ void CmdChangeSkin::execute()
msg_Warn( getIntf(), "a problem occurred when loading the new theme,"
" restoring the previous one" );
getIntf()->p_sys->p_theme = pOldTheme;
pOldTheme->getWindowManager().showAll();
pOldTheme->getWindowManager().restoreVisibility();
}
else
{
......
......@@ -66,8 +66,10 @@ class CtrlGeneric: public SkinObject, public Observer<VarBool>
virtual UString getTooltipText() const
{ return UString( getIntf(), "" ); }
/// Overload this method if you want to do something special when
/// the layout is resized
/**
* Overload this method if you want to do something special when
* the layout is resized
*/
virtual void onResize() {}
/// Get the help text
......@@ -87,14 +89,18 @@ class CtrlGeneric: public SkinObject, public Observer<VarBool>
CtrlGeneric( intf_thread_t *pIntf, const UString &rHelp,
VarBool *pVisible = NULL );
/// Tell the layout when the image has changed, with the size of the
/// rectangle to repaint and its offset.
/// Use the default values to repaint the whole window
/**
* Tell the layout when the image has changed, with the size of the
* rectangle to repaint and its offset.
* Use the default values to repaint the whole window
*/
virtual void notifyLayout( int witdh = -1, int height = -1,
int xOffSet = 0, int yOffSet = 0 ) const;
/// Same as notifyLayout(), but takes optional images as parameters.
/// The maximum size(s) of the images will be used for repainting.
/**
* Same as notifyLayout(), but takes optional images as parameters.
* The maximum size(s) of the images will be used for repainting.
*/
void notifyLayoutMaxSize( const Box *pImg1 = NULL,
const Box *pImg2 = NULL );
......@@ -110,8 +116,10 @@ class CtrlGeneric: public SkinObject, public Observer<VarBool>
/// Get the associated window, if any
virtual TopWindow *getWindow() const;
/// Overload this method if you want to do something special when
/// the Position object is set
/**
* Overload this method if you want to do something special when
* the Position object is set
*/
virtual void onPositionChange() {}
/// Overload this method to get notified of bool variable changes
......
......@@ -1061,7 +1061,7 @@ GenericFont *Builder::getFont( const string &fontId )
string Builder::getFilePath( const string &rFileName ) const
{
OSFactory *pFactory = OSFactory::instance( getIntf() );
return m_path + pFactory->getDirSeparator() + rFileName;
return m_path + pFactory->getDirSeparator() + sFromLocale( rFileName );
}
......
......@@ -41,7 +41,7 @@ void Dialogs::showChangeSkinCB( intf_dialog_args_t *pArg )
{
// Create a change skin command
CmdChangeSkin *pCmd =
new CmdChangeSkin( pIntf, pArg->psz_results[0] );
new CmdChangeSkin( pIntf, sFromLocale( pArg->psz_results[0] ) );
// Push the command in the asynchronous command queue
AsyncQueue *pQueue = AsyncQueue::instance( pIntf );
......@@ -65,7 +65,7 @@ void Dialogs::showPlaylistLoadCB( intf_dialog_args_t *pArg )
{
// Create a Playlist Load command
CmdPlaylistLoad *pCmd =
new CmdPlaylistLoad( pIntf, pArg->psz_results[0] );
new CmdPlaylistLoad( pIntf, sFromLocale( pArg->psz_results[0] ) );
// Push the command in the asynchronous command queue
AsyncQueue *pQueue = AsyncQueue::instance( pIntf );
......
......@@ -230,8 +230,8 @@ void GenericLayout::refreshRect( int x, int y, int width, int height )
if( y + height > m_height )
height = m_height - y;
// Refresh the window... but do not paint on a video control!
if( !m_pVideoControl )
// Refresh the window... but do not paint on a visible video control!
if( !m_pVideoControl || !m_pVideoControl->isVisible() )
{
// No video control, we can safely repaint the rectangle
pWindow->refresh( x, y, width, height );
......
......@@ -100,8 +100,10 @@ class GenericLayout: public SkinObject, public Box
/// Resize the layout
virtual void resize( int width, int height );
/// Add a control in the layout at the given position, and
/// the optional given layer
/**
* Add a control in the layout at the given position, and
* the optional given layer
*/
virtual void addControl( CtrlGeneric *pControl,
const Position &rPosition,
int layer );
......@@ -110,9 +112,11 @@ class GenericLayout: public SkinObject, public Box
virtual const list<LayeredControl> &getControlList() const;
/// Called by a control when its image has changed
/// The arguments indicate the size of the rectangle to refresh,
/// and the offset (from the control position) of this rectangle.
/// Use a negative width or height to refresh the layout completely
/**
* The arguments indicate the size of the rectangle to refresh,
* and the offset (from the control position) of this rectangle.
* Use a negative width or height to refresh the layout completely
*/
virtual void onControlUpdate( const CtrlGeneric &rCtrl,
int width, int height,
int xOffSet, int yOffSet );
......
......@@ -27,6 +27,7 @@
#include <vlc/vlc.h>
#include <vlc/intf.h>
#include "charset.h"
#include <string>
using namespace std;
......@@ -66,6 +67,26 @@ class ThemeRepository;
}
/// Wrapper around FromLocale, to avoid the need to call LocaleFree()
static inline string sFromLocale( const string &rLocale )
{
char *s = FromLocale( rLocale.c_str() );
string res = s;
LocaleFree( s );
return res;
}
/// Wrapper around ToLocale, to avoid the need to call LocaleFree()
static inline string sToLocale( const string &rUTF8 )
{
char *s = ToLocale( rUTF8.c_str() );
string res = s;
LocaleFree( s );
return res;
}
//---------------------------------------------------------------------------
// intf_sys_t: description and status of skin interface
//---------------------------------------------------------------------------
......
......@@ -77,7 +77,7 @@ bool ThemeLoader::load( const string &fileName )
// file...
string path = getFilePath( fileName );
#if defined( HAVE_ZLIB_H )
if( ! extract( fileName ) && ! parse( path, fileName ) )
if( ! extract( sToLocale( fileName ) ) && ! parse( path, fileName ) )
return false;
#else
if( ! parse( path, fileName ) )
......@@ -311,7 +311,7 @@ bool ThemeLoader::extract( const string &fileName )
list<string>::const_iterator it;
for( it = resPath.begin(); it != resPath.end(); it++ )
{
if( findFile( *it, WINAMP2_XML_FILE, xmlFile ) )
if( findFile( sToLocale( *it ), WINAMP2_XML_FILE, xmlFile ) )
break;
}
}
......@@ -456,7 +456,7 @@ bool ThemeLoader::findFile( const string &rootDir, const string &rFileName,
// Found the theme file?
if( rFileName == string( pDirContent->d_name ) )
{
themeFilePath = newURI;
themeFilePath = sFromLocale( newURI );
closedir( pCurrDir );
return true;
}
......
......@@ -37,33 +37,59 @@ class ThemeLoader: public SkinObject
ThemeLoader( intf_thread_t *pIntf ): SkinObject( pIntf ) {}
virtual ~ThemeLoader() {}
/**
* The expected fileName must be an UTF-8 string (usually the result of
* a call to FromLocale())
*/
bool load( const string &fileName );
private:
#if defined( HAVE_ZLIB_H )
/// Extract files from an archive (handles tar.gz and zip)
/**
* Expects a string from the current locale.
*/
bool extract( const string &fileName );
/// Extract files from a tar.gz archive
/**
* Expects strings from the current locale.
*/
bool extractTarGz( const string &tarFile, const string &rootDir );
/// Extract files from a .zip archive
/**
* Expects strings from the current locale.
*/
bool extractZip( const string &zipFile, const string &rootDir );
/// Extract the current file from a .zip archive
/**
* Expects a string from the current locale.
*/
bool extractFileInZip( unzFile file, const string &rootDir );
/// Clean up the temporary files created by the extraction
/**
* Expects a string from the current locale.
*/
void deleteTempFiles( const string &path );
#endif
/// Parse the XML file given as a parameter and build the skin
/**
* Expects UTF8 strings
*/
bool parse( const string &path, const string &xmlFile );
/// Recursively look for the XML file from rootDir.
/// The first corresponding file found will be chosen and themeFilePath
/// will be updated accordingly.
/// The method returns true if a theme file was found, false otherwise
/**
* The first corresponding file found will be chosen and themeFilePath
* will be updated accordingly.
* The method returns true if a theme file was found, false otherwise.
* rootDir and rFilename must both be strings in the current locale,
* whereas themeFilePath will be in UTF8.
*/
bool findFile( const string &rootDir, const string &rFileName,
string &themeFilePath );
......
......@@ -331,6 +331,37 @@ void WindowManager::synchVisibility() const
}
void WindowManager::saveVisibility()
{
WinSet_t::const_iterator it;
m_savedWindows.clear();
for( it = m_allWindows.begin(); it != m_allWindows.end(); it++ )
{
// Remember the window if it is visible
if( (*it)->getVisibleVar().get() )
{
m_savedWindows.insert( *it );
}
}
}
void WindowManager::restoreVisibility() const
{
// Warning in case we never called saveVisibility()
if( m_savedWindows.size() == 0 )
{
msg_Warn( getIntf(), "restoring visibility for no window" );
}
WinSet_t::const_iterator it;
for( it = m_savedWindows.begin(); it != m_savedWindows.end(); it++)
{
(*it)->show();
}
}
void WindowManager::raiseAll() const
{
// Raise all the windows
......
......@@ -59,8 +59,10 @@ class WindowManager: public SkinObject
/// Destructor
virtual ~WindowManager();
/// Add a window to the list of known windows. Necessary if you want
/// your window to be movable...
/**
* Add a window to the list of known windows. Necessary if you want
* your window to be movable...
*/
void registerWindow( TopWindow &rWindow );
/// Remove a previously registered window
......@@ -105,6 +107,12 @@ class WindowManager: public SkinObject
/// Synchronize the windows with their visibility variable
void synchVisibility() const;
/// Save the current visibility of the windows
void saveVisibility();
/// Restore the saved visibility of the windows
void restoreVisibility() const;
/// Raise the given window
void raise( TopWindow &rWindow ) const { rWindow.raise(); }
......@@ -164,8 +172,15 @@ class WindowManager: public SkinObject
map<TopWindow*, WinSet_t> m_dependencies;
/// Store all the windows
WinSet_t m_allWindows;
/// Store the moving windows; this set is updated at every start of
/// move.
/**
* Store the windows that were visible when saveVisibility() was
* last called.
*/
WinSet_t m_savedWindows;
/// Store the moving windows
/**
* This set is updated at every start of move.
*/
WinSet_t m_movingWindows;
/**
* Store the moving windows in the context of resizing
......
......@@ -36,7 +36,6 @@
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
#include <sys/stat.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
......@@ -44,6 +43,8 @@
# include <io.h>
#endif
#include <glib.h>
#include <glib/gstdio.h>
#include <glib-object.h> /* g_object_unref( ) */
#include <librsvg-2/librsvg/rsvg.h>
......@@ -146,7 +147,7 @@ static int Create( vlc_object_t *p_this )
p_filter->p_sys = p_sys;
/* MUST call this before any RSVG funcs */
g_type_init ();
rsvg_init( );
return VLC_SUCCESS;
}
......@@ -234,6 +235,7 @@ static void Destroy( vlc_object_t *p_this )
free( p_sys->psz_template );
free( p_sys );
rsvg_term( );
}
/*****************************************************************************
......@@ -261,7 +263,7 @@ static int Render( filter_t *p_filter, subpicture_region_t *p_region,
if( p_svg->p_rendition == NULL ) {
svg_RenderPicture( p_filter, p_svg );
if( ! p_svg )
if( ! p_svg->p_rendition )
{
msg_Err( p_filter, "Cannot render SVG" );
return VLC_EGENERIC;
......@@ -397,22 +399,37 @@ static void svg_RenderPicture( filter_t *p_filter,
RsvgHandle *p_handle;
GError *error = NULL;
p_svg->p_rendition = NULL;
p_handle = rsvg_handle_new();
if( !p_handle )
{
msg_Err( p_filter, "Error creating SVG reader: %s", error->message );
return;
}
rsvg_handle_set_size_callback( p_handle, svg_SizeCallback, p_filter, NULL );
rsvg_handle_write( p_handle,
( guchar* )p_svg->psz_text, strlen( p_svg->psz_text ) + 1,
&error );
if( error != NULL )
if( ! rsvg_handle_write( p_handle,
( guchar* )p_svg->psz_text, strlen( p_svg->psz_text ),
&error ) )
{
msg_Err( p_filter, "error while rendering SVG: %s\n", error->message );
g_object_unref( G_OBJECT( p_handle ) );
return;
}
if( ! rsvg_handle_close( p_handle, &error ) )
{
msg_Err( p_filter, "error while rendering SVG (close): %s\n", error->message );
g_object_unref( G_OBJECT( p_handle ) );
return;
}
rsvg_handle_close( p_handle, &error );
p_svg->p_rendition = rsvg_handle_get_pixbuf( p_handle );
rsvg_handle_free( p_handle );
g_object_unref( G_OBJECT( p_handle ) );
}
......
......@@ -337,7 +337,8 @@ typedef struct ts_stream_t
uint8_t *p_decoder_specific_info;
/* language is iso639-2T */
uint8_t lang[3];
int i_langs;
uint8_t *lang;
sout_buffer_chain_t chain_pes;
mtime_t i_pes_dts;
......@@ -885,6 +886,7 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
{
sout_mux_sys_t *p_sys = p_mux->p_sys;
ts_stream_t *p_stream;
int i;
p_input->p_sys = p_stream = malloc( sizeof( ts_stream_t ) );
......@@ -1013,6 +1015,9 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
return VLC_EGENERIC;
}
p_stream->i_langs = 1+p_input->p_fmt->i_extra_languages;
p_stream->lang = malloc(p_stream->i_langs*3);
i = 1;
p_stream->lang[0] =
p_stream->lang[1] =
p_stream->lang[2] = '\0';
......@@ -1040,9 +1045,41 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
p_stream->lang[2] = pl->psz_iso639_2T[2];
msg_Dbg( p_mux, " - lang=%c%c%c",
p_stream->lang[0], p_stream->lang[1], p_stream->lang[2] );
p_stream->lang[0], p_stream->lang[1],
p_stream->lang[2] );
}
}
while( i < p_stream->i_langs ) {
if( p_input->p_fmt->p_extra_languages[i-1].psz_language )
{
char *psz = p_input->p_fmt->p_extra_languages[i-1].psz_language;
const iso639_lang_t *pl = NULL;
if( strlen( psz ) == 2 )
{
pl = GetLang_1( psz );
}
else if( strlen( psz ) == 3 )
{
pl = GetLang_2B( psz );
if( !strcmp( pl->psz_iso639_1, "??" ) )
{
pl = GetLang_2T( psz );
}
}
if( pl && strcmp( pl->psz_iso639_1, "??" ) )
{
p_stream->lang[i*3+0] = pl->psz_iso639_2T[0];
p_stream->lang[i*3+1] = pl->psz_iso639_2T[1];
p_stream->lang[i*3+2] = pl->psz_iso639_2T[2];
msg_Dbg( p_mux, " - lang=%c%c%c",
p_stream->lang[i*3+0], p_stream->lang[i*3+1],
p_stream->lang[i*3+2] );
}
}
i++;
}
/* Copy extra data (VOL for MPEG-4 and extra BitMapInfoHeader for VFW */
p_stream->i_decoder_specific_info = p_input->p_fmt->i_extra;
......@@ -1183,6 +1220,10 @@ static int DelStream( sout_mux_t *p_mux, sout_input_t *p_input )
/* Empty all data in chain_pes */
BufferChainClean( p_mux->p_sout, &p_stream->chain_pes );
if( p_stream->lang )
{
free(p_stream->lang);
}
if( p_stream->p_decoder_specific_info )
{
free( p_stream->p_decoder_specific_info );
......@@ -2485,16 +2526,18 @@ static void GetPMT( sout_mux_t *p_mux, sout_buffer_chain_t *c )
if( p_stream->lang[0] != 0 )
{
uint8_t data[4];
uint8_t data[4*p_stream->i_langs];
/* I construct the content myself, way faster than looking at
* over complicated/mind broken libdvbpsi way */
data[0] = p_stream->lang[0];
data[1] = p_stream->lang[1];
data[2] = p_stream->lang[2];
data[3] = 0x00; /* audio type: 0x00 undefined */
dvbpsi_PMTESAddDescriptor( p_es, 0x0a, 4, data );
for(i = 0; i < p_stream->i_langs; i++ )
{
data[i*4+0] = p_stream->lang[i*3+0];
data[i*4+1] = p_stream->lang[i*3+1];
data[i*4+2] = p_stream->lang[i*3+2];
data[i*4+3] = 0x00; /* audio type: 0x00 undefined */
}
dvbpsi_PMTESAddDescriptor( p_es, 0x0a, 4*p_stream->i_langs, data );
}
}
......
......@@ -382,6 +382,10 @@ static void I420_UYVY( vout_thread_t *p_vout, picture_t *p_source,
MMX_CALL( MMX_YUV420_UYVY );
#endif
}
for( i_x = ( p_vout->render.i_width % 8 ) / 2; i_x--; )
{
C_YUV420_UYVY( );
}
p_y1 += i_source_margin;
p_y2 += i_source_margin;
......
......@@ -119,12 +119,6 @@ movq %%mm1, (%1) # Store YUYV \n\
*(p_line1)++ = *(p_y1)++; *(p_line2)++ = *(p_y2)++; \
*(p_line1)++ = *(p_line2)++ = *(p_u)++; \
#define C_YUV420_UYVY( ) \
*(p_line1)++ = *(p_line2)++ = *(p_u)++; \
*(p_line1)++ = *(p_y1)++; *(p_line2)++ = *(p_y2)++; \
*(p_line1)++ = *(p_line2)++ = *(p_v)++; \
*(p_line1)++ = *(p_y1)++; *(p_line2)++ = *(p_y2)++; \
#define C_YUV420_Y211( ) \
*(p_line1)++ = *(p_y1); p_y1 += 2; \
*(p_line2)++ = *(p_y2); p_y2 += 2; \
......@@ -142,3 +136,9 @@ movq %%mm1, (%1) # Store YUYV \n\
*(p_line1)++ = *(p_y1)++; *(p_line2)++ = *(p_y2)++; \
*(p_line1)++ = *(p_line2)++ = *(p_v)++; \
#define C_YUV420_UYVY( ) \
*(p_line1)++ = *(p_line2)++ = *(p_u)++; \
*(p_line1)++ = *(p_y1)++; *(p_line2)++ = *(p_y2)++; \
*(p_line1)++ = *(p_line2)++ = *(p_v)++; \
*(p_line1)++ = *(p_y1)++; *(p_line2)++ = *(p_y2)++; \
......@@ -208,12 +208,21 @@ static void Thread( vlc_object_t *p_this )
}
vlc_object_attach( p_thread->p_opengl, p_this );
/* Initialize vout parameters */
vout_InitFormat( &p_thread->p_opengl->fmt_in,
VLC_FOURCC('R','V','3','2'),
p_thread->i_width, p_thread->i_height, 1 );
p_thread->p_opengl->i_window_width = p_thread->i_width;
p_thread->p_opengl->i_window_height = p_thread->i_height;
p_thread->p_opengl->render.i_width = p_thread->i_width;
p_thread->p_opengl->render.i_height = p_thread->i_width;
p_thread->p_opengl->render.i_aspect = VOUT_ASPECT_FACTOR;
p_thread->p_opengl->b_scale = VLC_TRUE;
p_thread->p_opengl->b_fullscreen = VLC_FALSE;
p_thread->p_opengl->i_alignment = 0;
p_thread->p_opengl->fmt_in.i_sar_num = 1;
p_thread->p_opengl->fmt_in.i_sar_den = 1;
p_thread->p_opengl->fmt_render = p_thread->p_opengl->fmt_in;
p_thread->p_module =
module_Need( p_thread->p_opengl, "opengl provider", NULL, 0 );
......
......@@ -342,16 +342,10 @@ SOURCES_libvlc = \
$(OPT_SOURCES_libvlc_getopt) \
$(NULL)
if !USE_LIBTOOL
if !BUILD_SHARED
SOURCES_libvlc += misc/version.c
CLEANFILES += misc/version.c
misc/version.c: FORCE
$(TOOLBOX) --update-version
FORCE:
endif
# Install shared libvlc
......@@ -363,6 +357,9 @@ uninstall-local:
test -z "$(DATA_noinst_libvlc)" || rm -f "$(DESTDIR)$(libdir)/$(DATA_noinst_libvlc)"
endif
misc/version.c: FORCE
$(TOOLBOX) --update-version
###############################################################################
# Stamp rules
###############################################################################
......@@ -389,3 +386,4 @@ test_url_LDADD = libvlc.la
test_url_CFLAGS = $(CFLAGS_tests)
endif
FORCE:
......@@ -287,3 +287,93 @@ vlc_bool_t mediacontrol_set_visual( mediacontrol_Instance *self,
return (ret == VLC_SUCCESS);
}
int
mediacontrol_get_rate( mediacontrol_Instance *self,
mediacontrol_Exception *exception )
{
int retval;
input_thread_t *p_input = NULL;
p_input = self->p_playlist->p_input;
if( ! p_input )
{
RAISE( mediacontrol_InternalException, "No input" );
return 0;
}
retval = var_GetInteger(p_input, "rate") / 10;
return retval;
}
void
mediacontrol_set_rate( mediacontrol_Instance *self,
const int rate,
mediacontrol_Exception *exception )
{
input_thread_t *p_input = NULL;
p_input = self->p_playlist->p_input;
if( ! p_input )
{
RAISE( mediacontrol_InternalException, "No input" );
return;
}
var_SetInteger(p_input, "rate", rate * 10);
return;
}
int
mediacontrol_get_fullscreen( mediacontrol_Instance *self,
mediacontrol_Exception *exception )
{
vout_thread_t *p_vout = NULL;
vlc_value_t val;
int i_ret;
p_vout = vlc_object_find( self->p_playlist, VLC_OBJECT_VOUT, FIND_CHILD );
if( ! p_vout )
{
RAISE( mediacontrol_InternalException, "no video output" );
return 0;
}
i_ret = var_Get( p_vout, "fullscreen", &val );
vlc_object_release( p_vout );
if( i_ret )
{
RAISE( mediacontrol_InternalException, "Unexpected error while looking up fullscreen value" );
return 0;
}
return val.b_bool == VLC_TRUE ? 1 : 0;
}
void
mediacontrol_set_fullscreen( mediacontrol_Instance *self,
const int b_fullscreen,
mediacontrol_Exception *exception )
{
vout_thread_t *p_vout = NULL;
vlc_value_t val;
int i_ret;
p_vout = vlc_object_find( self->p_playlist, VLC_OBJECT_VOUT, FIND_CHILD );
if( ! p_vout )
{
RAISE( mediacontrol_InternalException, "no video output" );
return;
}
if( b_fullscreen ) val.b_bool = VLC_TRUE;
else val.b_bool = VLC_FALSE;
i_ret = var_Set( p_vout, "fullscreen", val );
vlc_object_release( p_vout );
if( i_ret )
{
RAISE( mediacontrol_InternalException, "Unexpected error while setting fullscreen value" );
return;
}
return;
}
......@@ -236,3 +236,60 @@ void libvlc_vlm_change_media( libvlc_instance_t *p_instance, char *psz_name,
vlc_mutex_unlock( &p_instance->p_vlm->lock );
#endif
}
void libvlc_vlm_play_media( libvlc_instance_t *p_instance, char *psz_name,
libvlc_exception_t *p_exception )
{
char *psz_message;
vlm_message_t *answer;
CHECK_VLM;
#ifdef ENABLE_VLM
asprintf( &psz_message, "control %s play", psz_name );
vlm_ExecuteCommand( p_instance->p_vlm, psz_message, &answer );
if( answer->psz_value )
{
libvlc_exception_raise( p_exception, "Unable to play %s",
psz_name );
}
free( psz_message);
#endif
}
void libvlc_vlm_stop_media( libvlc_instance_t *p_instance, char *psz_name,
libvlc_exception_t *p_exception )
{
char *psz_message;
vlm_message_t *answer;
CHECK_VLM;
#ifdef ENABLE_VLM
asprintf( &psz_message, "control %s stop", psz_name );
vlm_ExecuteCommand( p_instance->p_vlm, psz_message, &answer );
if( answer->psz_value )
{
libvlc_exception_raise( p_exception, "Unable to stop %s",
psz_name );
}
free( psz_message);
#endif
}
void libvlc_vlm_pause_media( libvlc_instance_t *p_instance, char *psz_name,
libvlc_exception_t *p_exception )
{
char *psz_message;
vlm_message_t *answer;
CHECK_VLM;
#ifdef ENABLE_VLM
asprintf( &psz_message, "control %s pause", psz_name );
vlm_ExecuteCommand( p_instance->p_vlm, psz_message, &answer );
if( answer->psz_value )
{
libvlc_exception_raise( p_exception, "Unable to pause %s",
psz_name );
}
free( psz_message);
#endif
}
......@@ -1279,7 +1279,7 @@ int VLC_Pause( int i_object )
}
/*****************************************************************************
* VLC_Pause: toggle pause
* VLC_Stop: stop playback
*****************************************************************************/
int VLC_Stop( int i_object )
{
......
......@@ -302,10 +302,14 @@ static char *ppsz_align_descriptions[] =
"picture quality, for instance deinterlacing, or to clone or distort " \
"the video window.")
#define SNAP_PATH_TEXT N_("Video snapshot directory")
#define SNAP_PATH_TEXT N_("Video snapshot directory (or filename)")
#define SNAP_PATH_LONGTEXT N_( \
"Directory where the video snapshots will be stored.")
#define SNAP_PREFIX_TEXT N_("Video snapshot file prefix")
#define SNAP_PREFIX_LONGTEXT N_( \
"Video snapshot file prefix" )
#define SNAP_FORMAT_TEXT N_("Video snapshot format")
#define SNAP_FORMAT_LONGTEXT N_( \
"Image format which will be used to store the video snapshots" )
......@@ -314,6 +318,10 @@ static char *ppsz_align_descriptions[] =
#define SNAP_PREVIEW_LONGTEXT N_( \
"Display the snapshot preview in the screen's top-left corner.")
#define SNAP_SEQUENTIAL_TEXT N_("Use sequential numbers instead of timestamps")
#define SNAP_SEQUENTIAL_LONGTEXT N_( \
"Use sequential numbers instead of timestamps for snapshot numbering")
#define CROP_TEXT N_("Video cropping")
#define CROP_LONGTEXT N_( \
"This forces the cropping of the source video. " \
......@@ -1227,11 +1235,15 @@ vlc_module_begin();
set_section( N_("Snapshot") , NULL );
add_directory( "snapshot-path", NULL, NULL, SNAP_PATH_TEXT,
SNAP_PATH_LONGTEXT, VLC_FALSE );
add_string( "snapshot-prefix", "vlcsnap-", NULL, SNAP_PREFIX_TEXT,
SNAP_PREFIX_LONGTEXT, VLC_FALSE );
add_string( "snapshot-format", "png", NULL, SNAP_FORMAT_TEXT,
SNAP_FORMAT_LONGTEXT, VLC_FALSE );
change_string_list( ppsz_snap_formats, NULL, 0 );
add_bool( "snapshot-preview", VLC_TRUE, NULL, SNAP_PREVIEW_TEXT,
SNAP_PREVIEW_LONGTEXT, VLC_FALSE );
add_bool( "snapshot-sequential", VLC_FALSE, NULL, SNAP_SEQUENTIAL_TEXT,
SNAP_SEQUENTIAL_LONGTEXT, VLC_FALSE );
set_section( N_("Window properties" ), NULL );
add_integer( "width", -1, NULL, WIDTH_TEXT, WIDTH_LONGTEXT, VLC_TRUE );
......
......@@ -187,8 +187,14 @@ void vout_IntfInit( vout_thread_t *p_vout )
/* Create a few object variables we'll need later on */
var_Create( p_vout, "snapshot-path", VLC_VAR_STRING | VLC_VAR_DOINHERIT );
var_Create( p_vout, "snapshot-prefix", VLC_VAR_STRING | VLC_VAR_DOINHERIT );
var_Create( p_vout, "snapshot-format", VLC_VAR_STRING | VLC_VAR_DOINHERIT );
var_Create( p_vout, "snapshot-preview", VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
var_Create( p_vout, "snapshot-sequential",
VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
var_Create( p_vout, "snapshot-num", VLC_VAR_INTEGER );
var_SetInteger( p_vout, "snapshot-num", 1 );
var_Create( p_vout, "width", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
var_Create( p_vout, "height", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
var_Create( p_vout, "align", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
......@@ -434,7 +440,7 @@ int vout_Snapshot( vout_thread_t *p_vout, picture_t *p_pic )
{
image_handler_t *p_image = image_HandlerCreate( p_vout );
video_format_t fmt_in = {0}, fmt_out = {0};
char *psz_filename;
char *psz_filename = NULL;
subpicture_t *p_subpic;
picture_t *p_pif;
vlc_value_t val, format;
......@@ -628,20 +634,40 @@ int vout_Snapshot( vout_thread_t *p_vout, picture_t *p_pic )
* Did the user specify a directory? If not, path = NULL.
*/
path = opendir ( (const char *)val.psz_string );
if ( path != NULL )
{
asprintf( &psz_filename, "%s/vlcsnap-%u.%s", val.psz_string,
(unsigned int)(p_pic->date / 100000) & 0xFFFFFF,
format.psz_string );
char *psz_prefix = var_GetString( p_vout, "snapshot-prefix" );
if( !psz_prefix ) psz_prefix = strdup( "vlcsnap-" );
closedir( path );
if( var_GetBool( p_vout, "snapshot-sequential" ) == VLC_TRUE )
{
int i_num = var_GetInteger( p_vout, "snapshot-num" );
FILE *p_file;
do
{
asprintf( &psz_filename, "%s/%s%05d.%s", val.psz_string,
psz_prefix, i_num++, format.psz_string );
}
while( ( p_file = fopen( psz_filename, "r" ) ) && !fclose( p_file ) );
var_SetInteger( p_vout, "snapshot-num", i_num );
}
else
{
asprintf( &psz_filename, "%s/%s%u.%s", val.psz_string,
psz_prefix,
(unsigned int)(p_pic->date / 100000) & 0xFFFFFF,
format.psz_string );
}
free( psz_prefix );
}
else // The user specified a full path name (including file name)
{
asprintf ( &psz_filename, "%s", val.psz_string );
}
free( val.psz_string );
free( format.psz_string );
......
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