#include "chapter_command.hpp"
-
void chapter_codec_cmds_c::AddCommand( const KaxChapterProcessCommand & command )
{
- size_t i;
-
uint32 codec_time = uint32(-1);
- for( i = 0; i < command.ListSize(); i++ )
+ for( size_t i = 0; i < command.ListSize(); i++ )
{
const EbmlElement *k = command[i];
}
}
- for( i = 0; i < command.ListSize(); i++ )
+ for( size_t i = 0; i < command.ListSize(); i++ )
{
const EbmlElement *k = command[i];
if ( !b_test_positive )
return false;
}
-
+
// strip the test command
i_command &= 0xFF0F;
-
+
switch ( i_command )
{
case CMD_DVD_NOP:
case CMD_DVD_SET_GPRMMD:
{
msg_Dbg( &sys.demuxer, "Set GPRMMD [%d]=%d", (p_command[4] << 8) + p_command[5], (p_command[2] << 8) + p_command[3]);
-
+
if ( !SetGPRM( (p_command[4] << 8) + p_command[5], (p_command[2] << 8) + p_command[3] ) )
msg_Dbg( &sys.demuxer, "Set GPRMMD failed" );
break;
case CMD_DVD_LINKPGCN:
{
uint16 i_pgcn = (p_command[6] << 8) + p_command[7];
-
+
msg_Dbg( &sys.demuxer, "Link PGCN(%d)", i_pgcn );
p_chapter = sys.p_current_segment->BrowseCodecPrivate( 1, MatchPgcNumber, &i_pgcn, 2 );
if ( p_chapter != NULL )
case CMD_DVD_LINKCN:
{
uint8 i_cn = p_command[7];
-
+
p_chapter = sys.p_current_segment->CurrentChapter();
msg_Dbg( &sys.demuxer, "LinkCN (cell %d)", i_cn );
{
if ( i_cookie_size != 2 || data.p_private_data == NULL || data.p_private_data->GetSize() < 4 )
return false;
-
+
if ( data.p_private_data->GetBuffer()[0] != MATROSKA_DVD_LEVEL_SS || data.p_private_data->GetBuffer()[1] != 0x80 )
return false;
{
if ( i_cookie_size != 1 || data.p_private_data == NULL || data.p_private_data->GetSize() < 4 )
return false;
-
+
if ( data.p_private_data->GetBuffer()[0] != MATROSKA_DVD_LEVEL_SS || data.p_private_data->GetBuffer()[1] != 0x40 )
return false;
{
if ( i_cookie_size != 1 || data.p_private_data == NULL || data.p_private_data->GetSize() < 4 )
return false;
-
+
if ( data.p_private_data->GetBuffer()[0] != MATROSKA_DVD_LEVEL_TT )
return false;
{
if ( i_cookie_size != 1 || data.p_private_data == NULL || data.p_private_data->GetSize() < 8 )
return false;
-
+
if ( data.p_private_data->GetBuffer()[0] != MATROSKA_DVD_LEVEL_PGC )
return false;
{
if ( i_cookie_size != 2 || data.p_private_data == NULL || data.p_private_data->GetSize() < 8 )
return false;
-
+
if ( data.p_private_data->GetBuffer()[0] != MATROSKA_DVD_LEVEL_PGC )
return false;
{
if ( i_cookie_size != 1 || data.p_private_data == NULL || data.p_private_data->GetSize() < 2 )
return false;
-
+
if ( data.p_private_data->GetBuffer()[0] != MATROSKA_DVD_LEVEL_PTT )
return false;
{
if ( i_cookie_size != 1 || data.p_private_data == NULL || data.p_private_data->GetSize() < 5 )
return false;
-
+
if ( data.p_private_data->GetBuffer()[0] != MATROSKA_DVD_LEVEL_CN )
return false;
,i_codec_id( codec_id )
,sys( demuxer )
{}
-
+
virtual ~chapter_codec_cmds_c()
{
delete p_private_data;
}
void AddCommand( const KaxChapterProcessCommand & command );
-
+
/// \return wether the codec has seeked in the files or not
virtual bool Enter() { return false; }
virtual bool Leave() { return false; }
p_PRMs[ 0x80 + 16 ] = 0xFFFFu;
p_PRMs[ 0x80 + 18 ] = 0xFFFFu;
}
-
+
bool Interpret( const binary * p_command, size_t i_size = 8 );
-
+
uint16 GetPRM( size_t index ) const
{
if ( index < 256 )
}
return false;
}
-
+
bool SetGPRM( size_t index, uint16 value )
{
if ( index < 16 )
uint16 p_PRMs[256];
demux_sys_t & sys;
-
+
// DVD command IDs
// Tests
static const uint16 CMD_DVD_IF_GPREG_SUP = (5 << 4);
static const uint16 CMD_DVD_IF_GPREG_INF_EQUAL = (6 << 4);
static const uint16 CMD_DVD_IF_GPREG_INF = (7 << 4);
-
+
static const uint16 CMD_DVD_NOP = 0x0000;
static const uint16 CMD_DVD_GOTO_LINE = 0x0001;
static const uint16 CMD_DVD_BREAK = 0x0002;
static const uint16 CMD_DVD_MULT_GPREG = 0x7500;
static const uint16 CMD_DVD_GPREG_DIV_VALUE = 0x7600;
static const uint16 CMD_DVD_GPREG_AND_VALUE = 0x7900;
-
+
// callbacks when browsing inside CodecPrivate
static bool MatchIsDomain ( const chapter_codec_cmds_c &data, const void *p_cookie, size_t i_cookie_size );
static bool MatchIsVMG ( const chapter_codec_cmds_c &data, const void *p_cookie, size_t i_cookie_size );
{}
bool Interpret( const binary * p_command, size_t i_size );
-
+
// DVD command IDs
static const std::string CMD_MS_GOTO_AND_PLAY;
-
+
protected:
demux_sys_t & sys;
};
/*****************************************************************************
* mkv.cpp : matroska demuxer
*****************************************************************************
- * Copyright (C) 2003-2004 the VideoLAN team
+ * Copyright (C) 2003-2010 the VideoLAN team
* $Id$
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
#undef idx
}
-
bool matroska_segment_c::PreloadFamily( const matroska_segment_c & of_segment )
{
if ( b_preloaded )
}
}
-
int matroska_segment_c::BlockFindTrackIndex( size_t *pi_track,
const KaxBlock *p_block, const KaxSimpleBlock *p_simpleblock )
{
size_t i_track;
-
for( i_track = 0; i_track < tracks.size(); i_track++ )
{
const mkv_track_t *tk = tracks[i_track];
}
}
es_out_Control( sys.demuxer.out, ES_OUT_SET_NEXT_DISPLAY_TIME, i_start_time );
-
+
sys.i_start_pts = i_start_time;
// reset the stream reading to the first cluster of the segment used
es.I_O().setFilePointer( i_start_pos );
void matroska_segment_c::UnSelect( )
{
- size_t i_track;
-
- for( i_track = 0; i_track < tracks.size(); i_track++ )
+ for( size_t i_track = 0; i_track < tracks.size(); i_track++ )
{
if ( tracks[i_track]->p_es != NULL )
{
/*****************************************************************************
* mkv.cpp : matroska demuxer
*****************************************************************************
- * Copyright (C) 2003-2004 the VideoLAN team
+ * Copyright (C) 2003-2010 the VideoLAN team
* $Id$
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
va_list args;
if( i_level > 9 )
{
- msg_Err( &demuxer, "too deep tree" );
+ msg_Err( &demuxer, "MKV tree is too deep" );
return;
}
va_start( args, psz_format );
{
bool bSupported = true;
- mkv_track_t *tk;
-
- msg_Dbg( &sys.demuxer, "| | + Track Entry" );
-
- tk = new mkv_track_t();
-
/* Init the track */
+ mkv_track_t *tk = new mkv_track_t();
memset( tk, 0, sizeof( mkv_track_t ) );
es_format_Init( &tk->fmt, UNKNOWN_ES, 0 );
- tk->fmt.psz_language = strdup("English");
- tk->fmt.psz_description = NULL;
-
- tk->b_default = true;
- tk->b_enabled = true;
- tk->b_silent = false;
- tk->i_number = tracks.size() - 1;
- tk->i_extra_data = 0;
- tk->p_extra_data = NULL;
- tk->psz_codec = NULL;
- tk->b_dts_only = false;
- tk->i_default_duration = 0;
- tk->f_timecodescale = 1.0;
-
- tk->b_inited = false;
- tk->i_data_init = 0;
- tk->p_data_init = NULL;
-
- tk->psz_codec_name = NULL;
- tk->psz_codec_settings = NULL;
- tk->psz_codec_info_url = NULL;
+ tk->fmt.psz_language = strdup("English");
+ tk->fmt.psz_description = NULL;
+
+ tk->b_default = true;
+ tk->b_enabled = true;
+ tk->b_silent = false;
+ tk->i_number = tracks.size() - 1;
+ tk->i_extra_data = 0;
+ tk->p_extra_data = NULL;
+ tk->psz_codec = NULL;
+ tk->b_dts_only = false;
+ tk->i_default_duration = 0;
+ tk->f_timecodescale = 1.0;
+
+ tk->b_inited = false;
+ tk->i_data_init = 0;
+ tk->p_data_init = NULL;
+
+ tk->psz_codec_name = NULL;
+ tk->psz_codec_settings = NULL;
+ tk->psz_codec_info_url = NULL;
tk->psz_codec_download_url = NULL;
- tk->i_compression_type = MATROSKA_COMPRESSION_NONE;
- tk->p_compression_data = NULL;
+ tk->i_compression_type = MATROSKA_COMPRESSION_NONE;
+ tk->p_compression_data = NULL;
+
+ msg_Dbg( &sys.demuxer, "| | + Track Entry" );
for( size_t i = 0; i < m->ListSize(); i++ )
{
}
if( i_crop_left || i_crop_right || i_crop_top || i_crop_bottom )
{
- tk->fmt.video.i_visible_width = tk->fmt.video.i_width;
- tk->fmt.video.i_visible_height = tk->fmt.video.i_height;
- tk->fmt.video.i_x_offset = i_crop_left;
- tk->fmt.video.i_y_offset = i_crop_top;
- tk->fmt.video.i_visible_width -= i_crop_left + i_crop_right;
+ tk->fmt.video.i_visible_width = tk->fmt.video.i_width;
+ tk->fmt.video.i_visible_height = tk->fmt.video.i_height;
+ tk->fmt.video.i_x_offset = i_crop_left;
+ tk->fmt.video.i_y_offset = i_crop_top;
+ tk->fmt.video.i_visible_width -= i_crop_left + i_crop_right;
tk->fmt.video.i_visible_height -= i_crop_top + i_crop_bottom;
}
/* FIXME: i_display_* allows you to not only set DAR, but also a zoom factor.
/*****************************************************************************
* mkv.cpp : matroska demuxer
*****************************************************************************
- * Copyright (C) 2003-2004 the VideoLAN team
+ * Copyright (C) 2003-2005, 2008, 2010 the VideoLAN team
* $Id$
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
/*****************************************************************************
* mkv.cpp : matroska demuxer
*****************************************************************************
- * Copyright (C) 2003-2004 the VideoLAN team
+ * Copyright (C) 2003-2005, 2008 the VideoLAN team
* $Id$
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>