Commit 10ed5bf6 authored by Sergey Radionov's avatar Sergey Radionov Committed by Jean-Baptiste Kempf

ActiveX: switch VLCInput to vlc_player

Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent ed71aaa6
...@@ -253,15 +253,10 @@ STDMETHODIMP VLCInput::get_length(double* length) ...@@ -253,15 +253,10 @@ STDMETHODIMP VLCInput::get_length(double* length)
{ {
if( NULL == length ) if( NULL == length )
return E_POINTER; return E_POINTER;
*length = 0;
libvlc_media_player_t *p_md; *length = static_cast<double>(Instance()->get_player().get_length());
HRESULT hr = getMD(&p_md);
if( SUCCEEDED(hr) ) return S_OK;
{
*length = (double)libvlc_media_player_get_length(p_md);
}
return hr;
}; };
STDMETHODIMP VLCInput::get_position(double* position) STDMETHODIMP VLCInput::get_position(double* position)
...@@ -269,25 +264,16 @@ STDMETHODIMP VLCInput::get_position(double* position) ...@@ -269,25 +264,16 @@ STDMETHODIMP VLCInput::get_position(double* position)
if( NULL == position ) if( NULL == position )
return E_POINTER; return E_POINTER;
*position = 0.0f; *position = Instance()->get_player().get_position();
libvlc_media_player_t *p_md;
HRESULT hr = getMD(&p_md); return S_OK;
if( SUCCEEDED(hr) )
{
*position = libvlc_media_player_get_position(p_md);
}
return hr;
}; };
STDMETHODIMP VLCInput::put_position(double position) STDMETHODIMP VLCInput::put_position(double position)
{ {
libvlc_media_player_t *p_md; Instance()->get_player().set_position( static_cast<float>(position) );
HRESULT hr = getMD(&p_md);
if( SUCCEEDED(hr) ) return S_OK;
{
libvlc_media_player_set_position(p_md, position);
}
return hr;
}; };
STDMETHODIMP VLCInput::get_time(double* time) STDMETHODIMP VLCInput::get_time(double* time)
...@@ -295,24 +281,16 @@ STDMETHODIMP VLCInput::get_time(double* time) ...@@ -295,24 +281,16 @@ STDMETHODIMP VLCInput::get_time(double* time)
if( NULL == time ) if( NULL == time )
return E_POINTER; return E_POINTER;
libvlc_media_player_t *p_md; *time = static_cast<double>(Instance()->get_player().get_time());
HRESULT hr = getMD(&p_md);
if( SUCCEEDED(hr) ) return S_OK;
{
*time = (double)libvlc_media_player_get_time(p_md);
}
return hr;
}; };
STDMETHODIMP VLCInput::put_time(double time) STDMETHODIMP VLCInput::put_time(double time)
{ {
libvlc_media_player_t *p_md; Instance()->get_player().set_time(static_cast<libvlc_time_t>(time));
HRESULT hr = getMD(&p_md);
if( SUCCEEDED(hr) ) return S_OK;
{
libvlc_media_player_set_time(p_md, (int64_t)time);
}
return hr;
}; };
STDMETHODIMP VLCInput::get_state(long* state) STDMETHODIMP VLCInput::get_state(long* state)
...@@ -320,13 +298,9 @@ STDMETHODIMP VLCInput::get_state(long* state) ...@@ -320,13 +298,9 @@ STDMETHODIMP VLCInput::get_state(long* state)
if( NULL == state ) if( NULL == state )
return E_POINTER; return E_POINTER;
libvlc_media_player_t *p_md; *state = Instance()->get_player().get_state();
HRESULT hr = getMD(&p_md);
if( SUCCEEDED(hr) ) return S_OK;
{
*state = libvlc_media_player_get_state(p_md);
}
return hr;
}; };
STDMETHODIMP VLCInput::get_rate(double* rate) STDMETHODIMP VLCInput::get_rate(double* rate)
...@@ -334,24 +308,16 @@ STDMETHODIMP VLCInput::get_rate(double* rate) ...@@ -334,24 +308,16 @@ STDMETHODIMP VLCInput::get_rate(double* rate)
if( NULL == rate ) if( NULL == rate )
return E_POINTER; return E_POINTER;
libvlc_media_player_t *p_md; *rate = Instance()->get_player().get_rate();
HRESULT hr = getMD(&p_md);
if( SUCCEEDED(hr) ) return S_OK;
{
*rate = libvlc_media_player_get_rate(p_md);
}
return hr;
}; };
STDMETHODIMP VLCInput::put_rate(double rate) STDMETHODIMP VLCInput::put_rate(double rate)
{ {
libvlc_media_player_t *p_md; Instance()->get_player().set_rate(static_cast<float>(rate));
HRESULT hr = getMD(&p_md);
if( SUCCEEDED(hr) ) return S_OK;
{
libvlc_media_player_set_rate(p_md, rate);
}
return hr;
}; };
STDMETHODIMP VLCInput::get_fps(double* fps) STDMETHODIMP VLCInput::get_fps(double* fps)
...@@ -359,14 +325,9 @@ STDMETHODIMP VLCInput::get_fps(double* fps) ...@@ -359,14 +325,9 @@ STDMETHODIMP VLCInput::get_fps(double* fps)
if( NULL == fps ) if( NULL == fps )
return E_POINTER; return E_POINTER;
*fps = 0.0; *fps = static_cast<double>(Instance()->get_player().get_fps());
libvlc_media_player_t *p_md;
HRESULT hr = getMD(&p_md); return S_OK;
if( SUCCEEDED(hr) )
{
*fps = libvlc_media_player_get_fps(p_md);
}
return hr;
}; };
STDMETHODIMP VLCInput::get_hasVout(VARIANT_BOOL* hasVout) STDMETHODIMP VLCInput::get_hasVout(VARIANT_BOOL* hasVout)
...@@ -374,13 +335,9 @@ STDMETHODIMP VLCInput::get_hasVout(VARIANT_BOOL* hasVout) ...@@ -374,13 +335,9 @@ STDMETHODIMP VLCInput::get_hasVout(VARIANT_BOOL* hasVout)
if( NULL == hasVout ) if( NULL == hasVout )
return E_POINTER; return E_POINTER;
libvlc_media_player_t *p_md; *hasVout = varbool( Instance()->get_player().has_vout() );
HRESULT hr = getMD(&p_md);
if( SUCCEEDED(hr) ) return S_OK;
{
*hasVout = varbool( libvlc_media_player_has_vout(p_md) );
}
return hr;
}; };
/****************************************************************************/ /****************************************************************************/
......
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