* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
-#include "mediacontrol_internal.h"
#include <vlc/mediacontrol.h>
#include <vlc_interface.h>
#include <vlc_vout.h>
#include <vlc_osd.h>
+#include "mediacontrol_internal.h"
#include <stdlib.h> /* malloc(), free() */
#include <string.h>
# include <sys/types.h>
#endif
-#define RAISE( c, m ) exception->code = c; \
- exception->message = strdup(m);
-
/* FIXME: Need to stop accessing private input structures !! */
#include "input/input_internal.h"
-vlc_int64_t mediacontrol_unit_convert( input_thread_t *p_input,
+vlc_int64_t private_mediacontrol_unit_convert( input_thread_t *p_input,
mediacontrol_PositionKey from,
mediacontrol_PositionKey to,
vlc_int64_t value )
// if( p_input->stream.i_mux_rate == 0 )
// return 0;
-//
+//
// /* Convert an offset into milliseconds. Taken from input_ext-intf.c.
// The 50 hardcoded constant comes from the definition of i_mux_rate :
// i_mux_rate : the rate we read the stream (in units of 50 bytes/s) ;
// 0 if undef */
// if( to == mediacontrol_MediaTime )
// return ( vlc_int64_t )( 1000 * value / 50 / p_input->stream.i_mux_rate );
-//
+//
// if( to == mediacontrol_SampleCount )
// {
// double f_fps;
/* Converts a mediacontrol_Position into a time in microseconds in
movie clock time */
vlc_int64_t
-mediacontrol_position2microsecond( input_thread_t* p_input, const mediacontrol_Position * pos )
+private_mediacontrol_position2microsecond( input_thread_t* p_input, const mediacontrol_Position * pos )
{
switch( pos->origin )
{
case mediacontrol_AbsolutePosition:
- return ( 1000 * mediacontrol_unit_convert( p_input,
+ return ( 1000 * private_mediacontrol_unit_convert( p_input,
pos->key, /* from */
mediacontrol_MediaTime, /* to */
pos->value ) );
var_Get( p_input, "time", &val );
}
- l_pos = 1000 * mediacontrol_unit_convert( p_input,
+ l_pos = 1000 * private_mediacontrol_unit_convert( p_input,
pos->key,
mediacontrol_MediaTime,
pos->value );
if( val.i_time > 0)
{
- l_pos = ( 1000 * mediacontrol_unit_convert( p_input,
+ l_pos = ( 1000 * private_mediacontrol_unit_convert( p_input,
pos->key,
mediacontrol_MediaTime,
pos->value ) );
}
mediacontrol_RGBPicture*
-mediacontrol_RGBPicture__alloc( int datasize )
+private_mediacontrol_RGBPicture__alloc( int datasize )
{
mediacontrol_RGBPicture* pic;
mediacontrol_RGBPicture__free( mediacontrol_RGBPicture* pic )
{
if( pic )
+ {
free( pic->data );
- free( pic );
+ free( pic );
+ }
}
mediacontrol_PlaylistSeq*
-mediacontrol_PlaylistSeq__alloc( int size )
+private_mediacontrol_PlaylistSeq__alloc( int size )
{
mediacontrol_PlaylistSeq* ps;
int i;
for( i = 0 ; i < ps->size ; i++ )
free( ps->data[i] );
+ free( ps->data );
+ free( ps );
}
- free( ps->data );
- free( ps );
}
-/**
- * Initialize a VLC exception.
- *
- * If given a NULL pointer, it will instanciate a new exception, which
- * should be later freed by the caller. If given an existing
- * exception, it will reset its code and message fields. In both
- * cases, the exception pointer is returned.
- *
- * \param exception a pointer on a mediacontrol_Exception
- * \return a pointer on a mediacontrol_Exception.
- */
+void
+mediacontrol_StreamInformation__free( mediacontrol_StreamInformation* p_si )
+{
+ if( p_si )
+ {
+ free( p_si->url );
+ free( p_si );
+ }
+}
+
+
mediacontrol_Exception*
+mediacontrol_exception_create( void )
+{
+ mediacontrol_Exception* exception;
+
+ exception = ( mediacontrol_Exception* )malloc( sizeof( mediacontrol_Exception ) );
+ mediacontrol_exception_init( exception );
+ return exception;
+}
+
+void
mediacontrol_exception_init( mediacontrol_Exception *exception )
{
- if( !exception )
+ if( exception )
{
- exception = ( mediacontrol_Exception* )malloc( sizeof( mediacontrol_Exception ) );
- if( !exception )
- {
- return NULL;
- }
+ exception->code = 0;
+ exception->message = NULL;
}
- exception->code = 0;
- exception->message = NULL;
- return exception;
}
void
}
mediacontrol_RGBPicture*
-_mediacontrol_createRGBPicture( int i_width, int i_height, long i_chroma, vlc_int64_t l_date,
+private_mediacontrol_createRGBPicture( int i_width, int i_height, long i_chroma, vlc_int64_t l_date,
char* p_data, int i_datasize )
{
mediacontrol_RGBPicture *retval;
- retval = mediacontrol_RGBPicture__alloc( i_datasize );
+ retval = private_mediacontrol_RGBPicture__alloc( i_datasize );
if( retval )
{
retval->width = i_width;