Commit e4b790fd authored by Jean-Paul Saman's avatar Jean-Paul Saman

Revert the ABI breakage introduced in rev [19469] [19471]

parent 8d14e71f
......@@ -199,16 +199,6 @@ library AXVLC
[helpstring("Mute/unmute audio playback.")]
HRESULT toggleMute();
[propget, helpstring("Returns/sets audio track used/to use.")]
HRESULT track([out, retval] long* track);
[propput, helpstring("Returns/sets audio track used/to use.")]
HRESULT track([in] long track);
[propget, helpstring("Returns audio channel [1-5] indicating; stereo, reverse stereo, left, right, dolby.")]
HRESULT channel([out, retval] long* channel);
[propput, helpstring("Sets audio channel to [1-5] indicating; stereo, reverse stereo, left, right, dolby.")]
HRESULT channel([in] long channel);
};
[
......@@ -422,11 +412,6 @@ library AXVLC
[propput, helpstring("Sets video aspect ratio.")]
HRESULT aspectRatio([in] BSTR aspect);
[propget, helpstring("Returns video subtitle used.")]
HRESULT subtitle([out, retval] long* spu);
[propput, helpstring("Sets video subtitle to use.")]
HRESULT subtitle([in] long spu);
[helpstring("toggle fullscreen/windowed state.")]
HRESULT toggleFullscreen();
};
......
......@@ -200,104 +200,6 @@ STDMETHODIMP VLCAudio::put_volume(long volume)
return hr;
};
STDMETHODIMP VLCAudio::get_track(long* track)
{
if( NULL == track )
return E_POINTER;
libvlc_instance_t* p_libvlc;
HRESULT hr = _p_instance->getVLC(&p_libvlc);
if( SUCCEEDED(hr) )
{
libvlc_exception_t ex;
libvlc_exception_init(&ex);
libvlc_input_t *p_input = libvlc_playlist_get_input(p_libvlc, &ex);
*track = libvlc_audio_get_track(p_input, &ex);
libvlc_input_free(p_input);
if( libvlc_exception_raised(&ex) )
{
_p_instance->setErrorInfo(IID_IVLCAudio,
libvlc_exception_get_message(&ex));
libvlc_exception_clear(&ex);
return E_FAIL;
}
return NOERROR;
}
return hr;
};
STDMETHODIMP VLCAudio::put_track(long track)
{
libvlc_instance_t* p_libvlc;
HRESULT hr = _p_instance->getVLC(&p_libvlc);
if( SUCCEEDED(hr) )
{
libvlc_exception_t ex;
libvlc_exception_init(&ex);
libvlc_input_t *p_input = libvlc_playlist_get_input(p_libvlc, &ex);
libvlc_audio_set_track(p_input, track, &ex);
libvlc_input_free(p_input);
if( libvlc_exception_raised(&ex) )
{
_p_instance->setErrorInfo(IID_IVLCAudio,
libvlc_exception_get_message(&ex));
libvlc_exception_clear(&ex);
return E_FAIL;
}
return NOERROR;
}
return hr;
};
STDMETHODIMP VLCAudio::get_channel(long *channel)
{
if( NULL == channel )
return E_POINTER;
libvlc_instance_t* p_libvlc;
HRESULT hr = _p_instance->getVLC(&p_libvlc);
if( SUCCEEDED(hr) )
{
libvlc_exception_t ex;
libvlc_exception_init(&ex);
*channel = libvlc_audio_get_channel(p_libvlc, &ex);
if( libvlc_exception_raised(&ex) )
{
_p_instance->setErrorInfo(IID_IVLCAudio,
libvlc_exception_get_message(&ex));
libvlc_exception_clear(&ex);
return E_FAIL;
}
return NOERROR;
}
return hr;
};
STDMETHODIMP VLCAudio::put_channel(long channel)
{
libvlc_instance_t* p_libvlc;
HRESULT hr = _p_instance->getVLC(&p_libvlc);
if( SUCCEEDED(hr) )
{
libvlc_exception_t ex;
libvlc_exception_init(&ex);
libvlc_audio_set_channel(p_libvlc, channel, &ex);
if( libvlc_exception_raised(&ex) )
{
_p_instance->setErrorInfo(IID_IVLCAudio,
libvlc_exception_get_message(&ex));
libvlc_exception_clear(&ex);
return E_FAIL;
}
return NOERROR;
}
return hr;
};
STDMETHODIMP VLCAudio::toggleMute()
{
libvlc_instance_t* p_libvlc;
......@@ -2222,58 +2124,6 @@ STDMETHODIMP VLCVideo::put_aspectRatio(BSTR aspect)
return hr;
};
STDMETHODIMP VLCVideo::get_subtitle(long* spu)
{
if( NULL == spu )
return E_POINTER;
libvlc_instance_t* p_libvlc;
HRESULT hr = _p_instance->getVLC(&p_libvlc);
if( SUCCEEDED(hr) )
{
libvlc_exception_t ex;
libvlc_exception_init(&ex);
libvlc_input_t *p_input = libvlc_playlist_get_input(p_libvlc, &ex);
if( ! libvlc_exception_raised(&ex) )
{
*spu = libvlc_video_get_spu(p_input, &ex);
libvlc_input_free(p_input);
if( ! libvlc_exception_raised(&ex) )
{
return NOERROR;
}
}
_p_instance->setErrorInfo(IID_IVLCVideo, libvlc_exception_get_message(&ex));
libvlc_exception_clear(&ex);
return E_FAIL;
}
return hr;
};
STDMETHODIMP VLCVideo::put_subtitle(long spu)
{
libvlc_instance_t* p_libvlc;
HRESULT hr = _p_instance->getVLC(&p_libvlc);
if( SUCCEEDED(hr) )
{
libvlc_exception_t ex;
libvlc_exception_init(&ex);
libvlc_input_t *p_input = libvlc_playlist_get_input(p_libvlc, &ex);
libvlc_video_set_spu(p_input, spu, &ex);
libvlc_input_free(p_input);
if( libvlc_exception_raised(&ex) )
{
_p_instance->setErrorInfo(IID_IVLCVideo, libvlc_exception_get_message(&ex));
libvlc_exception_clear(&ex);
return E_FAIL;
}
return NOERROR;
}
return hr;
};
STDMETHODIMP VLCVideo::toggleFullscreen()
{
libvlc_instance_t* p_libvlc;
......
......@@ -66,10 +66,6 @@ public:
STDMETHODIMP put_mute(VARIANT_BOOL);
STDMETHODIMP get_volume(long*);
STDMETHODIMP put_volume(long);
STDMETHODIMP get_track(long*);
STDMETHODIMP put_track(long);
STDMETHODIMP get_channel(long*);
STDMETHODIMP put_channel(long);
STDMETHODIMP toggleMute();
protected:
......@@ -248,7 +244,7 @@ public:
// IVLCMessageIterator methods
STDMETHODIMP get_hasNext(VARIANT_BOOL*);
STDMETHODIMP next(IVLCMessage**);
protected:
HRESULT loadTypeInfo();
......@@ -522,8 +518,6 @@ public:
STDMETHODIMP get_height(long*);
STDMETHODIMP get_aspectRatio(BSTR*);
STDMETHODIMP put_aspectRatio(BSTR);
STDMETHODIMP get_subtitle(long*);
STDMETHODIMP put_subtitle(long);
STDMETHODIMP toggleFullscreen();
protected:
......
......@@ -5,7 +5,6 @@
* $Id: vlc.h 13701 2005-12-12 17:58:56Z zorglub $
*
* Authors: Clément Stenac <zorglub@videolan.org>
* Jean-Paul Saman <jpsaman _at_ m2x _dot_ nl>
*
* 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
......@@ -346,22 +345,6 @@ char *libvlc_video_get_aspect_ratio( libvlc_input_t *, libvlc_exception_t * );
*/
void libvlc_video_set_aspect_ratio( libvlc_input_t *, char *, libvlc_exception_t * );
/**
* Get current video subtitle
* \param p_input the input
* \param p_exception an initialized exception
* \return the video subtitle selected
*/
int libvlc_video_get_spu( libvlc_input_t *, libvlc_exception_t * );
/**
* Set new video subtitle
* \param p_input the input
* \param i_spu new video subtitle to select
* \param p_exception an initialized exception
*/
void libvlc_video_set_spu( libvlc_input_t *, int , libvlc_exception_t * );
/**
* Take a snapshot of the current video window
* \param p_input the input
......@@ -491,41 +474,7 @@ int libvlc_audio_get_volume( libvlc_instance_t *, libvlc_exception_t * );
* \param p_exception an initialized exception
* \return void
*/
void libvlc_audio_set_volume( libvlc_instance_t *, int, libvlc_exception_t *);
/**
* Get current audio track
* \param p_input input instance
* \param p_exception an initialized exception
* \return the audio track (int)
*/
int libvlc_audio_get_track( libvlc_input_t *, libvlc_exception_t * );
/**
* Set current audio track
* \param p_input input instance
* \param i_track the track (int)
* \param p_exception an initialized exception
* \return void
*/
void libvlc_audio_set_track( libvlc_input_t *, int, libvlc_exception_t * );
/**
* Get current audio channel
* \param p_instance input instance
* \param p_exception an initialized exception
* \return the audio channel (int)
*/
int libvlc_audio_get_channel( libvlc_instance_t *, libvlc_exception_t * );
/**
* Set current audio channel
* \param p_instance input instance
* \param psz_channel the audio channel (int)
* \param p_exception an initialized exception
* \return void
*/
void libvlc_audio_set_channel( libvlc_instance_t *, int, libvlc_exception_t * );
void libvlc_audio_set_volume( libvlc_instance_t *, int , libvlc_exception_t *);
/** @} */
......
......@@ -191,8 +191,6 @@ const NPUTF8 * const LibvlcAudioNPObject::propertyNames[] =
{
"mute",
"volume",
"track",
"channel",
};
const int LibvlcAudioNPObject::propertyCount = sizeof(LibvlcAudioNPObject::propertyNames)/sizeof(NPUTF8 *);
......@@ -200,9 +198,7 @@ const int LibvlcAudioNPObject::propertyCount = sizeof(LibvlcAudioNPObject::prope
enum LibvlcAudioNPObjectPropertyIds
{
ID_audio_mute,
ID_audio_volume,
ID_audio_track,
ID_audio_channel,
ID_audio_volume
};
RuntimeNPObject::InvokeResult LibvlcAudioNPObject::getProperty(int index, NPVariant &result)
......@@ -240,38 +236,6 @@ RuntimeNPObject::InvokeResult LibvlcAudioNPObject::getProperty(int index, NPVari
INT32_TO_NPVARIANT(volume, result);
return INVOKERESULT_NO_ERROR;
}
case ID_audio_track:
{
libvlc_input_t *p_input = libvlc_playlist_get_input(p_plugin->getVLC(), &ex);
if( libvlc_exception_raised(&ex) )
{
NPN_SetException(this, libvlc_exception_get_message(&ex));
libvlc_exception_clear(&ex);
return INVOKERESULT_GENERIC_ERROR;
}
int track = libvlc_audio_get_track(p_input, &ex);
libvlc_input_free(p_input);
if( libvlc_exception_raised(&ex) )
{
NPN_SetException(this, libvlc_exception_get_message(&ex));
libvlc_exception_clear(&ex);
return INVOKERESULT_GENERIC_ERROR;
}
INT32_TO_NPVARIANT(track, result);
return INVOKERESULT_NO_ERROR;
}
case ID_audio_channel:
{
int channel = libvlc_audio_get_channel(p_plugin->getVLC(), &ex);
if( libvlc_exception_raised(&ex) )
{
NPN_SetException(this, libvlc_exception_get_message(&ex));
libvlc_exception_clear(&ex);
return INVOKERESULT_GENERIC_ERROR;
}
INT32_TO_NPVARIANT(channel, result);
return INVOKERESULT_NO_ERROR;
}
default:
;
}
......@@ -318,42 +282,6 @@ RuntimeNPObject::InvokeResult LibvlcAudioNPObject::setProperty(int index, const
return INVOKERESULT_NO_ERROR;
}
return INVOKERESULT_INVALID_VALUE;
case ID_audio_track:
if( isNumberValue(value) )
{
libvlc_input_t *p_input = libvlc_playlist_get_input(p_plugin->getVLC(), &ex);
if( libvlc_exception_raised(&ex) )
{
NPN_SetException(this, libvlc_exception_get_message(&ex));
libvlc_exception_clear(&ex);
return INVOKERESULT_GENERIC_ERROR;
}
libvlc_audio_set_track(p_input,
numberValue(value), &ex);
libvlc_input_free(p_input);
if( libvlc_exception_raised(&ex) )
{
NPN_SetException(this, libvlc_exception_get_message(&ex));
libvlc_exception_clear(&ex);
return INVOKERESULT_GENERIC_ERROR;
}
return INVOKERESULT_NO_ERROR;
}
return INVOKERESULT_INVALID_VALUE;
case ID_audio_channel:
if( isNumberValue(value) )
{
libvlc_audio_set_channel(p_plugin->getVLC(),
numberValue(value), &ex);
if( libvlc_exception_raised(&ex) )
{
NPN_SetException(this, libvlc_exception_get_message(&ex));
libvlc_exception_clear(&ex);
return INVOKERESULT_GENERIC_ERROR;
}
return INVOKERESULT_NO_ERROR;
}
return INVOKERESULT_INVALID_VALUE;
default:
;
}
......@@ -1787,8 +1715,7 @@ const NPUTF8 * const LibvlcVideoNPObject::propertyNames[] =
"fullscreen",
"height",
"width",
"aspectRatio",
"subtitle"
"aspectRatio"
};
enum LibvlcVideoNPObjectPropertyIds
......@@ -1796,8 +1723,7 @@ enum LibvlcVideoNPObjectPropertyIds
ID_video_fullscreen,
ID_video_height,
ID_video_width,
ID_video_aspectratio,
ID_video_subtitle
ID_video_aspectratio
};
const int LibvlcVideoNPObject::propertyCount = sizeof(LibvlcVideoNPObject::propertyNames)/sizeof(NPUTF8 *);
......@@ -1876,19 +1802,6 @@ RuntimeNPObject::InvokeResult LibvlcVideoNPObject::getProperty(int index, NPVari
STRINGZ_TO_NPVARIANT(psz_aspect, result);
return INVOKERESULT_NO_ERROR;
}
case ID_video_subtitle:
{
int i_spu = libvlc_video_get_spu(p_input, &ex);
libvlc_input_free(p_input);
if( libvlc_exception_raised(&ex) )
{
NPN_SetException(this, libvlc_exception_get_message(&ex));
libvlc_exception_clear(&ex);
return INVOKERESULT_GENERIC_ERROR;
}
INT32_TO_NPVARIANT(i_spu, result);
return INVOKERESULT_NO_ERROR;
}
}
libvlc_input_free(p_input);
}
......@@ -1961,24 +1874,6 @@ RuntimeNPObject::InvokeResult LibvlcVideoNPObject::setProperty(int index, const
}
return INVOKERESULT_NO_ERROR;
}
case ID_video_subtitle:
{
if( isNumberValue(value) )
{
libvlc_video_set_spu(p_input,
numberValue(value), &ex);
libvlc_input_free(p_input);
if( libvlc_exception_raised(&ex) )
{
NPN_SetException(this, libvlc_exception_get_message(&ex));
libvlc_exception_clear(&ex);
return INVOKERESULT_GENERIC_ERROR;
}
return INVOKERESULT_NO_ERROR;
}
libvlc_input_free(p_input);
return INVOKERESULT_INVALID_VALUE;
}
}
libvlc_input_free(p_input);
}
......
......@@ -25,56 +25,7 @@
#include <libvlc_internal.h>
#include <vlc/libvlc.h>
#include <vlc/aout.h>
#include <vlc/intf.h>
#include <audio_output.h> /* for audio_volume_t, AOUT_VOLUME_MAX */
#include <aout_internal.h>
/*
* Remember to release the returned input_thread_t since it is locked at
* the end of this function.
*/
static input_thread_t *GetInput( libvlc_input_t *p_input,
libvlc_exception_t *p_exception )
{
input_thread_t *p_input_thread = NULL;
if( !p_input )
{
libvlc_exception_raise( p_exception, "Input is NULL" );
return NULL;
}
p_input_thread = (input_thread_t*)vlc_object_get(
p_input->p_instance->p_vlc,
p_input->i_input_id );
if( !p_input_thread )
{
libvlc_exception_raise( p_exception, "Input does not exist" );
return NULL;
}
return p_input_thread;
}
/*
* Remember to release the returned aout_instance_t since it is locked at
* the end of this function.
*/
static aout_instance_t *GetAOut( libvlc_instance_t *p_instance,
libvlc_exception_t *p_exception )
{
aout_instance_t * p_aout = NULL;
p_aout = vlc_object_find( p_instance->p_vlc, VLC_OBJECT_AOUT, FIND_CHILD );
if( !p_aout )
{
libvlc_exception_raise( p_exception, "No active audio output" );
return NULL;
}
return p_aout;
}
/*****************************************************************************
* libvlc_audio_get_mute : Get the volume state, true if muted
......@@ -139,130 +90,3 @@ void libvlc_audio_set_volume( libvlc_instance_t *p_instance, int i_volume,
libvlc_exception_raise( p_e, "Volume out of range" );
}
}
/*****************************************************************************
* libvlc_audio_get_track : Get the current audio track
*****************************************************************************/
int libvlc_audio_get_track( libvlc_input_t *p_input,
libvlc_exception_t *p_e )
{
input_thread_t *p_input_thread = GetInput( p_input, p_e );
vlc_value_t val_list;
vlc_value_t val;
int i_track = -1;
int i_ret = -1;
int i;
if( !p_input_thread )
return -1;
i_ret = var_Get( p_input_thread, "audio-es", &val );
if( i_ret < 0 )
{
libvlc_exception_raise( p_e, "Getting Audio track information failed" );
vlc_object_release( p_input_thread );
return i_ret;
}
var_Change( p_input_thread, "audio-es", VLC_VAR_GETCHOICES, &val_list, NULL );
for( i = 0; i < val_list.p_list->i_count; i++ )
{
vlc_value_t track_val = val_list.p_list->p_values[i];
if( track_val.i_int == val.i_int )
{
i_track = i;
break;
}
}
vlc_object_release( p_input_thread );
return i_track;
}
/*****************************************************************************
* libvlc_audio_set_track : Set the current audio track
*****************************************************************************/
void libvlc_audio_set_track( libvlc_input_t *p_input, int i_track,
libvlc_exception_t *p_e )
{
input_thread_t *p_input_thread = GetInput( p_input, p_e );
vlc_value_t val_list;
int i_ret = -1;
int i;
if( !p_input_thread )
return;
var_Change( p_input_thread, "audio-es", VLC_VAR_GETCHOICES, &val_list, NULL );
for( i = 0; i < val_list.p_list->i_count; i++ )
{
vlc_value_t val = val_list.p_list->p_values[i];
if( i_track == i )
{
i_ret = var_Set( p_input_thread, "audio-es", val );
if( i_ret < 0 )
{
libvlc_exception_raise( p_e, "Setting audio track failed" );
}
vlc_object_release( p_input_thread );
return;
}
}
libvlc_exception_raise( p_e, "Audio track out of range" );
vlc_object_release( p_input_thread );
}
/*****************************************************************************
* libvlc_audio_get_channel : Get the current audio channel
*****************************************************************************/
int libvlc_audio_get_channel( libvlc_instance_t *p_instance,
libvlc_exception_t *p_e )
{
aout_instance_t *p_aout = GetAOut( p_instance, p_e );
if( p_aout )
{
vlc_value_t val;
var_Get( p_aout, "audio-channels", &val );
vlc_object_release( p_aout );
return val.i_int;
}
return -1;
}
/*****************************************************************************
* libvlc_audio_set_channel : Set the current audio channel
*****************************************************************************/
void libvlc_audio_set_channel( libvlc_instance_t *p_instance, int i_channel,
libvlc_exception_t *p_e )
{
aout_instance_t *p_aout = GetAOut( p_instance, p_e );
vlc_value_t val;
int i_ret = -1;
if( !p_aout )
return;
val.i_int = i_channel;
switch( i_channel )
{
case AOUT_VAR_CHAN_RSTEREO:
case AOUT_VAR_CHAN_STEREO:
case AOUT_VAR_CHAN_LEFT:
case AOUT_VAR_CHAN_RIGHT:
case AOUT_VAR_CHAN_DOLBYS:
i_ret = var_Set( p_aout, "audio-channels", val );
if( i_ret < 0 )
{
libvlc_exception_raise( p_e, "Failed setting audio channel" );
vlc_object_release( p_aout );
return;
}
vlc_object_release( p_aout );
return;
default:
libvlc_exception_raise( p_e, "Audio channel out of range" );
break;
}
vlc_object_release( p_aout );
}
......@@ -389,74 +389,6 @@ void libvlc_video_set_aspect_ratio( libvlc_input_t *p_input,
vlc_object_release( p_vout );
}
int libvlc_video_get_spu( libvlc_input_t *p_input,
libvlc_exception_t *p_e )
{
input_thread_t *p_input_thread = GetInput( p_input, p_e );
vlc_value_t val_list;
vlc_value_t val;
int i_spu = -1;
int i_ret = -1;
int i;
if( !p_input_thread )
return -1;
i_ret = var_Get( p_input_thread, "spu-es", &val );
if( i_ret < 0 )
{
libvlc_exception_raise( p_e, "Getting subtitle information failed" );
vlc_object_release( p_input_thread );
return i_ret;
}
var_Change( p_input_thread, "spu-es", VLC_VAR_GETCHOICES, &val_list, NULL );
for( i = 0; i < val_list.p_list->i_count; i++ )
{
vlc_value_t spu_val = val_list.p_list->p_values[i];
if( val.i_int == spu_val.i_int )
{
i_spu = i;
break;
}
}
vlc_object_release( p_input_thread );
return i_spu;
}
void libvlc_video_set_spu( libvlc_input_t *p_input, int i_spu,
libvlc_exception_t *p_e )
{
input_thread_t *p_input_thread = GetInput( p_input, p_e );
vlc_value_t val_list;
int i_ret = -1;
int i;
if( !p_input_thread )
return;
var_Change( p_input_thread, "spu-es", VLC_VAR_GETCHOICES, &val_list, NULL );
for( i = 0; i < val_list.p_list->i_count; i++ )
{
vlc_value_t val = val_list.p_list->p_values[i];
if( i_spu == i )
{
vlc_value_t new_val;
new_val.i_int = val.i_int;
i_ret = var_Set( p_input_thread, "spu-es", new_val );
if( i_ret < 0 )
{
libvlc_exception_raise( p_e, "Setting subtitle value failed" );
}
vlc_object_release( p_input_thread );
return;
}
}
libvlc_exception_raise( p_e, "Subtitle value out of range" );
vlc_object_release( p_input_thread );
}
int libvlc_video_destroy( libvlc_input_t *p_input,
libvlc_exception_t *p_e )
{
......
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