Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
bcf43dd0
Commit
bcf43dd0
authored
Nov 01, 2006
by
Filippo Carone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avoid VLC_VariableSet to set the drawable, use libvlc_set_video_drawable instead.
parent
491321f3
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
9 deletions
+50
-9
bindings/java/src/graphics-jni.cc
bindings/java/src/graphics-jni.cc
+28
-8
include/vlc/libvlc.h
include/vlc/libvlc.h
+10
-1
src/control/video.c
src/control/video.c
+12
-0
No files found.
bindings/java/src/graphics-jni.cc
View file @
bcf43dd0
...
...
@@ -23,6 +23,7 @@
/* These are a must*/
#include <jni.h>
#include <vlc/vlc.h>
#include <vlc/libvlc.h>
#include <jawt.h>
#include <jawt_md.h>
...
...
@@ -31,13 +32,12 @@
#endif
#include <stdio.h> // for printf
#include <stdlib.h> // for malloc
/* JVLC internal imports, generated by gcjh */
#include "../includes/JVLCCanvas.h"
/*
* This will only work on X11 at the moment
*/
jlong
getJVLCInstance
(
JNIEnv
*
env
,
jobject
_this
);
JNIEXPORT
void
JNICALL
Java_org_videolan_jvlc_JVLCCanvas_paint
(
JNIEnv
*
env
,
jobject
canvas
,
jobject
graphics
)
{
...
...
@@ -53,7 +53,9 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_JVLCCanvas_paint (JNIEnv *env, job
jint
lock
;
vlc_value_t
value
;
libvlc_drawable_t
drawable
;
libvlc_exception_t
*
exception
=
(
libvlc_exception_t
*
)
malloc
(
sizeof
(
libvlc_exception_t
));
libvlc_exception_init
(
exception
);
/* Get the AWT */
awt
.
version
=
JAWT_VERSION_1_3
;
...
...
@@ -92,8 +94,10 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_JVLCCanvas_paint (JNIEnv *env, job
dsi_win
=
(
JAWT_Win32DrawingSurfaceInfo
*
)
dsi
->
platformInfo
;
/* Now paint */
value
.
i_int
=
reinterpret_cast
<
int
>
(
dsi_win
->
hwnd
);
VLC_VariableSet
(
0
,
"drawable"
,
value
);
drawable
=
reinterpret_cast
<
int
>
(
dsi_win
->
hwnd
);
long
vlcInstance
=
getJVLCInstance
(
env
,
canvas
);
libvlc_set_video_drawable
(
(
libvlc_instance_t
*
)
vlcInstance
,
drawable
,
exception
);
#else // UNIX
/* Get the platform-specific drawing info */
...
...
@@ -103,8 +107,10 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_JVLCCanvas_paint (JNIEnv *env, job
gc
=
XCreateGC
(
dsi_x11
->
display
,
dsi_x11
->
drawable
,
0
,
0
);
XSetBackground
(
dsi_x11
->
display
,
gc
,
0
);
value
.
i_int
=
dsi_x11
->
drawable
;
VLC_VariableSet
(
0
,
"drawable"
,
value
);
drawable
=
dsi_x11
->
drawable
;
long
vlcInstance
=
getJVLCInstance
(
env
,
canvas
);
libvlc_set_video_drawable
(
(
libvlc_instance_t
*
)
vlcInstance
,
drawable
,
exception
);
XFreeGC
(
dsi_x11
->
display
,
gc
);
#endif
...
...
@@ -118,3 +124,17 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_JVLCCanvas_paint (JNIEnv *env, job
/* Free the drawing surface */
awt
.
FreeDrawingSurface
(
ds
);
}
/*
* Utility functions
*/
jlong
getJVLCInstance
(
JNIEnv
*
env
,
jobject
_this
)
{
/* get the id field of object */
jclass
canvascls
=
env
->
GetObjectClass
(
_this
);
jmethodID
canvasmid
=
env
->
GetMethodID
(
canvascls
,
"getJVLC"
,
"()Lorg/videolan/jvlc/JVLC;"
);
jobject
canvasjvlc
=
env
->
CallObjectMethod
(
_this
,
canvasmid
);
jclass
cls
=
env
->
GetObjectClass
(
canvasjvlc
);
jmethodID
mid
=
env
->
GetMethodID
(
cls
,
"getInstance"
,
"()J"
);
jlong
field
=
env
->
CallLongMethod
(
canvasjvlc
,
mid
);
return
field
;
}
include/vlc/libvlc.h
View file @
bcf43dd0
...
...
@@ -287,6 +287,8 @@ int libvlc_input_get_state ( libvlc_input_t *, libvlc_exception_t *
* @{
*/
typedef
int
libvlc_drawable_t
;
/**
* Does this input have a video output ?
* \param p_input the input
...
...
@@ -295,6 +297,14 @@ int libvlc_input_get_state ( libvlc_input_t *, libvlc_exception_t *
vlc_bool_t
libvlc_input_has_vout
(
libvlc_input_t
*
,
libvlc_exception_t
*
);
float
libvlc_input_get_fps
(
libvlc_input_t
*
,
libvlc_exception_t
*
);
/**
* Toggle fullscreen status on video output
* \param p_input the input
* \param drawable the drawable where the video output thread will display the video
* \param p_exception an initialized exception
*/
void
libvlc_set_video_drawable
(
libvlc_instance_t
*
,
libvlc_drawable_t
,
libvlc_exception_t
*
);
/**
* Toggle fullscreen status on video output
* \param p_input the input
...
...
@@ -376,7 +386,6 @@ void libvlc_video_resize( libvlc_input_t *, int, int, libvlc_exception_t *);
* CGrafPort on MacOSX,
* HWND on win32
*/
typedef
int
libvlc_drawable_t
;
/**
* change the parent for the current the video output
...
...
src/control/video.c
View file @
bcf43dd0
...
...
@@ -69,6 +69,18 @@ static vout_thread_t *GetVout( libvlc_input_t *p_input,
* Exported functions
**********************************************************************/
void
libvlc_set_video_drawable
(
libvlc_instance_t
*
p_instance
,
libvlc_drawable_t
drawable
,
libvlc_exception_t
*
p_e
)
{
vlc_value_t
value
;
value
.
i_int
=
drawable
;
var_Set
(
p_instance
->
p_libvlc_int
,
"drawable"
,
value
);
}
void
libvlc_set_fullscreen
(
libvlc_input_t
*
p_input
,
int
b_fullscreen
,
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