why separate the source code of a codec into two p

来源:互联网 发布:php strncmp 编辑:程序博客网 时间:2024/04/29 05:56
问题:opencore中的codec源码为何要分开?

opencorecodec的源码以部分在.../codecs_v2/{audio,video},一部分放在.../codecs_v2/omx_xxx,比如mp3codec源码,[1]一部分在.../codecs_v2/audio/mp3/dec目录下,[2]一部分在.../codecs_v2/omx_mp3
[1]编译生成libpvmp3.a
[2]编译生成libomx_mp3_component_lib.so

然后根据.../build_config/opencore_dynamic/android_omx_mp3dec_sharedlibrary.mk,把libpvmp3.alibomx_mp3_component_lib.so整合成libomx_mp3dec_sharedlibrary.so (当然还关联libomx_sharedlibrarylibopencore_common.so

这里不明白为什么要把源码分别放在两个地方?有什么标准或原则来分开的没?
还有对于一个新的codec,必须把源码拆分为类似的两部分?直接放在omx目录下,然后进行对应的接口注册不就可以了么?


why separate the source code of a codec into two parts in opencore?
hi, all! 
i'm now trying to integrate new codecs into opencore for android. there is some problems which puzzle me for the whole day.
take mp3 for example, some part of the source code is placed under directory .../codecs_v2/audio/mp3/dec, which would be compiled into a static library libpvmp3.a; the other part of source code is placed under directory .../codecs_v2/omx/omx_mp3, which would be compiled into a dynamic library libomx_mp3_component_lib.so.
and finally, according to the makefile .../build_config/opencore_dynamic/android_omx_mp3dec_sharedlibrary.mk, it would integrate the two library, libpvmp3.a and libomx_mp3_component_lib.so into one dynamic library: libomx_mp3dec_sharedlibrary.so, which would be found under /system/lib/ direcroty in a real device or an emulator.

my questions are: 
[1] why lay the codec's source code under two plaeces? and any guide line for the separation?
[2] to integrate a new codec into opencore, can i put the whole source code into a directory, and then finish the other registrations? any tips for this?
thanks in advance!!!

ps:
the links where i posted the questions:
[01-chinaunix@zh_CN]
http://linux.chinaunix.net/bbs/thread-1164510-1-1.html
[02-csdn@zh_CN]
http://topic.csdn.net/u/20100525/16/802187da-7fcf-4a8b-a7a5-5209ccc5127f.html?81382
[03-anddev@en]
http://www.anddev.org/multimedia-problems-f28/why-separate-a-codec-s-source-into-two-parts-t14452.html
[04-xda-dev@en]
http://forum.xda-developers.com/showthread.php?p=6588451#post6588451