MHEG5
15.3.0
|
00001 /******************************************************************************* 00002 * Copyright © 2014 The DTVKit Open Software Foundation Ltd (www.dtvkit.org) 00003 * Copyright © 2010 Ocean Blue Software Ltd 00004 * 00005 * This file is part of a DTVKit Software Component 00006 * You are permitted to copy, modify or distribute this file subject to the terms 00007 * of the DTVKit 1.0 Licence which can be found in licence.txt or at www.dtvkit.org 00008 * 00009 * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, 00010 * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES 00011 * OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. 00012 * 00013 * If you or your organisation is not a member of DTVKit then you have access 00014 * to this source code outside of the terms of the licence agreement 00015 * and you are expected to delete this and any associated files immediately. 00016 * Further information on DTVKit, membership and terms can be found at www.dtvkit.org 00017 *******************************************************************************/ 00025 #ifndef _STMR_QUEUE_H_ 00026 #define _STMR_QUEUE_H_ 00027 00028 /*---includes for this file--------------------------------------------------*/ 00029 00030 #include "techtype.h" 00031 #include "mherrors.h" 00032 #include "stmr_util.h" 00033 00034 /*---Constant and macro definitions for public use---------------------------*/ 00035 00036 /*---Enumerations for public use---------------------------------------------*/ 00037 00038 /*---Global type defs for public use-----------------------------------------*/ 00039 00040 typedef enum 00041 { 00042 QUEUE_EVENT_ITEM_INSERTED, 00043 QUEUE_EVENT_ITEM_RELEASED 00044 } MHEG5QueueEvent_t; 00045 00046 typedef struct sMHEG5QueueItem 00047 { 00048 struct sMHEG5QueueItem *next; 00049 U32BIT requestId; 00050 U32BIT downloadId; 00051 U8BIT *data; 00052 U32BIT len; 00053 U32BIT offset; 00054 U64BIT position; 00055 U64BIT base; 00056 U32BIT timestamp; 00057 BOOLEAN last; 00058 U16BIT referenceCount; 00059 } MHEG5QueueItem; 00060 00061 /*---Global variable declarations for public use-----------------------------*/ 00062 00063 /*---Global Function prototypes for public use-------------------------------*/ 00064 00065 00072 E_MhegErr MHEG5QueueInit(U8BIT *buffer, U32BIT bufferSize); 00073 00074 00082 MHEG5QueueItem* MHEG5QueueAllocItem(U32BIT requestId, U32BIT len); 00083 00084 00090 void MHEG5QueueInsertItem(MHEG5QueueItem *item); 00091 00092 00099 MHEG5QueueItem* MHEG5QueueGetHeadItem(void); 00100 00101 00108 BOOLEAN MHEG5QueueIsValidItem(MHEG5QueueItem *item); 00109 00110 00121 void MHEG5QueueUpdateItem(MHEG5QueueItem *item, U32BIT processed); 00122 00123 00131 void MHEG5QueueReleaseItem(MHEG5QueueItem *item); 00132 00133 00138 U32BIT MHEG5QueueGetBufferedBytes(void); 00139 00140 00146 void MHEG5QueueEnableStreaming(U32BIT requestId); 00147 00148 00153 void MHEG5QueueDisableStreaming(void); 00154 00155 00160 BOOLEAN MHEG5QueueIsStreamingEnabled(void); 00161 00162 00168 void MHEG5QueueReleaseRequestItems(U32BIT requestId); 00169 00170 00175 void MHEG5QueueReleaseAllItems(void); 00176 00177 00184 void MHEG5QueueRegisterInsertCallback(void (*callback)(U32BIT downloadId, 00185 U64BIT base, 00186 U64BIT position, 00187 U32BIT len, 00188 BOOLEAN last)); 00189 00190 00197 void MHEG5QueueRegisterReleaseCallback(void (*callback)(U32BIT requestId, 00198 U64BIT base, 00199 U64BIT position, 00200 U32BIT len, 00201 BOOLEAN last)); 00202 00203 00208 void MHEG5QueueTerm(void); 00209 00210 00211 #endif /*_STMR_QUEUE_H*/