zoukankan      html  css  js  c++  java
  • 添加VLC模块

    64 How to add a module 
    65 ------------------- 
    66  
    67 To add a module to the repository, just add its sources to a Modules.am 
    68 file. If you add a new directory you will need to create a new Modules.am, 
    69 inside that directory. Do not forget to add a corresponding 
    70 Makefile line at the end of configure.ac for this new Modules.am file. 
    71  
    72 To have the module built, you need to add a call to VLC_ADD_PLUGIN or 
    73 VLC_ADD_BUILTINS to configure.ac with your new module name as argument. 
    74 Look at other modules for guidelines on how to add build and linkage options. 
    75  
    76 After changing configure.ac you will always need to rerun bootstrap and  
    77 configure. 
    78  
    79 VLC keeps a cache of its modules (in ~/.cache/vlc/ on Linux), so you'll have to 
    80 delete it (or use vlc --reset-plugins-cache). Then use vlc -vvv --color --list 
    81 to check that your plugin is seen by VLC.
     
    VLC提供的模块说明如上图。下面分别讲解了如何添加模块目录和添加模块,源代码见最后。
     
    一、添加“模块目录。
    (1) 在Modules目录下新建MyModules子目录,加入“模块源代码”mymdule1.c
     
    (2) 添加Modules.am文件
        
    SOURCES_mymodule1 = mymodule1.c
    libvlc_LTLIBRARIES += \ 
      $(NULL)
    (3) 修改Modules/Makefile.am文件,添加MyModules子目录
    BASE_SUBDIRS = \ 
         .... 
         MyModules
    (4) 修改根目录下的configure.ac文件,添加模块,支持编译
    dnl 
    dnl    mymodules 
    dnl 
    VLC_ADD_PLUGIN([mymodule1])
    (4) 运行./bootstrap 
            ./configure**.sh  (自己定义的configure文件)
     
    二、添加“模块”
    例如:在Demux目录下添加MyModule1模块
    (1)  修改Demux目录下的Modules.am文件,增加1行
        
    SOURCES_mymodule1 = mymodule1.c

    (2) 复制MyModule1.c到Demux目录
     
    (3) 修改根目录下的configure.ac文件,添加模块,支持编译
    dnl 
    dnl    mymodules 
    dnl 
    VLC_ADD_PLUGIN([mymodule1])
    (4) 运行./bootstrap 
            ./configure**.sh  (自己定义的configure文件)
      
      
      
    附:MyModule1.c源代码:
    #ifdef HAVE_CONFIG_H
    # include
    "config.h"
    #endif


    #include
    <vlc_common.h>
    #include
    <vlc_plugin.h>


    /*****************************************************************************
    * Local prototypes.
    ****************************************************************************
    */

    static int Open ( vlc_object_t * );
    static void Close ( vlc_object_t * );

    /*****************************************************************************
    * Module descriptor
    ****************************************************************************
    */

    vlc_module_begin()
    add_shortcut(
    "testmodule" )
    set_description(
    "testmodle plug-in")
    set_callbacks( Open, Close )
    set_capability(
    "testing", 0 )
    set_category( CAT_INPUT )
    vlc_module_end ()


    /*****************************************************************************
    * Open: initialize interface
    ****************************************************************************
    */

    static int Open( vlc_object_t *p_this )
    {
    msg_Dbg(p_this,
    "Using test module...\n");
    return VLC_SUCCESS;
    }

    /*****************************************************************************
    * Close: destroy interface
    ****************************************************************************
    */

    static void Close( vlc_object_t *p_this )
    {
    msg_Dbg(p_this,
    "Close test module!\n");
    }
     
  • 相关阅读:
    Linux2.6内核epoll介绍
    使用Mongodb 做对象缓存
    SilverLight创建全能wav播放器
    ASP.NET MVC 巧用代码注释做权限控制以及后台导航
    贝叶斯文本分类c#版
    Windows 2003 iis6 网站打不开,无法显示该页 找不到服务器错误解决方案
    mvc 权限控制续——使用存储过程判断
    使用贝叶斯做英文拼写检查(c#)
    修改Visata下的无线网卡(Intel 5100 agn)Mac地址
    银杏黄ARM项目总结
  • 原文地址:https://www.cnblogs.com/qq78292959/p/2077002.html
Copyright © 2011-2022 走看看