* 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.
*/
int libvlc_playlist_delete_item( libvlc_instance_t *, int,
libvlc_exception_t * );
-
+
typedef struct libvlc_input_t libvlc_input_t;
/* Get the input that is currently being played by the playlist
float libvlc_input_get_rate ( libvlc_input_t *, libvlc_exception_t *);
void libvlc_input_set_rate ( libvlc_input_t *, float, libvlc_exception_t *);
int libvlc_input_get_state ( libvlc_input_t *, libvlc_exception_t *);
-
+
/** @} */
/** defgroup libvlc_video Video
* \return the fullscreen status (boolean)
*/
int libvlc_get_fullscreen( libvlc_input_t *, libvlc_exception_t * );
-
+
/**
* Get current video height
* \param p_input the input
*/
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
* \param p_exception an initialized exception
*/
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
* \return the mute status (boolean)
*/
void libvlc_video_resize( libvlc_input_t *, int, int, libvlc_exception_t *);
-
+
/**
* Downcast to this general type as placeholder for a platform specific one, such as:
* Drawable on X11,
*/
void libvlc_audio_set_mute( libvlc_instance_t *, vlc_bool_t , libvlc_exception_t * );
-
/**
* Get current audio level
* \param p_instance libvlc instance
*/
int libvlc_audio_get_volume( libvlc_instance_t *, libvlc_exception_t * );
-
/**
* Set current audio level
* \param p_instance libvlc instance
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.
* \param p_instance the instance
* \param psz_name the name of the broadcast
* \param p_exception an initialized exception
- */
+ */
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
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
ID_next,\r
ID_prev,\r
ID_clear,\r
- ID_removeitem,\r
+ ID_removeitem\r
};\r
\r
RuntimeNPObject::InvokeResult LibvlcPlaylistNPObject::invoke(int index, const NPVariant *args, uint32_t argCount, NPVariant &result)\r
}\r
return INVOKERESULT_GENERIC_ERROR;\r
}\r
- \r
+\r
void LibvlcPlaylistNPObject::parseOptions(const NPString &s, int *i_options, char*** ppsz_options)\r
{\r
if( s.utf8length )\r
"fullscreen",\r
"height",\r
"width",\r
+ "aspectRatio"\r
};\r
\r
enum LibvlcVideoNPObjectPropertyIds\r
ID_fullscreen,\r
ID_height,\r
ID_width,\r
+ ID_aspectratio\r
};\r
\r
const int LibvlcVideoNPObject::propertyCount = sizeof(LibvlcVideoNPObject::propertyNames)/sizeof(NPUTF8 *);\r
INT32_TO_NPVARIANT(val, result);\r
return INVOKERESULT_NO_ERROR;\r
}\r
+ case ID_aspectratio:\r
+ {\r
+ NPUTF8 *psz_aspect = libvlc_video_get_aspect_ratio(p_input, &ex);\r
+ libvlc_input_free(p_input);\r
+ if( libvlc_exception_raised(&ex) )\r
+ {\r
+ NPN_SetException(this, libvlc_exception_get_message(&ex));\r
+ libvlc_exception_clear(&ex);\r
+ return INVOKERESULT_GENERIC_ERROR;\r
+ }\r
+ if( !psz_aspect )\r
+ return INVOKERESULT_GENERIC_ERROR;\r
+\r
+ STRINGZ_TO_NPVARIANT(psz_aspect, result);\r
+ return INVOKERESULT_NO_ERROR;\r
+ }\r
}\r
libvlc_input_free(p_input);\r
}\r
}\r
return INVOKERESULT_NO_ERROR;\r
}\r
+ case ID_aspectratio:\r
+ {\r
+ char *psz_aspect = NULL;\r
+\r
+ if( ! NPVARIANT_IS_STRING(value) )\r
+ {\r
+ libvlc_input_free(p_input);\r
+ return INVOKERESULT_INVALID_VALUE;\r
+ }\r
+\r
+ psz_aspect = stringValue(NPVARIANT_TO_STRING(value));\r
+ if( !psz_aspect )\r
+ return INVOKERESULT_GENERIC_ERROR;\r
+\r
+ libvlc_video_set_aspect_ratio(p_input, psz_aspect, &ex);\r
+ if( psz_aspect )\r
+ free(psz_aspect );\r
+\r
+ libvlc_input_free(p_input);\r
+ if( libvlc_exception_raised(&ex) )\r
+ {\r
+ NPN_SetException(this, libvlc_exception_get_message(&ex));\r
+ libvlc_exception_clear(&ex);\r
+ return INVOKERESULT_GENERIC_ERROR;\r
+ }\r
+ return INVOKERESULT_NO_ERROR;\r
+ }\r
}\r
libvlc_input_free(p_input);\r
}\r
return VLC_TRUE;
}
-
int libvlc_video_reparent( libvlc_input_t *p_input, libvlc_drawable_t d,
libvlc_exception_t *p_e )
{
libvlc_input_t *p_input = libvlc_playlist_get_input(p_instance, p_e);
if( p_input )
{
- vout_thread_t *p_vout = GetVout( p_input, p_e );
+ vout_thread_t *p_vout = GetVout( p_input, p_e );
if( p_vout )
{
/* change viewport for running vout */
}
}
+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 )
{