Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
31150350
Commit
31150350
authored
Jul 10, 2010
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add LibVLC API for vmem
parent
b401af05
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
80 additions
and
0 deletions
+80
-0
include/vlc/libvlc_media_player.h
include/vlc/libvlc_media_player.h
+47
-0
src/control/media_player.c
src/control/media_player.c
+31
-0
src/libvlc.sym
src/libvlc.sym
+2
-0
No files found.
include/vlc/libvlc_media_player.h
View file @
31150350
...
...
@@ -200,6 +200,53 @@ VLC_PUBLIC_API void libvlc_media_player_pause ( libvlc_media_player_t *p_mi );
*/
VLC_PUBLIC_API
void
libvlc_media_player_stop
(
libvlc_media_player_t
*
p_mi
);
/**
* Set callbacks and private data to render decoded video to a custom area
* in memory. Use libvlc_video_set_format() to configure the decoded format.
*
* Whenever a new video frame needs to be decoded, the lock callback is
* invoked. Depending on the video chroma, one or three pixel planes of
* adequate dimensions must be returned via the second parameter. Those
* planes must be aligned on 32-bytes boundaries.
*
* When the video frame is decoded, the unlock callback is invoked. The
* second parameter to the callback corresponds is the return value of the
* lock callback. The third parameter conveys the pixel planes for convenience.
*
* When the video frame needs to be shown, as determined by the media playback
* clock, the display callback is invoked. The second parameter also conveys
* the return value from the lock callback.
*
* \param mp the media player
* \param lock callback to allocate video memory
* \param unlock callback to release video memory
* \param opaque private pointer for the three callbacks (as first parameter)
* \version LibVLC 1.1.1 or later
*/
VLC_PUBLIC_API
void
libvlc_video_set_callbacks
(
libvlc_media_player_t
*
mp
,
void
*
(
*
lock
)
(
void
*
opaque
,
void
**
plane
),
void
(
*
unlock
)
(
void
*
opaque
,
void
*
picture
,
void
*
const
*
plane
),
void
(
*
display
)
(
void
*
opaque
,
void
*
picture
),
void
*
opaque
);
/**
* Set decoded video chroma and dimensions. This only works in combination with
* libvlc_video_set_callbacks().
*
* \param mp the media player
* \param chroma a four-characters string identifying the chroma
* (e.g. "RV32" or "I420")
* \param width pixel width
* \param height pixel height
* \param pitch line pitch (in bytes)
* \version LibVLC 1.1.1 or later
*/
VLC_PUBLIC_API
void
libvlc_video_set_format
(
libvlc_media_player_t
*
mp
,
const
char
*
chroma
,
unsigned
width
,
unsigned
height
,
unsigned
pitch
);
/**
* Set the NSView handler where the media player should render its video output.
*
...
...
src/control/media_player.c
View file @
31150350
...
...
@@ -369,6 +369,14 @@ libvlc_media_player_new( libvlc_instance_t *instance )
/* Video */
var_Create
(
mp
,
"vout"
,
VLC_VAR_STRING
|
VLC_VAR_DOINHERIT
);
var_Create
(
mp
,
"window"
,
VLC_VAR_STRING
);
var_Create
(
mp
,
"vmem-lock"
,
VLC_VAR_ADDRESS
);
var_Create
(
mp
,
"vmem-unlock"
,
VLC_VAR_ADDRESS
);
var_Create
(
mp
,
"vmem-display"
,
VLC_VAR_ADDRESS
);
var_Create
(
mp
,
"vmem-data"
,
VLC_VAR_ADDRESS
);
var_Create
(
mp
,
"vmem-chroma"
,
VLC_VAR_STRING
|
VLC_VAR_DOINHERIT
);
var_Create
(
mp
,
"vmem-width"
,
VLC_VAR_INTEGER
|
VLC_VAR_DOINHERIT
);
var_Create
(
mp
,
"vmem-height"
,
VLC_VAR_INTEGER
|
VLC_VAR_DOINHERIT
);
var_Create
(
mp
,
"vmem-width"
,
VLC_VAR_INTEGER
|
VLC_VAR_DOINHERIT
);
var_Create
(
mp
,
"drawable-xid"
,
VLC_VAR_INTEGER
);
#ifdef WIN32
var_Create
(
mp
,
"drawable-hwnd"
,
VLC_VAR_ADDRESS
);
...
...
@@ -767,6 +775,29 @@ void libvlc_media_player_stop( libvlc_media_player_t *p_mi )
unlock_input
(
p_mi
);
}
void
libvlc_video_set_callbacks
(
libvlc_media_player_t
*
mp
,
void
*
(
*
lock_cb
)
(
void
*
,
void
**
),
void
(
*
unlock_cb
)
(
void
*
,
void
*
,
void
*
const
*
),
void
(
*
display_cb
)
(
void
*
,
void
*
),
void
*
opaque
)
{
var_SetAddress
(
mp
,
"vmem-lock"
,
lock_cb
);
var_SetAddress
(
mp
,
"vmem-unlock"
,
unlock_cb
);
var_SetAddress
(
mp
,
"vmem-display"
,
display_cb
);
var_SetAddress
(
mp
,
"vmem-data"
,
opaque
);
var_SetString
(
mp
,
"vout"
,
"vmem"
);
}
void
libvlc_video_set_format
(
libvlc_media_player_t
*
mp
,
const
char
*
chroma
,
unsigned
width
,
unsigned
height
,
unsigned
pitch
)
{
var_SetString
(
mp
,
"vmem-chroma"
,
chroma
);
var_SetInteger
(
mp
,
"vmem-width"
,
width
);
var_SetInteger
(
mp
,
"vmem-height"
,
height
);
var_SetInteger
(
mp
,
"vmem-pitch"
,
pitch
);
}
/**************************************************************************
* set_nsobject
**************************************************************************/
...
...
src/libvlc.sym
View file @
31150350
...
...
@@ -202,6 +202,8 @@ libvlc_video_set_subtitle_file
libvlc_video_set_teletext
libvlc_video_set_track
libvlc_video_take_snapshot
libvlc_video_set_callbacks
libvlc_video_set_format
libvlc_vlm_add_broadcast
libvlc_vlm_add_vod
libvlc_vlm_add_input
...
...
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