Changes

Davinci Multimedia Application Interface

98 bytes added, 13:13, 14 May 2012
m
Benefits of Using DMAI
== Benefits of Using DMAI ==* Portability and Reusability** For example [https://gstreamer.ti.com/gf/project/gstreamer_ti/ The TI GStreamer plugin] is built on top of DMAI. It made porting the TI GStreamer plugin to new platforms easier.* Consistent software interface** The DMAI library provides a simple software interface, but implements complex device driver and codec engine handshaking under the hood: -*** Uses hardware acceleration where possible without requiring developers to understand the platform specific implementation.*** Enables all VISA codecs, reducing the need to understand details and differences of xDM versions.*** Abstracts PSP differences (FBDEV vs. V4L2).*** Low-level details and error handling are managed for you.* Using DMAI, plugin code is mostly free of platform-specific code, making it extremely portable.
*Portability and Reusability
**For example [[DMAI_GStreamer_Plug-In|The TI GStreamer plugin]] is built on top of DMAI. It made porting the TI GStreamer plugin to new platforms easier.
*Consistent software interface
**The DMAI library provides a simple software interface, but implements complex device driver and codec engine handshaking under the hood: -
***Uses hardware acceleration where possible without requiring developers to understand the platform specific implementation.
***Enables all VISA codecs, reducing the need to understand details and differences of xDM versions.
***Abstracts PSP differences (FBDEV vs. V4L2).
***Low-level details and error handling are managed for you.
*Using DMAI, plugin code is mostly free of platform-specific code, making it extremely portable.
== Example ==
Below is a simple DMAI example showing audio decode using an AAC decoder and the Codec Engine (no error checking). Input is an elementary stream file and output is the sound device driver:<code lang="c"></code>
<code lang='c'>{ #include <&lt;xdc/std.h>&gt; #include <&lt;ti/sdo/ce/Engine.h>&gt; #include <&lt;ti/sdo/ce/CERuntime.h>&gt; #include <&lt;ti/sdo/dmai/Dmai.h>&gt; #include <&lt;ti/sdo/dmai/Buffer.h>&gt; #include <&lt;ti/sdo/dmai/Sound.h>&gt; #include <&lt;ti/sdo/dmai/Loader.h>&gt; #include <&lt;ti/sdo/dmai/ce/Adec.h>&gt;
Adec_Handle hAd;
Loader_Handle hLoader;
Buffer_Handle hOutBuf, hInBuf;
Engine_Handle hEngine;
Sound_Handle hSound;
AUDDEC_Params params = Adec_Params_DEFAULT;
AUDDEC_DynamicParams dynParams = Adec_DynamicParams_DEFAULT;
Loader_Attrs lAttrs = Loader_Attrs_DEFAULT;
Buffer_Attrs bAttrs = Buffer_Attrs_DEFAULT;
Sound_Attrs sAttrs = Sound_Attrs_STEREO_DEFAULT;
CERuntime_init();
Dmai_init();
hSound = Sound_create(&amp;sAttrs);
hEngine = Engine_open("myengine", NULL, NULL);
hAd = Adec_create(hEngine, "aacdec", &amp;params, &amp;dynParams); hOutBuf = Buffer_create(Adec_getOutBufSize(hAd), &amp;bAttrs);
lAttrs.readSize = Adec_getInBufSize(hAd);
lAttrs.readBufSize = lAttrs.readSize * 2;
hLoader = Loader_create("myfile.aac", &amp;lAttrs); Loader_prime(hLoader, &amp;hInBuf);
while (1) {
Adec_process(hAd, hInBuf, hOutBuf);
Loader_getFrame(hLoader, hInBuf);
if (Buffer_getUserPtr(hInBuf) == NULL) break;
}
Loader_delete(hLoader);
Buffer_delete(hOutBuf);
Engine_close(hEngine);
Sound_delete(hSound);
}
</code>
==Versions==
DMAI is now hosted as an open source project on [https://gforge.ti.com/gf/project/dmai the TI GForge site]. Here you can join the project (see red button on the right) in order to [https://gforge.ti.com/gf/project/dmai/tracker/?action=TrackerItemBrowse&tracker_id=98 track and file issues]. The DMAI releases are available from [https://gforge.ti.com/gf/project/dmai/frs/?action=FrsReleaseBrowse&frs_package_id=31 here].
[[Category:Codec EngineGstreamer|Davinci]][[Category:Software applications]]
0
edits