/*****************************************************************************
* nuv.c:
*****************************************************************************
- * Copyright (C) 2005 VideoLAN
- * $Id: $
+ * Copyright (C) 2005 the VideoLAN team
+ * $Id$
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
/*****************************************************************************
* Preamble
*****************************************************************************/
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
#include <vlc/vlc.h>
-#include <vlc/input.h>
+#include <vlc_plugin.h>
+#include <vlc_demux.h>
/* TODO:
* - complete support (add support for rtjpeg and raw)
vlc_module_begin();
set_category( CAT_INPUT );
set_subcategory( SUBCAT_INPUT_DEMUX );
- set_description( _("Nuv demuxer") );
- set_capability( "demux2", 145 );
+ set_description( N_("Nuv demuxer") );
+ set_capability( "demux", 145 );
set_callbacks( Open, Close );
add_shortcut( "nuv" );
vlc_module_end();
{
demux_t *p_demux = (demux_t*)p_this;
demux_sys_t *p_sys;
- uint8_t *p_peek;
+ const uint8_t *p_peek;
frame_header_t fh;
- vlc_bool_t b_extended;
+ bool b_extended;
/* Check id */
if( stream_Peek( p_demux->s, &p_peek, 12 ) != 12 ||
- ( strncmp( p_peek, "MythTVVideo", 11 ) &&
- strncmp( p_peek, "NuppelVideo", 11 ) ) )
+ ( strncmp( (char *)p_peek, "MythTVVideo", 11 ) &&
+ strncmp( (char *)p_peek, "NuppelVideo", 11 ) ) )
return VLC_EGENERIC;
p_sys = malloc( sizeof( demux_sys_t ) );
else
{
/* TODO handle rtjpeg */
- msg_Warn( p_demux, "unsuported 'D' frame (c=%c)", fh.i_compression );
+ msg_Warn( p_demux, "unsupported 'D' frame (c=%c)", fh.i_compression );
if( stream_Read( p_demux->s, NULL, fh.i_length ) != fh.i_length )
goto error;
}
goto error;
if( p_peek[0] == 'X' )
{
- b_extended = VLC_TRUE;
+ b_extended = true;
if( FrameHeaderLoad( p_demux, &fh ) )
goto error;
}
else
{
- b_extended = VLC_FALSE;
+ b_extended = false;
/* XXX: for now only file with extended chunk are supported
* why: because else we need to have support for rtjpeg+stupid nuv shit */
demux_t *p_demux = (demux_t*)p_this;
demux_sys_t *p_sys = p_demux->p_sys;
- if( p_sys->p_extra_f )
- free( p_sys->p_extra_f );
+ free( p_sys->p_extra_f );
demux_IndexClean( &p_sys->idx );
free( p_sys );
}
}
static void demux_IndexClean( demux_index_t *p_idx )
{
- if( p_idx->idx )
- {
- free( p_idx->idx );
- p_idx->idx = NULL;
- }
+ free( p_idx->idx );
+ p_idx->idx = NULL;
}
static void demux_IndexAppend( demux_index_t *p_idx,
int64_t i_time, int64_t i_offset )