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
60a84269
Commit
60a84269
authored
Feb 22, 2009
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add media and player state support
parent
97bda2d0
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
53 additions
and
8 deletions
+53
-8
bindings/cil/src/libvlc.cs
bindings/cil/src/libvlc.cs
+4
-5
bindings/cil/src/media.cs
bindings/cil/src/media.cs
+31
-0
bindings/cil/src/player.cs
bindings/cil/src/player.cs
+13
-0
bindings/cil/tests/testvlc.cs
bindings/cil/tests/testvlc.cs
+3
-2
include/vlc/libvlc_structures.h
include/vlc/libvlc_structures.h
+2
-1
No files found.
bindings/cil/src/libvlc.cs
View file @
60a84269
...
@@ -109,9 +109,9 @@ namespace VideoLAN.LibVLC
...
@@ -109,9 +109,9 @@ namespace VideoLAN.LibVLC
MediaHandle MediaDuplicate (MediaHandle media, int type,
MediaHandle MediaDuplicate (MediaHandle media, int type,
NativeException ex);*/
NativeException ex);*/
/*
[DllImport ("libvlc.dll", EntryPoint="libvlc_media_get_state")]
[
DllImport
(
"libvlc.dll"
,
EntryPoint
=
"libvlc_media_get_state"
)]
public
static
extern
public
static
extern
int MediaGetState (MediaHandle media, NativeException ex);*/
State
MediaGetState
(
MediaHandle
media
,
NativeException
ex
);
/*[DllImport ("libvlc.dll", EntryPoint="libvlc_media_subitems")]
/*[DllImport ("libvlc.dll", EntryPoint="libvlc_media_subitems")]
public static extern
public static extern
...
@@ -301,11 +301,10 @@ namespace VideoLAN.LibVLC
...
@@ -301,11 +301,10 @@ namespace VideoLAN.LibVLC
void
PlayerSetRate
(
PlayerHandle
player
,
float
rate
,
void
PlayerSetRate
(
PlayerHandle
player
,
float
rate
,
NativeException
ex
);
NativeException
ex
);
/*
[DllImport ("libvlc.dll",
[
DllImport
(
"libvlc.dll"
,
EntryPoint
=
"libvlc_media_player_get_state"
)]
EntryPoint
=
"libvlc_media_player_get_state"
)]
public
static
extern
public
static
extern
void PlayerSetState (PlayerHandle player, float rate,
State
PlayerGetState
(
PlayerHandle
player
,
NativeException
ex
);
NativeException ex); */
[
DllImport
(
"libvlc.dll"
,
[
DllImport
(
"libvlc.dll"
,
EntryPoint
=
"libvlc_media_player_get_fps"
)]
EntryPoint
=
"libvlc_media_player_get_fps"
)]
...
...
bindings/cil/src/media.cs
View file @
60a84269
...
@@ -42,6 +42,24 @@ namespace VideoLAN.LibVLC
...
@@ -42,6 +42,24 @@ namespace VideoLAN.LibVLC
}
}
};
};
/**
* @brief State: media/player state
*
* Media and Player objects are always in one of these state.
* @see Media::State and @see Player::State.
*/
public
enum
State
{
NothingSpecial
,
/**< Nothing going on */
Opening
,
/**< Being opened */
Buffering
,
/**< Buffering before play */
Playing
,
/**< Playing */
Paused
,
/**< Paused */
Stopped
,
/**< Stopped */
Ended
,
/**< Played until the end */
Error
,
/**< Failed */
};
/**
/**
* @brief Media: a source media
* @brief Media: a source media
* @ingroup API
* @ingroup API
...
@@ -121,6 +139,19 @@ namespace VideoLAN.LibVLC
...
@@ -121,6 +139,19 @@ namespace VideoLAN.LibVLC
return
new
Media
(
LibVLC
.
MediaDuplicate
(
Handle
));
return
new
Media
(
LibVLC
.
MediaDuplicate
(
Handle
));
}
}
/**
* Current state of the media.
*/
public
State
State
{
get
{
State
ret
=
LibVLC
.
MediaGetState
(
Handle
,
ex
);
Raise
();
return
ret
;
}
}
/**
/**
* Duration of the media in microseconds. The precision of the result
* Duration of the media in microseconds. The precision of the result
* depends on the input stram protocol and file format. The value
* depends on the input stram protocol and file format. The value
...
...
bindings/cil/src/player.cs
View file @
60a84269
...
@@ -363,6 +363,19 @@ namespace VideoLAN.LibVLC
...
@@ -363,6 +363,19 @@ namespace VideoLAN.LibVLC
}
}
}
}
/**
* Current state of the player.
*/
public
State
State
{
get
{
State
ret
=
LibVLC
.
PlayerGetState
(
Handle
,
ex
);
Raise
();
return
ret
;
}
}
/**
/**
* Frame rate in unit/seconds.
* Frame rate in unit/seconds.
*/
*/
...
...
bindings/cil/tests/testvlc.cs
View file @
60a84269
...
@@ -33,6 +33,7 @@ namespace VideoLAN.LibVLC.Test
...
@@ -33,6 +33,7 @@ namespace VideoLAN.LibVLC.Test
Console
.
WriteLine
(
"Media at {0}"
,
m
.
Location
);
Console
.
WriteLine
(
"Media at {0}"
,
m
.
Location
);
Console
.
WriteLine
(
" duration: {0}µs"
,
m
.
Duration
);
Console
.
WriteLine
(
" duration: {0}µs"
,
m
.
Duration
);
Console
.
WriteLine
(
" preparsed: {0}"
,
m
.
IsPreparsed
);
Console
.
WriteLine
(
" preparsed: {0}"
,
m
.
IsPreparsed
);
Console
.
WriteLine
(
" state: {0}"
,
m
.
State
);
}
}
private
static
void
DumpPlayer
(
Player
p
)
private
static
void
DumpPlayer
(
Player
p
)
...
@@ -41,8 +42,8 @@ namespace VideoLAN.LibVLC.Test
...
@@ -41,8 +42,8 @@ namespace VideoLAN.LibVLC.Test
return
;
return
;
int
percent
=
(
int
)(
p
.
Position
*
100
);
int
percent
=
(
int
)(
p
.
Position
*
100
);
Console
.
Write
(
"{0}
of {1} ms ({2}%)\r"
,
p
.
Time
,
p
.
Length
,
Console
.
Write
(
"{0}
: {1} of {2} ms ({3}%)\r"
,
p
.
State
,
percent
);
p
.
Time
,
p
.
Length
,
p
ercent
);
}
}
private
static
void
Sleep
(
int
msec
)
private
static
void
Sleep
(
int
msec
)
...
...
include/vlc/libvlc_structures.h
View file @
60a84269
...
@@ -127,7 +127,8 @@ typedef struct libvlc_media_player_t libvlc_media_player_t;
...
@@ -127,7 +127,8 @@ typedef struct libvlc_media_player_t libvlc_media_player_t;
/**
/**
* Note the order of libvlc_state_t enum must match exactly the order of
* Note the order of libvlc_state_t enum must match exactly the order of
* @see mediacontrol_PlayerStatus and @see input_state_e enums.
* @see mediacontrol_PlayerStatus, @see input_state_e enums,
* and VideoLAN.LibVLC.State (at bindings/cil/src/media.cs).
*
*
* Expected states by web plugins are:
* Expected states by web plugins are:
* IDLE/CLOSE=0, OPENING=1, BUFFERING=2, PLAYING=3, PAUSED=4,
* IDLE/CLOSE=0, OPENING=1, BUFFERING=2, PLAYING=3, PAUSED=4,
...
...
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