Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-gpu
Commits
72bef446
Commit
72bef446
authored
Dec 18, 2007
by
Jean-Paul Saman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement vlc.video.toggleTeletext() JS API method
parent
f333d57a
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
92 additions
and
0 deletions
+92
-0
activex/axvlc.idl
activex/axvlc.idl
+3
-0
activex/vlccontrol2.cpp
activex/vlccontrol2.cpp
+26
-0
activex/vlccontrol2.h
activex/vlccontrol2.h
+1
-0
include/vlc/libvlc.h
include/vlc/libvlc.h
+7
-0
mozilla/control/npolibvlc.cpp
mozilla/control/npolibvlc.cpp
+30
-0
src/control/video.c
src/control/video.c
+25
-0
No files found.
activex/axvlc.idl
View file @
72bef446
...
@@ -444,6 +444,9 @@ library AXVLC
...
@@ -444,6 +444,9 @@ library AXVLC
[
helpstring
(
"take video snapshot and save it into picture object."
)
]
[
helpstring
(
"take video snapshot and save it into picture object."
)
]
HRESULT
takeSnapshot
(
[
out
,
retval
]
IPictureDisp
**
picture
)
;
HRESULT
takeSnapshot
(
[
out
,
retval
]
IPictureDisp
**
picture
)
;
[
helpstring
(
"toggle teletext transparent state."
)
]
HRESULT
toggleTeletext
()
;
}
;
}
;
[
[
...
...
activex/vlccontrol2.cpp
View file @
72bef446
...
@@ -2539,6 +2539,32 @@ STDMETHODIMP VLCVideo::toggleFullscreen()
...
@@ -2539,6 +2539,32 @@ STDMETHODIMP VLCVideo::toggleFullscreen()
return
hr
;
return
hr
;
};
};
STDMETHODIMP
VLCVideo
::
toggleTeletext
()
{
libvlc_instance_t
*
p_libvlc
;
HRESULT
hr
=
_p_instance
->
getVLC
(
&
p_libvlc
);
if
(
SUCCEEDED
(
hr
)
)
{
libvlc_exception_t
ex
;
libvlc_exception_init
(
&
ex
);
libvlc_media_instance_t
*
p_md
=
libvlc_playlist_get_media_instance
(
p_libvlc
,
&
ex
);
if
(
!
libvlc_exception_raised
(
&
ex
)
)
{
libvlc_toggle_teletext
(
p_md
,
&
ex
);
libvlc_media_instance_release
(
p_md
);
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
;
};
/*******************************************************************************/
/*******************************************************************************/
VLCControl2
::
VLCControl2
(
VLCPlugin
*
p_instance
)
:
VLCControl2
::
VLCControl2
(
VLCPlugin
*
p_instance
)
:
...
...
activex/vlccontrol2.h
View file @
72bef446
...
@@ -530,6 +530,7 @@ public:
...
@@ -530,6 +530,7 @@ public:
STDMETHODIMP
put_teletext
(
long
);
STDMETHODIMP
put_teletext
(
long
);
STDMETHODIMP
takeSnapshot
(
LPPICTUREDISP
*
);
STDMETHODIMP
takeSnapshot
(
LPPICTUREDISP
*
);
STDMETHODIMP
toggleFullscreen
();
STDMETHODIMP
toggleFullscreen
();
STDMETHODIMP
toggleTeletext
();
protected:
protected:
HRESULT
loadTypeInfo
();
HRESULT
loadTypeInfo
();
...
...
include/vlc/libvlc.h
View file @
72bef446
...
@@ -819,6 +819,13 @@ VLC_PUBLIC_API char *libvlc_video_get_crop_geometry( libvlc_media_instance_t *,
...
@@ -819,6 +819,13 @@ VLC_PUBLIC_API char *libvlc_video_get_crop_geometry( libvlc_media_instance_t *,
*/
*/
VLC_PUBLIC_API
void
libvlc_video_set_crop_geometry
(
libvlc_media_instance_t
*
,
char
*
,
libvlc_exception_t
*
);
VLC_PUBLIC_API
void
libvlc_video_set_crop_geometry
(
libvlc_media_instance_t
*
,
char
*
,
libvlc_exception_t
*
);
/**
* Toggle teletext transparent status on video output
* \param p_input the input
* \param p_exception an initialized exception
*/
VLC_PUBLIC_API
void
libvlc_toggle_teletext
(
libvlc_media_instance_t
*
,
libvlc_exception_t
*
);
/**
/**
* Get current teletext page requested.
* Get current teletext page requested.
* \param p_input the input
* \param p_input the input
...
...
mozilla/control/npolibvlc.cpp
View file @
72bef446
...
@@ -2070,11 +2070,13 @@ RuntimeNPObject::InvokeResult LibvlcVideoNPObject::setProperty(int index, const
...
@@ -2070,11 +2070,13 @@ RuntimeNPObject::InvokeResult LibvlcVideoNPObject::setProperty(int index, const
const
NPUTF8
*
const
LibvlcVideoNPObject
::
methodNames
[]
=
const
NPUTF8
*
const
LibvlcVideoNPObject
::
methodNames
[]
=
{
{
"toggleFullscreen"
,
"toggleFullscreen"
,
"toggleTeletext"
};
};
enum
LibvlcVideoNPObjectMethodIds
enum
LibvlcVideoNPObjectMethodIds
{
{
ID_video_togglefullscreen
,
ID_video_togglefullscreen
,
ID_video_toggleteletext
};
};
const
int
LibvlcVideoNPObject
::
methodCount
=
sizeof
(
LibvlcVideoNPObject
::
methodNames
)
/
sizeof
(
NPUTF8
*
);
const
int
LibvlcVideoNPObject
::
methodCount
=
sizeof
(
LibvlcVideoNPObject
::
methodNames
)
/
sizeof
(
NPUTF8
*
);
...
@@ -2126,6 +2128,34 @@ RuntimeNPObject::InvokeResult LibvlcVideoNPObject::invoke(int index, const NPVar
...
@@ -2126,6 +2128,34 @@ RuntimeNPObject::InvokeResult LibvlcVideoNPObject::invoke(int index, const NPVar
return
INVOKERESULT_GENERIC_ERROR
;
return
INVOKERESULT_GENERIC_ERROR
;
}
}
return
INVOKERESULT_NO_SUCH_METHOD
;
return
INVOKERESULT_NO_SUCH_METHOD
;
case
ID_video_toggleteletext
:
if
(
argCount
==
0
)
{
libvlc_toggle_teletext
(
p_md
,
&
ex
);
libvlc_media_instance_release
(
p_md
);
if
(
libvlc_exception_raised
(
&
ex
)
)
{
NPN_SetException
(
this
,
libvlc_exception_get_message
(
&
ex
));
libvlc_exception_clear
(
&
ex
);
return
INVOKERESULT_GENERIC_ERROR
;
}
else
{
VOID_TO_NPVARIANT
(
result
);
return
INVOKERESULT_NO_ERROR
;
}
}
else
{
/* cannot get md, probably not playing */
if
(
libvlc_exception_raised
(
&
ex
)
)
{
NPN_SetException
(
this
,
libvlc_exception_get_message
(
&
ex
));
libvlc_exception_clear
(
&
ex
);
}
return
INVOKERESULT_GENERIC_ERROR
;
}
return
INVOKERESULT_NO_SUCH_METHOD
;
default:
default:
return
INVOKERESULT_NO_SUCH_METHOD
;
return
INVOKERESULT_NO_SUCH_METHOD
;
}
}
...
...
src/control/video.c
View file @
72bef446
...
@@ -527,6 +527,31 @@ void libvlc_video_set_teletext( libvlc_media_instance_t *p_mi, int i_page,
...
@@ -527,6 +527,31 @@ void libvlc_video_set_teletext( libvlc_media_instance_t *p_mi, int i_page,
vlc_object_release
(
p_vout
);
vlc_object_release
(
p_vout
);
}
}
void
libvlc_toggle_teletext
(
libvlc_media_instance_t
*
p_mi
,
libvlc_exception_t
*
p_e
)
{
/* We only work on the first vout */
vout_thread_t
*
p_vout
=
GetVout
(
p_mi
,
p_e
);
vlc_value_t
val
;
int
i_ret
;
/* GetVout will raise the exception for us */
if
(
!
p_vout
)
return
;
i_ret
=
var_Get
(
p_vout
,
"vbi-opaque"
,
&
val
);
if
(
i_ret
)
libvlc_exception_raise
(
p_e
,
"Unexpected error while looking up teletext value"
);
val
.
b_bool
=
!
val
.
b_bool
;
i_ret
=
var_Set
(
p_vout
,
"vbi-opaque"
,
val
);
if
(
i_ret
)
libvlc_exception_raise
(
p_e
,
"Unexpected error while setting teletext value"
);
vlc_object_release
(
p_vout
);
}
int
libvlc_video_destroy
(
libvlc_media_instance_t
*
p_mi
,
int
libvlc_video_destroy
(
libvlc_media_instance_t
*
p_mi
,
libvlc_exception_t
*
p_e
)
libvlc_exception_t
*
p_e
)
{
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment