vlc代码分析(3)——输入模块

Posted on 2006-12-24 21:37  Teddy Yan  阅读(199)  评论(0编辑  收藏  举报

输入模块的Code Path,看来主要的分析还是在demux和access模块的分析。现在的code path只是大致的模块

input_CreateThread2 --->  Create()  ---->Run()  ---->Init() 
vlm.c                     input.c        input.c     input.c                  

---->input_EsOutNew()
       input.c

---->[1]InputSourceInit
       input.c
    1)-->demux2_New --->__demux2_New -->module_Need( p_demux, "access_demux", psz_module)
                    Demux.c
   
    2)(input_source_t *in)->p_demux = demux2_New()

    3) /* Get infos from access_demux */
        demux2_Control( in->p_demux,
                        DEMUX_GET_PTS_DELAY, &i_pts_delay );

    ---->InputSourceInit (Can't get demux directly)
    1)-->access2_New --->access2_InternalNew -->module_Need( p_access, "access_filter", psz_access, VLC_FALSE );
               Access.c
    2)-->access2_FilterNew --->access2_InternalNew -->module_Need( p_access, "access_filter", psz_access, VLC_FALSE );

    3) /* Get infos from access */

    4)-->stream_AccessNew()

    5)-->demux2_New()

---->[2]
1)set variant about the input
2)/* Start title/chapter */
        input_ControlPush( p_input, INPUT_CONTROL_SET_TITLE, &val );
              Input_internal.h
3)/* Load subtitles */
  /* Get fps and set it if not already set */
            var_Create( p_input, "sub-original-fps", VLC_VAR_FLOAT );
            var_SetFloat( p_input, "sub-original-fps", f_fps );
4)/* Look for and add subtitle files */
sub = InputSourceNew( p_input );
            if( !InputSourceInit( p_input, sub, psz_subtitle, "subtitle",
                                  VLC_FALSE ) )

5)/* Look for slave */
slave = InputSourceNew( p_input );
                if( !InputSourceInit( p_input, slave, psz, NULL, VLC_FALSE ) )

6) /* Set up es_out */
es_out_Control( p_input->p_es_out, ES_OUT_SET_ACTIVE, VLC_TRUE );

---> MainLoop()
while( !p_input->b_die && !p_input->b_error && !p_input->input.b_eof )
{
  if( p_input->input.b_title_demux &&
                    p_input->input.p_demux->info.i_update )
                {
                    i_ret = UpdateFromDemux( p_input );
                    b_force_update = VLC_TRUE;
                }
                else if( !p_input->input.b_title_demux &&
                          p_input->input.p_access &&
                          p_input->input.p_access->info.i_update )
                {
                    i_ret = UpdateFromAccess( p_input );
                    b_force_update = VLC_TRUE;
                }
}

/* We have finish to demux data but not to play them */

--->End () 

Copyright © 2024 Teddy Yan
Powered by .NET 9.0 on Kubernetes