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
82e4cda8
Commit
82e4cda8
authored
Oct 30, 2006
by
Jean-Paul Saman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(Forward port of [17371]) Implement Aspect Ratio property for Mozilla plugin
parent
e86b20c4
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
104 additions
and
17 deletions
+104
-17
include/vlc/libvlc.h
include/vlc/libvlc.h
+25
-13
mozilla/control/npolibvlc.cpp
mozilla/control/npolibvlc.cpp
+47
-2
src/control/video.c
src/control/video.c
+32
-2
No files found.
include/vlc/libvlc.h
View file @
82e4cda8
...
...
@@ -137,10 +137,12 @@ void libvlc_destroy( libvlc_instance_t *, libvlc_exception_t * );
* LibVLC Playlist handling
* @{
*/
/**
* Set loop variable
*/
void
libvlc_playlist_loop
(
libvlc_instance_t
*
,
vlc_bool_t
,
libvlc_exception_t
*
);
/**
* Start playing. You can give some additionnal playlist item options
* that will be added to the item before playing it.
...
...
@@ -332,6 +334,22 @@ int libvlc_video_get_height( libvlc_input_t *, libvlc_exception_t * );
*/
int
libvlc_video_get_width
(
libvlc_input_t
*
,
libvlc_exception_t
*
);
/**
* Get current video aspect ratio
* \param p_input the input
* \param p_exception an initialized exception
* \return the video aspect ratio
*/
char
*
libvlc_video_get_aspect_ratio
(
libvlc_input_t
*
,
libvlc_exception_t
*
);
/**
* Set new video aspect ratio
* \param p_input the input
* \param psz_aspect new video aspect-ratio
* \param p_exception an initialized exception
*/
void
libvlc_video_set_aspect_ratio
(
libvlc_input_t
*
,
char
*
,
libvlc_exception_t
*
);
/**
* Take a snapshot of the current video window
* \param p_input the input
...
...
@@ -342,7 +360,6 @@ void libvlc_video_take_snapshot( libvlc_input_t *, char *, libvlc_exception_t *
int
libvlc_video_destroy
(
libvlc_input_t
*
,
libvlc_exception_t
*
);
/**
* Resize the current video output window
* \param p_instance libvlc instance
...
...
@@ -453,7 +470,6 @@ vlc_bool_t libvlc_audio_get_mute( libvlc_instance_t *, libvlc_exception_t * );
*/
void
libvlc_audio_set_mute
(
libvlc_instance_t
*
,
vlc_bool_t
,
libvlc_exception_t
*
);
/**
* Get current audio level
* \param p_instance libvlc instance
...
...
@@ -462,7 +478,6 @@ void libvlc_audio_set_mute( libvlc_instance_t *, vlc_bool_t , libvlc_exception_t
*/
int
libvlc_audio_get_volume
(
libvlc_instance_t
*
,
libvlc_exception_t
*
);
/**
* Set current audio level
* \param p_instance libvlc instance
...
...
@@ -539,9 +554,6 @@ void libvlc_vlm_set_input( libvlc_instance_t *, char *, char*,
void
libvlc_vlm_set_loop
(
libvlc_instance_t
*
,
char
*
,
int
,
libvlc_exception_t
*
);
/**
* Edit the parameters of a media. This will delete all existing inputs and
* add the specified one.
...
...
@@ -574,7 +586,6 @@ void libvlc_vlm_play_media ( libvlc_instance_t *, char *, libvlc_exception_t * )
*/
void
libvlc_vlm_stop_media
(
libvlc_instance_t
*
,
char
*
,
libvlc_exception_t
*
);
/**
* Pauses the named broadcast.
* \param p_instance the instance
...
...
@@ -643,6 +654,7 @@ typedef struct libvlc_log_message_t
const
char
*
psz_header
;
/* optional header */
const
char
*
psz_message
;
/* message */
}
libvlc_log_message_t
;
/**
* Returns the VLC messaging verbosity level
* \param p_instance libvlc instance
...
...
mozilla/control/npolibvlc.cpp
View file @
82e4cda8
...
...
@@ -1078,7 +1078,7 @@ enum LibvlcPlaylistNPObjectMethodIds
ID_next
,
ID_prev
,
ID_clear
,
ID_removeitem
,
ID_removeitem
};
RuntimeNPObject
::
InvokeResult
LibvlcPlaylistNPObject
::
invoke
(
int
index
,
const
NPVariant
*
args
,
uint32_t
argCount
,
NPVariant
&
result
)
...
...
@@ -1460,6 +1460,7 @@ const NPUTF8 * const LibvlcVideoNPObject::propertyNames[] =
"fullscreen"
,
"height"
,
"width"
,
"aspectRatio"
};
enum
LibvlcVideoNPObjectPropertyIds
...
...
@@ -1467,6 +1468,7 @@ enum LibvlcVideoNPObjectPropertyIds
ID_fullscreen
,
ID_height
,
ID_width
,
ID_aspectratio
};
const
int
LibvlcVideoNPObject
::
propertyCount
=
sizeof
(
LibvlcVideoNPObject
::
propertyNames
)
/
sizeof
(
NPUTF8
*
);
...
...
@@ -1528,6 +1530,22 @@ RuntimeNPObject::InvokeResult LibvlcVideoNPObject::getProperty(int index, NPVari
INT32_TO_NPVARIANT
(
val
,
result
);
return
INVOKERESULT_NO_ERROR
;
}
case
ID_aspectratio
:
{
NPUTF8
*
psz_aspect
=
libvlc_video_get_aspect_ratio
(
p_input
,
&
ex
);
libvlc_input_free
(
p_input
);
if
(
libvlc_exception_raised
(
&
ex
)
)
{
NPN_SetException
(
this
,
libvlc_exception_get_message
(
&
ex
));
libvlc_exception_clear
(
&
ex
);
return
INVOKERESULT_GENERIC_ERROR
;
}
if
(
!
psz_aspect
)
return
INVOKERESULT_GENERIC_ERROR
;
STRINGZ_TO_NPVARIANT
(
psz_aspect
,
result
);
return
INVOKERESULT_NO_ERROR
;
}
}
libvlc_input_free
(
p_input
);
}
...
...
@@ -1571,6 +1589,33 @@ RuntimeNPObject::InvokeResult LibvlcVideoNPObject::setProperty(int index, const
}
return
INVOKERESULT_NO_ERROR
;
}
case
ID_aspectratio
:
{
char
*
psz_aspect
=
NULL
;
if
(
!
NPVARIANT_IS_STRING
(
value
)
)
{
libvlc_input_free
(
p_input
);
return
INVOKERESULT_INVALID_VALUE
;
}
psz_aspect
=
stringValue
(
NPVARIANT_TO_STRING
(
value
));
if
(
!
psz_aspect
)
return
INVOKERESULT_GENERIC_ERROR
;
libvlc_video_set_aspect_ratio
(
p_input
,
psz_aspect
,
&
ex
);
if
(
psz_aspect
)
free
(
psz_aspect
);
libvlc_input_free
(
p_input
);
if
(
libvlc_exception_raised
(
&
ex
)
)
{
NPN_SetException
(
this
,
libvlc_exception_get_message
(
&
ex
));
libvlc_exception_clear
(
&
ex
);
return
INVOKERESULT_GENERIC_ERROR
;
}
return
INVOKERESULT_NO_ERROR
;
}
}
libvlc_input_free
(
p_input
);
}
...
...
src/control/video.c
View file @
82e4cda8
...
...
@@ -210,7 +210,6 @@ vlc_bool_t libvlc_input_has_vout( libvlc_input_t *p_input,
return
VLC_TRUE
;
}
int
libvlc_video_reparent
(
libvlc_input_t
*
p_input
,
libvlc_drawable_t
d
,
libvlc_exception_t
*
p_e
)
{
...
...
@@ -319,6 +318,37 @@ void libvlc_video_set_viewport( libvlc_instance_t *p_instance,
}
}
char
*
libvlc_video_get_aspect_ratio
(
libvlc_input_t
*
p_input
,
libvlc_exception_t
*
p_e
)
{
char
*
psz_aspect
=
0
;
vout_thread_t
*
p_vout
=
GetVout
(
p_input
,
p_e
);
if
(
!
p_vout
)
return
0
;
psz_aspect
=
var_GetString
(
p_vout1
,
"aspect-ratio"
);
vlc_object_release
(
p_vout
);
return
psz_aspect
;
}
void
libvlc_video_set_aspect_ratio
(
libvlc_input_t
*
p_input
,
char
*
psz_aspect
,
libvlc_exception_t
*
p_e
)
{
vout_thread_t
*
p_vout
=
GetVout
(
p_input
,
p_e
);
int
i_ret
=
-
1
;
if
(
!
p_vout
)
return
;
i_ret
=
var_SetString
(
p_vout
,
"aspect-ratio"
,
psz_aspect
);
if
(
i_ret
)
libvlc_exception_raise
(
p_e
,
"Unexpected error while setting aspect-ratio value"
);
vlc_object_release
(
p_vout
);
}
int
libvlc_video_destroy
(
libvlc_input_t
*
p_input
,
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