![]() |
![]() |
Data Structures | |
struct | Loader_Attrs |
Attributes used to create a Loader. More... | |
Typedefs | |
typedef struct Loader_Object * | Loader_Handle |
Handle through which to reference a Loader. | |
Functions | |
Loader_Handle | Loader_create (Char *fileName, Loader_Attrs *attrs) |
Creates a Loader. | |
Int | Loader_prime (Loader_Handle hLoader, Buffer_Handle *hBufPtr) |
Prime the loader and obtain the first frame. | |
Int | Loader_readData (Loader_Handle hLoader) |
Read more data in to the ring buffer. This call should be used when the Loader module works in asynchronous mode (. | |
Int | Loader_getFrame (Loader_Handle hLoader, Buffer_Handle hBuf) |
Load the next frame. | |
Int | Loader_flush (Loader_Handle hLoader) |
Tells the thread calling Loader_readData that it should quit. If the Loader is not used in async mode this call has no effect. | |
Int | Loader_delete (Loader_Handle hLoader) |
Deletes a Loader. | |
Variables | |
const Loader_Attrs | Loader_Attrs_DEFAULT |
Default attributes for a Loader. |
#include <xdc/std.h> #include <ti/sdo/dmai/Dmai.h> #include <ti/sdo/dmai/Buffer.h> #include <ti/sdo/dmai/Loader.h> Loader_Attrs lAttrs = Loader_Attrs_DEFAULT; Loader_Handle hLoader; Buffer_Handle hBuf; Dmai_init(); hLoader = Loader_create("myfile.m2v", &lAttrs); Loader_prime(hLoader, &hBuf); while (1) { // Call Vdec or Vdec2 to decode the elementary stream. Loader_getFrame(hLoader, hBuf); if (Buffer_getUserPtr(hBuf) == NULL) { // There is no more data to read, terminate. break; } } Loader_delete(hLoader);
typedef struct Loader_Object* Loader_Handle |
Handle through which to reference a Loader.
Loader_Handle Loader_create | ( | Char * | fileName, | |
Loader_Attrs * | attrs | |||
) |
Creates a Loader.
[in] | fileName | Name of the file to load data from. |
[in] | attrs | Loader_Attrs to use for creating the Loader. |
Handle | for use in subsequent operations (see Loader_Attrs). | |
NULL | for failure. |
Int Loader_prime | ( | Loader_Handle | hLoader, | |
Buffer_Handle * | hBufPtr | |||
) |
Prime the loader and obtain the first frame.
[in] | hLoader | The Loader_Handle to prime. |
[out] | hBufPtr | The buffer containing an encoded frame will be returned in this Buffer_Handle. |
Dmai_EOK | for success. | |
Negative value | for failure, see Dmai.h. |
Int Loader_readData | ( | Loader_Handle | hLoader | ) |
Read more data in to the ring buffer. This call should be used when the Loader module works in asynchronous mode (.
[in] | hLoader | The Loader_Handle to read data for. |
Dmai_EOK | for success. | |
Dmai_EEOF | if end of file was encountered. | |
Negative value | for failure, see Dmai.h. |
This function should not be used in synchronous mode (see Loader_Attrs.async).
Int Loader_getFrame | ( | Loader_Handle | hLoader, | |
Buffer_Handle | hBuf | |||
) |
Load the next frame.
[in] | hLoader | The Loader_Handle to load from. |
[in] | hBuf | The Buffer_Handle of the buffer previously returned by Loader_prime. The bytes used set by Buffer_setNumBytesUsed and obtained using Buffer_getNumBytesUsed should be previously updated by the decoder, e.g. using a Vdec2_process call. When no more data is available (end of file) the Buffer_getUserPtr call will return NULL for this buffer and the function will return Dmai_EEOF. |
Dmai_EOK | for success. | |
Dmai_EEOF | if end of file was encountered. | |
Negative value | for failure, see Dmai.h. |
Loader_prime must be called before this function.
Int Loader_flush | ( | Loader_Handle | hLoader | ) |
Tells the thread calling Loader_readData that it should quit. If the Loader is not used in async mode this call has no effect.
[in] | hLoader | The Loader_Handle to force. |
Dmai_EOK | for success. | |
Negative value | for failure, see Dmai.h. |
Loader_delete should be called after this function, the Loader instance cannot be used with other API calls after this.
This function should be called from the thread calling Loader_getFrame and not the thread calling Loader_readData.
Int Loader_delete | ( | Loader_Handle | hLoader | ) |
Deletes a Loader.
[in] | hLoader | The Loader_Handle to delete. |
Dmai_EOK | for success. | |
Negative value | for failure, see Dmai.h. |
Default attributes for a Loader.
readBufSize = 3 * 1024 * 1024, readSize = 720 * 576 * 2 readAhead = 0 vBufSize = 0 async = FALSE