static int Send( sout_stream_t *p_stream, sout_stream_id_sys_t *id, block_t *p_buffer ) { sout_stream_sys_t *p_sys = p_stream->p_sys; block_t *p_out = NULL; if( !id->b_transcode ) { if( id->id ) return sout_StreamIdSend( p_stream->p_next, id->id, p_buffer ); block_Release( p_buffer ); return VLC_EGENERIC; } switch( id->p_decoder->fmt_in.i_cat ) { case AUDIO_ES: if( transcode_audio_process( p_stream, id, p_buffer, &p_out ) != VLC_SUCCESS ) { return VLC_EGENERIC; } break; case VIDEO_ES: if( transcode_video_process( p_stream, id, p_buffer, &p_out ) != VLC_SUCCESS ) { return VLC_EGENERIC; } break; case SPU_ES: /* Transcode OSD menu pictures. */ if( p_sys->b_osd ) { if( transcode_osd_process( p_stream, id, p_buffer, &p_out ) != VLC_SUCCESS ) { return VLC_EGENERIC; } } else if ( transcode_spu_process( p_stream, id, p_buffer, &p_out ) != VLC_SUCCESS ) { return VLC_EGENERIC; } break; default: p_out = NULL; block_Release( p_buffer ); break; } if( p_out ) return sout_StreamIdSend( p_stream->p_next, id->id, p_out ); return VLC_SUCCESS; }
static int Send(sout_stream_t *stream, sout_stream_id_sys_t *id, block_t *block) { sout_stream_sys_t *sys = stream->p_sys; for (block_t *next = block->p_next; block != NULL; block = next) { block->p_next = NULL; /* FIXME: deal with key frames properly */ while (sys->clock(block) >= sys->next->offset) { DelStream(stream); AddStream(stream, sys->next->chain); sys->next->offset += sys->period; sys->next = sys->next->next; if (sys->next == NULL) sys->next = sys->start; } if (sys->stream != NULL) sout_StreamIdSend(sys->stream, id->id, block); else block_Release(block); } return VLC_SUCCESS; }
static int Send(sout_stream_t *p_stream, sout_stream_id_sys_t *id, block_t *p_buffer) { sout_stream_sys_t *p_sys = p_stream->p_sys; return sout_StreamIdSend(p_sys->p_out, id, p_buffer); }
/***************************************************************************** * Send: *****************************************************************************/ static int Send( sout_stream_t *p_stream, sout_stream_id_sys_t *id, block_t *p_buffer ) { if ( id->b_streamswap ) { id->b_streamswap = false; p_buffer->i_flags |= BLOCK_FLAG_DISCONTINUITY; } return sout_StreamIdSend( p_stream->p_next, id->id, p_buffer ); }
static int Send(sout_stream_t *p_stream, sout_stream_id_sys_t *id, block_t *p_buffer) { sout_stream_sys_t *p_sys = p_stream->p_sys; id = p_sys->GetSubId( p_stream, id ); if ( id == NULL ) return VLC_EGENERIC; return sout_StreamIdSend(p_sys->p_out, id, p_buffer); }
/***************************************************************************** * Send: *****************************************************************************/ static int Send( sout_stream_t *p_stream, sout_stream_id_sys_t *id, block_t *p_buffer ) { sout_stream_sys_t *p_sys = p_stream->p_sys; sout_stream_t *p_dup_stream; int i_stream; /* Loop through the linked list of buffers */ while( p_buffer ) { block_t *p_next = p_buffer->p_next; p_buffer->p_next = NULL; for( i_stream = 0; i_stream < p_sys->i_nb_streams - 1; i_stream++ ) { p_dup_stream = p_sys->pp_streams[i_stream]; if( id->pp_ids[i_stream] ) { block_t *p_dup = block_Duplicate( p_buffer ); if( p_dup ) sout_StreamIdSend( p_dup_stream, id->pp_ids[i_stream], p_dup ); } } if( i_stream < p_sys->i_nb_streams && id->pp_ids[i_stream] ) { p_dup_stream = p_sys->pp_streams[i_stream]; sout_StreamIdSend( p_dup_stream, id->pp_ids[i_stream], p_buffer ); } else { block_Release( p_buffer ); } p_buffer = p_next; } return VLC_SUCCESS; }
static int Send( sout_stream_t *p_stream, void *_id, block_t *p_buffer ) { sout_stream_sys_t *p_sys = (sout_stream_sys_t *)p_stream->p_sys; sout_stream_id_sys_t *id = (sout_stream_id_sys_t *)_id; struct md5_s hash; block_t *p_block = p_buffer; while ( p_block != NULL ) { InitMD5( &hash ); AddMD5( &hash, p_block->p_buffer, p_block->i_buffer ); AddMD5( &id->hash, p_block->p_buffer, p_block->i_buffer ); EndMD5( &hash ); char *outputhash = psz_md5_hash( &hash ); /* We could just set p_sys->output to stdout and remove user of msg_Dbg * if we don't need ability to output info to gui modules (like qt messages window */ vlc_tick_t dts_difference = VLC_TICK_INVALID; if( likely( id->previous_dts != VLC_TICK_INVALID ) ) dts_difference = p_block->i_dts - id->previous_dts; if( p_sys->output ) { /* Write data in a form that it's easy to plot for example with gnuplot*/ fprintf( p_sys->output, "%s\t%d\t%s\t%"PRIu64"\t%"PRId64"\t%"PRId64"\t%16s\n", p_sys->prefix, id->id, id->type, ++id->segment_number, dts_difference, p_block->i_length, outputhash ); } else { msg_Dbg( p_stream, "%s: track:%d type:%s segment_number:%"PRIu64" dts_difference:%"PRId64" length:%"PRId64" md5:%16s", p_sys->prefix, id->id, id->type, ++id->segment_number, dts_difference, p_block->i_length, outputhash ); } id->track_duration += p_block->i_length ? p_block->i_length : dts_difference; free( outputhash ); id->previous_dts = p_block->i_dts; p_block = p_block->p_next; } if( p_stream->p_next ) return sout_StreamIdSend( p_stream->p_next, id->next_id, p_buffer ); else block_Release( p_buffer ); return VLC_SUCCESS; }
static void OutputSend( sout_stream_t *p_stream, sout_stream_id_t *id, block_t *p_block ) { sout_stream_sys_t *p_sys = p_stream->p_sys; if( id->id ) { /* We wait until the first key frame (if needed) and * to be beyong i_dts_start (for stream without key frame) */ if( id->b_wait_key ) { if( p_block->i_flags & BLOCK_FLAG_TYPE_I ) { id->b_wait_key = false; id->b_wait_start = false; } if( ( p_block->i_flags & BLOCK_FLAG_TYPE_MASK ) == 0 ) id->b_wait_key = false; } if( id->b_wait_start ) { if( p_block->i_dts >=p_sys->i_dts_start ) id->b_wait_start = false; } if( id->b_wait_key || id->b_wait_start ) block_ChainRelease( p_block ); else sout_StreamIdSend( p_sys->p_out, id->id, p_block ); } else if( p_sys->b_drop ) { block_ChainRelease( p_block ); } else { size_t i_size; block_ChainProperties( p_block, NULL, &i_size, NULL ); p_sys->i_size += i_size; block_ChainLastAppend( &id->pp_last, p_block ); } }