Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
VLC Browser Plugins
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
VideoLAN
VLC Browser Plugins
Commits
7177e3cb
Commit
7177e3cb
authored
Oct 19, 2017
by
Pierre Lamot
Committed by
Jean-Baptiste Kempf
Nov 21, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
activex: add method to allow stopping the player asynchonously
Signed-off-by:
Jean-Baptiste Kempf
<
jb@videolan.org
>
parent
5cd1ab48
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
83 additions
and
4 deletions
+83
-4
axvlc.idl
activex/axvlc.idl
+6
-0
plugin.cpp
activex/plugin.cpp
+7
-0
plugin.h
activex/plugin.h
+1
-0
vlccontrol2.cpp
activex/vlccontrol2.cpp
+60
-0
vlccontrol2.h
activex/vlccontrol2.h
+9
-4
No files found.
activex/axvlc.idl
View file @
7177e3cb
...
...
@@ -90,6 +90,7 @@ library AXVLC
const
int
DISPID_MediaPlayerMutedEvent
=
219
;
const
int
DISPID_MediaPlayerUnmutedEvent
=
220
;
const
int
DISPID_MediaPlayerAudioVolumeEvent
=
221
;
const
int
DISPID_MediaPlayerStopAsyncDoneEvent
=
222
;
[
uuid
(
DF48072F
-
5
EF8
-434e-9
B40
-
E2F3AE759B5F
),
...
...
@@ -120,6 +121,8 @@ library AXVLC
void
MediaPlayerEndReached
()
;
[
id
(
DISPID_MediaPlayerStoppedEvent
),
helpstring
(
"Playback stopped"
)
]
void
MediaPlayerStopped
()
;
[
id
(
DISPID_MediaPlayerStopAsyncDoneEvent
),
helpstring
(
"Playback stop async done"
)
]
void
MediaPlayerStopAsyncDone
()
;
[
id
(
DISPID_MediaPlayerTimeChangedEvent
),
helpstring
(
"Time changed"
)
]
void
MediaPlayerTimeChanged
(
[
in
]
long
time
)
;
...
...
@@ -335,6 +338,9 @@ library AXVLC
[
helpstring
(
"Stop current clip."
)
]
HRESULT
stop
()
;
[
helpstring
(
"Stop current clip asynchronously."
)
]
HRESULT
stop_async
()
;
[
helpstring
(
"Advance to next item in playlist."
)
]
HRESULT
next
()
;
...
...
activex/plugin.cpp
View file @
7177e3cb
...
...
@@ -1024,6 +1024,13 @@ void VLCPlugin::fireOnMediaPlayerStoppedEvent()
vlcConnectionPointContainer
->
fireEvent
(
DISPID_MediaPlayerStoppedEvent
,
&
dispparamsNoArgs
);
};
void
VLCPlugin
::
fireOnMediaPlayerStopAsyncDoneEvent
()
{
DISPPARAMS
dispparamsNoArgs
=
{
NULL
,
NULL
,
0
,
0
};
vlcConnectionPointContainer
->
fireEvent
(
DISPID_MediaPlayerStopAsyncDoneEvent
,
&
dispparamsNoArgs
);
};
void
VLCPlugin
::
fireOnMediaPlayerForwardEvent
()
{
DISPPARAMS
dispparamsNoArgs
=
{
NULL
,
NULL
,
0
,
0
};
...
...
activex/plugin.h
View file @
7177e3cb
...
...
@@ -250,6 +250,7 @@ public:
void
fireOnMediaPlayerEncounteredErrorEvent
();
void
fireOnMediaPlayerEndReachedEvent
();
void
fireOnMediaPlayerStoppedEvent
();
void
fireOnMediaPlayerStopAsyncDoneEvent
();
void
fireOnMediaPlayerTimeChangedEvent
(
libvlc_time_t
time
);
void
fireOnMediaPlayerPositionChangedEvent
(
float
position
);
...
...
activex/vlccontrol2.cpp
View file @
7177e3cb
...
...
@@ -910,6 +910,30 @@ STDMETHODIMP VLCPlaylistItems::remove(long item)
}
/****************************************************************************/
enum
PlaylistAsyncMessages
{
PM_INPUT_STOP
=
WM_USER
+
1
,
PM_DESTROY
};
VLCPlaylist
::
VLCPlaylist
(
VLCPlugin
*
p
)
:
VLCInterface
<
VLCPlaylist
,
IVLCPlaylist
>
(
p
),
_p_vlcplaylistitems
(
new
VLCPlaylistItems
(
p
))
{
_async_thread
=
CreateThread
(
NULL
,
0
,
(
LPTHREAD_START_ROUTINE
)
VLCPlaylist
::
async_handler_cb
,
(
LPVOID
)
this
,
0
,
&
_async_thread_id
);
}
VLCPlaylist
::~
VLCPlaylist
()
{
PostThreadMessage
(
_async_thread_id
,
PM_DESTROY
,
0
,
0
);
WaitForSingleObject
(
_async_thread
,
INFINITE
);
CloseHandle
(
_async_thread
);
delete
_p_vlcplaylistitems
;
}
STDMETHODIMP
VLCPlaylist
::
get_itemCount
(
long
*
count
)
{
...
...
@@ -1041,6 +1065,12 @@ STDMETHODIMP VLCPlaylist::stop()
return
S_OK
;
}
STDMETHODIMP
VLCPlaylist
::
stop_async
()
{
PostThreadMessage
(
_async_thread_id
,
PM_INPUT_STOP
,
0
,
0
);
return
S_OK
;
}
STDMETHODIMP
VLCPlaylist
::
next
()
{
_plug
->
get_player
().
mlp
().
next
();
...
...
@@ -1089,6 +1119,36 @@ STDMETHODIMP VLCPlaylist::parse(long options, long timeout, long *status)
return
S_OK
;
}
void
VLCPlaylist
::
async_handler_cb
(
LPVOID
obj
)
{
VLCPlaylist
*
that
=
(
VLCPlaylist
*
)
obj
;
that
->
async_handler
();
}
void
VLCPlaylist
::
async_handler
()
{
MSG
msg
;
bool
b_quit
=
false
;
while
(
!
b_quit
&&
GetMessage
(
&
msg
,
0
,
0
,
0
))
{
switch
(
msg
.
message
)
{
case
PM_INPUT_STOP
:
this
->
stop
();
_plug
->
fireOnMediaPlayerStopAsyncDoneEvent
();
break
;
case
PM_DESTROY
:
b_quit
=
true
;
break
;
default
:
TranslateMessage
(
&
msg
);
DispatchMessage
(
&
msg
);
break
;
}
}
}
/****************************************************************************/
STDMETHODIMP
VLCSubtitle
::
get_track
(
long
*
spu
)
...
...
activex/vlccontrol2.h
View file @
7177e3cb
...
...
@@ -289,10 +289,8 @@ public:
class
VLCPlaylist
:
public
VLCInterface
<
VLCPlaylist
,
IVLCPlaylist
>
{
public
:
VLCPlaylist
(
VLCPlugin
*
p
)
:
VLCInterface
<
VLCPlaylist
,
IVLCPlaylist
>
(
p
),
_p_vlcplaylistitems
(
new
VLCPlaylistItems
(
p
))
{
}
virtual
~
VLCPlaylist
()
{
delete
_p_vlcplaylistitems
;
}
VLCPlaylist
(
VLCPlugin
*
p
);
virtual
~
VLCPlaylist
();
// IVLCPlaylist methods
STDMETHODIMP
get_itemCount
(
long
*
);
...
...
@@ -304,6 +302,7 @@ public:
STDMETHODIMP
pause
();
STDMETHODIMP
togglePause
();
STDMETHODIMP
stop
();
STDMETHODIMP
stop_async
();
STDMETHODIMP
next
();
STDMETHODIMP
prev
();
STDMETHODIMP
clear
();
...
...
@@ -311,8 +310,14 @@ public:
STDMETHODIMP
get_items
(
IVLCPlaylistItems
**
);
STDMETHODIMP
parse
(
long
options
,
long
timeout
,
long
*
status
);
private
:
static
void
async_handler_cb
(
LPVOID
obj
);
void
async_handler
();
private
:
VLCPlaylistItems
*
_p_vlcplaylistitems
;
HANDLE
_async_thread
;
DWORD
_async_thread_id
;
};
class
VLCSubtitle
:
public
VLCInterface
<
VLCSubtitle
,
IVLCSubtitle
>
...
...
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