[propput, helpstring("Sets crop filter geometry.")]\r
HRESULT crop([in] BSTR geometry);\r
\r
+ [propget, helpstring("Returns teletext page used.")]\r
+ HRESULT subtitle([out, retval] long* page);\r
+ [propput, helpstring("Sets teletext page to use.")]\r
+ HRESULT subtitle([in] long page);\r
+\r
[helpstring("toggle fullscreen/windowed state.")]\r
HRESULT toggleFullscreen();\r
\r
return hr;
};
+STDMETHODIMP VLCVideo::get_teletext(long* page)
+{
+ if( NULL == page )
+ 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) )
+ {
+ *page = libvlc_video_get_teletext(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_teletext(long page)
+{
+ 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_teletext(p_input, page, &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::takeSnapshot(LPPICTUREDISP* picture)
{
if( NULL == picture )
STDMETHODIMP put_subtitle(long);
STDMETHODIMP get_crop(BSTR*);
STDMETHODIMP put_crop(BSTR);
+ STDMETHODIMP get_teletext(long*);
+ STDMETHODIMP put_teletext(long);
STDMETHODIMP takeSnapshot(LPPICTUREDISP*);
STDMETHODIMP toggleFullscreen();
*/
VLC_PUBLIC_API void libvlc_video_set_crop_geometry( libvlc_media_instance_t *, char *, libvlc_exception_t * );
+/**
+ * Get current teletext page requested.
+ * \param p_input the input
+ * \param p_exception an initialized exception
+ * \return the current teletext page requested.
+ */
+VLC_PUBLIC_API int libvlc_video_get_teletext( libvlc_media_instance_t *, libvlc_exception_t * );
+
+/**
+ * Set new teletext page to retrieve
+ * \param p_input the input
+ * \param i_page teletex page number requested
+ * \param p_exception an initialized exception
+ */
+VLC_PUBLIC_API void libvlc_video_set_teletext( libvlc_media_instance_t *, int, libvlc_exception_t * );
+
/**
* Take a snapshot of the current video window
* \param p_input the input
"width",\r
"aspectRatio",\r
"subtitle",\r
- "crop"\r
+ "crop",\r
+ "teletext"\r
};\r
\r
enum LibvlcVideoNPObjectPropertyIds\r
ID_video_width,\r
ID_video_aspectratio,\r
ID_video_subtitle,\r
- ID_video_crop\r
+ ID_video_crop,\r
+ ID_video_teletext\r
};\r
\r
const int LibvlcVideoNPObject::propertyCount = sizeof(LibvlcVideoNPObject::propertyNames)/sizeof(NPUTF8 *);\r
STRINGZ_TO_NPVARIANT(psz_geometry, result);\r
return INVOKERESULT_NO_ERROR;\r
}\r
+ case ID_video_teletext:\r
+ {\r
+ int i_page = libvlc_video_get_teletext(p_md, &ex);\r
+ libvlc_media_instance_release(p_md);\r
+ if( libvlc_exception_raised(&ex) )\r
+ {\r
+ NPN_SetException(this, libvlc_exception_get_message(&ex));\r
+ libvlc_exception_clear(&ex);\r
+ return INVOKERESULT_GENERIC_ERROR;\r
+ }\r
+ INT32_TO_NPVARIANT(i_page, result);\r
+ return INVOKERESULT_NO_ERROR;\r
+ }\r
}\r
libvlc_media_instance_release(p_md);\r
}\r
}\r
return INVOKERESULT_NO_ERROR;\r
}\r
+ case ID_video_teletext:\r
+ {\r
+ if( isNumberValue(value) )\r
+ {\r
+ libvlc_video_set_teletext(p_md,\r
+ numberValue(value), &ex);\r
+ libvlc_media_instance_release(p_md);\r
+ if( libvlc_exception_raised(&ex) )\r
+ {\r
+ NPN_SetException(this, libvlc_exception_get_message(&ex));\r
+ libvlc_exception_clear(&ex);\r
+ return INVOKERESULT_GENERIC_ERROR;\r
+ }\r
+ return INVOKERESULT_NO_ERROR;\r
+ }\r
+ libvlc_media_instance_release(p_md);\r
+ return INVOKERESULT_INVALID_VALUE;\r
+ }\r
}\r
libvlc_media_instance_release(p_md);\r
}\r
vlc_object_release( p_vout );
}
+int libvlc_video_get_teletext( libvlc_media_instance_t *p_mi,
+ libvlc_exception_t *p_e )
+{
+ vout_thread_t *p_vout = GetVout( p_mi, p_e );
+ int i_ret = -1;
+
+ if( !p_vout )
+ return i_ret;
+
+ i_ret = var_GetInteger( p_vout, "vbi-page" );
+ vlc_object_release( p_vout );
+ return i_ret;
+}
+
+void libvlc_video_set_teletext( libvlc_media_instance_t *p_mi, int i_page,
+ libvlc_exception_t *p_e )
+{
+ vout_thread_t *p_vout = GetVout( p_mi, p_e );
+ int i_ret = -1;
+
+ if( !p_vout )
+ return;
+
+ i_ret = var_SetInteger( p_vout, "vbi-page", i_page );
+ if( i_ret )
+ libvlc_exception_raise( p_e,
+ "Unexpected error while setting teletext page" );
+ vlc_object_release( p_vout );
+}
+
int libvlc_video_destroy( libvlc_media_instance_t *p_mi,
libvlc_exception_t *p_e )
{