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");
    }
     
  • 相关阅读:
    Java四种内部类
    Java多态详解
    为啥java要使用 set ()和get()方法---封装
    Python---django轻量级框架
    java 读取数据库数据转化输出XML输出在jsp页面
    操作系统专栏
    learn more ,study less(三):超越整体性学习
    learn more ,study less(二):整体性学习技术(下)
    learn more ,study less(二):整体性学习技术(上)
    Spring博客专栏
  • 原文地址:https://www.cnblogs.com/qq78292959/p/2077002.html
Copyright © 2011-2022 走看看