Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
b6cada70
Commit
b6cada70
authored
Feb 21, 2009
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup media player
parent
708049c3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
135 additions
and
36 deletions
+135
-36
bindings/cil/src/libvlc.cs
bindings/cil/src/libvlc.cs
+120
-0
bindings/cil/src/player.cs
bindings/cil/src/player.cs
+15
-36
No files found.
bindings/cil/src/libvlc.cs
View file @
b6cada70
...
...
@@ -138,5 +138,125 @@ namespace VideoLAN.LibVLC
/*[DllImport ("libvlc.dll", EntryPoint="libvlc_media_get_user_data")]
public static extern
IntPtr MediaIsPreparsed (MediaHandle media, NativeException ex);*/
/* media_player.c */
[
DllImport
(
"libvlc.dll"
,
EntryPoint
=
"libvlc_media_player_new"
)]
public
static
extern
PlayerHandle
PlayerCreate
(
InstanceHandle
inst
,
NativeException
ex
);
[
DllImport
(
"libvlc.dll"
,
EntryPoint
=
"libvlc_media_player_new_from_media"
)]
public
static
extern
PlayerHandle
PlayerCreateFromMedia
(
MediaHandle
media
,
NativeException
ex
);
[
DllImport
(
"libvlc.dll"
,
EntryPoint
=
"libvlc_media_player_release"
)]
public
static
extern
void
PlayerRelease
(
IntPtr
ptr
);
/* PlayerRetain */
[
DllImport
(
"libvlc.dll"
,
EntryPoint
=
"libvlc_media_player_set_media"
)]
public
static
extern
void
PlayerSetMedia
(
PlayerHandle
player
,
MediaHandle
media
,
NativeException
ex
);
/*[DllImport ("libvlc.dll",
EntryPoint="libvlc_media_player_get_media")]
public static extern
MediaHandle PlayerGetMedia (PlayerHandle player,
NativeException ex);*/
/*[DllImport ("libvlc.dll",
EntryPoint="libvlc_media_player_event_manager")]
public static extern
EventManagerHandle PlayerGetEventManager (PlayerHandle media,
NativeException ex);*/
[
DllImport
(
"libvlc.dll"
,
EntryPoint
=
"libvlc_media_player_is_playing"
)]
public
static
extern
int
PlayerIsPlaying
(
PlayerHandle
player
,
NativeException
ex
);
[
DllImport
(
"libvlc.dll"
,
EntryPoint
=
"libvlc_media_player_play"
)]
public
static
extern
void
PlayerPlay
(
PlayerHandle
player
,
NativeException
ex
);
[
DllImport
(
"libvlc.dll"
,
EntryPoint
=
"libvlc_media_player_pause"
)]
public
static
extern
void
PlayerPause
(
PlayerHandle
player
,
NativeException
ex
);
[
DllImport
(
"libvlc.dll"
,
EntryPoint
=
"libvlc_media_player_stop"
)]
public
static
extern
void
PlayerStop
(
PlayerHandle
player
,
NativeException
ex
);
[
DllImport
(
"libvlc.dll"
,
EntryPoint
=
"libvlc_media_player_set_xwindow"
)]
public
static
extern
void
PlayerSetXWindow
(
PlayerHandle
player
,
int
xid
,
NativeException
ex
);
[
DllImport
(
"libvlc.dll"
,
EntryPoint
=
"libvlc_media_player_get_xwindow"
)]
public
static
extern
int
PlayerGetXWindow
(
PlayerHandle
player
,
NativeException
ex
);
[
DllImport
(
"libvlc.dll"
,
EntryPoint
=
"libvlc_media_player_set_hwnd"
)]
public
static
extern
void
PlayerSetHWND
(
PlayerHandle
player
,
SafeHandle
hwnd
,
NativeException
ex
);
[
DllImport
(
"libvlc.dll"
,
EntryPoint
=
"libvlc_media_player_get_hwnd"
)]
public
static
extern
IntPtr
PlayerGetHWND
(
PlayerHandle
player
,
NativeException
ex
);
[
DllImport
(
"libvlc.dll"
,
EntryPoint
=
"libvlc_media_player_get_length"
)]
public
static
extern
long
PlayerGetLength
(
PlayerHandle
player
,
NativeException
ex
);
[
DllImport
(
"libvlc.dll"
,
EntryPoint
=
"libvlc_media_player_get_time"
)]
public
static
extern
long
PlayerGetTime
(
PlayerHandle
player
,
NativeException
ex
);
[
DllImport
(
"libvlc.dll"
,
EntryPoint
=
"libvlc_media_player_set_time"
)]
public
static
extern
void
PlayerSetTime
(
PlayerHandle
player
,
long
time
,
NativeException
ex
);
[
DllImport
(
"libvlc.dll"
,
EntryPoint
=
"libvlc_media_player_get_position"
)]
public
static
extern
float
PlayerGetPosition
(
PlayerHandle
player
,
NativeException
ex
);
[
DllImport
(
"libvlc.dll"
,
EntryPoint
=
"libvlc_media_player_set_position"
)]
public
static
extern
void
PlayerSetPosition
(
PlayerHandle
player
,
float
position
,
NativeException
ex
);
[
DllImport
(
"libvlc.dll"
,
EntryPoint
=
"libvlc_media_player_get_chapter"
)]
public
static
extern
int
PlayerGetChapter
(
PlayerHandle
player
,
NativeException
ex
);
[
DllImport
(
"libvlc.dll"
,
EntryPoint
=
"libvlc_media_player_set_chapter"
)]
public
static
extern
void
PlayerSetChapter
(
PlayerHandle
player
,
int
chapter
,
NativeException
ex
);
[
DllImport
(
"libvlc.dll"
,
EntryPoint
=
"libvlc_media_player_get_chapter_count"
)]
public
static
extern
int
PlayerGetChapterCounter
(
PlayerHandle
player
,
NativeException
ex
);
/* PlayerWillPlay */
};
};
bindings/cil/src/player.cs
View file @
b6cada70
...
...
@@ -35,34 +35,14 @@ using System.Runtime.InteropServices;
namespace
VideoLAN.LibVLC
{
/**
* @brief
Media
PlayerHandle: unmanaged LibVLC media player pointer
* @brief PlayerHandle: unmanaged LibVLC media player pointer
* @ingroup Internals
*/
internal
sealed
class
Media
PlayerHandle
:
NonNullHandle
internal
sealed
class
PlayerHandle
:
NonNullHandle
{
[
DllImport
(
"libvlc.dll"
,
EntryPoint
=
"libvlc_media_player_new"
)]
internal
static
extern
MediaPlayerHandle
Create
(
InstanceHandle
inst
,
NativeException
ex
);
[
DllImport
(
"libvlc.dll"
,
EntryPoint
=
"libvlc_media_player_new_from_media"
)]
internal
static
extern
MediaPlayerHandle
Create
(
MediaHandle
media
,
NativeException
ex
);
[
DllImport
(
"libvlc.dll"
,
EntryPoint
=
"libvlc_media_player_release"
)]
internal
static
extern
void
Release
(
IntPtr
ptr
);
[
DllImport
(
"libvlc.dll"
,
EntryPoint
=
"libvlc_media_player_set_media"
)]
internal
static
extern
MediaPlayerHandle
SetMedia
(
MediaPlayerHandle
player
,
MediaHandle
media
,
NativeException
ex
);
protected
override
void
Destroy
()
{
Release
(
handle
);
LibVLC
.
Player
Release
(
handle
);
}
};
...
...
@@ -71,13 +51,13 @@ namespace VideoLAN.LibVLC
* @ingroup API
* Use this class to play a media.
*/
public
class
Media
Player
:
BaseObject
public
class
Player
:
BaseObject
{
internal
Media
PlayerHandle
Handle
internal
PlayerHandle
Handle
{
get
{
return
handle
as
Media
PlayerHandle
;
return
handle
as
PlayerHandle
;
}
}
...
...
@@ -96,35 +76,34 @@ namespace VideoLAN.LibVLC
{
MediaHandle
mh
=
(
value
!=
null
)
?
value
.
Handle
:
null
;
MediaPlayerHandle
.
SetMedia
(
Handle
,
mh
,
null
);
LibVLC
.
Player
SetMedia
(
Handle
,
mh
,
null
);
media
=
value
;
}
}
/**
* Creates a
n empty MediaPlayer object
.
* Creates a
player with no medias
.
* An input media will be needed before this media player can be used.
*
* @param instance VLC instance
*/
public
Media
Player
(
VLC
instance
)
public
Player
(
VLC
instance
)
{
this
.
media
=
null
;
handle
=
MediaPlayerHandle
.
Create
(
instance
.
Handle
,
ex
);
ex
.
Raise
();
handle
=
LibVLC
.
Player
Create
(
instance
.
Handle
,
ex
);
Raise
();
}
/**
* Creates a MediaPlayer object from a Media object.
* This allows playing the specified media.
* Creates a player object for a given a media.
*
* @param media media object
*/
public
Media
Player
(
Media
media
)
public
Player
(
Media
media
)
{
this
.
media
=
media
;
handle
=
MediaPlayerHandle
.
Create
(
media
.
Handle
,
ex
);
ex
.
Raise
();
handle
=
LibVLC
.
PlayerCreateFromMedia
(
media
.
Handle
,
ex
);
Raise
();
}
};
...
...
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