DSMCC  17.9.0
 All Data Structures Files Functions Typedefs
cldsmcc.h
Go to the documentation of this file.
1 /*******************************************************************************
2  * Copyright © 2014 The DTVKit Open Software Foundation Ltd (www.dtvkit.org)
3  * Copyright © 2004 Ocean Blue Software Ltd
4  * Copyright © 2000 Koninklijke Philips Electronics N.V
5  *
6  * This file is part of a DTVKit Software Component
7  * You are permitted to copy, modify or distribute this file subject to the terms
8  * of the DTVKit 1.0 Licence which can be found in licence.txt or at www.dtvkit.org
9  *
10  * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
11  * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES
12  * OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
13  *
14  * If you or your organisation is not a member of DTVKit then you have access
15  * to this source code outside of the terms of the licence agreement
16  * and you are expected to delete this and any associated files immediately.
17  * Further information on DTVKit, membership and terms can be found at www.dtvkit.org
18  *******************************************************************************/
27 /*
28  * DVB DSM-CC Object Carousel Core Layer API
29  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
30  *
31  * OVERVIEW:
32  *
33  * This API has been specified in standard ANSI C and is designed as a completely
34  * OS and Platform (ie. HW and SW driver) independent interface to the core
35  * DSM-CC layer.
36  *
37  * To avoid confusion over the sizes of standard C types on different platforms, it
38  * assumes that a standard set of unambiguous type names have been defined to
39  * platform specific types in the file clDsmPlatformAPI.h (also standard
40  * definitions for TRUE/FALSE/Null). NB. This currently matches the recommended DVP
41  * coding standards.
42  *
43  *
44  * DSM-CC code conforming to this API should be readily portable to any platform
45  * and OS environment. It assumes that this environment (designated 'the
46  * calling environment') can provide the following:
47  *
48  * - Filtering of MPEG2 private sections from a single transport stream on multiple
49  * simultaneous PID values and section filter values.
50  *
51  * - Acquisition and parsing of PMT(s) for specified program stream, query/lookup
52  * of specific information from the SI data
53  *
54  * - Basic block memory allocation and de-allocation (at startup and shutdown)
55  *
56  * - Semaphore or queuing mechanisms for synchronising API calls initiated by
57  * asynchronously running tasks or threads
58  *
59  * - Queuing mechanisms, eg. for notifying clients of asynchronous object loads
60  *
61  * - Multiple timers (eg. 10mS resolution)
62  *
63  * - Dynamic (heap) memory management that conforms to the API specified in
64  * clDsmMemMgrApi.h
65  *
66  * NB. A non-fragmenting linked-block based memory manager that conforms to this
67  * API is supplied along with the DSM-CC core stack (clDsmMemMgrBlock.c).
68  *
69  *
70  * It is intended that all platform (and DSM-CC profile) specific functions
71  * including handling of multiple clients/apps (if required) are implemented in
72  * wrapper layers that call into this API. Only these layers should need to
73  * be modified when porting to a new platform (or DSM-CC profile).
74  *
75  *
76  * BASIC DATA FLOW AND LAYERS:
77  *
78  * +-----------+ +-----load/unload-----------------+
79  * | DEMUX & | DSM-CC | carousel |
80  * TS-->| section |---private------+ | |
81  * | filters | sections | | +--subscribe/unsubscribe--+ |
82  * +-----------+ | | | for stream event | |
83  * A | | | | |
84  * | | | | load/unload +---------------+
85  * +---add/delete-----+ | | | +-open/close--| CLIENT(s) |
86  * section filter | | | | | object +---------------+
87  * | | | | | A A A
88  * +---SI Query--+ | | | | | | | |
89  * | result | | V V V V | | |
90  * +----------------+ | +------------------------+ | | |
91  * SI->| SI (PAT/PMT) | +->| | object/ | | |
92  * | database | | |--carousel-+ | |
93  * +----------------+ +---| | loaded | |
94  * A | | | | |
95  * | | | Platform & Profile |--stream event--+ |
96  * +--SI Query--+ | (eg.MHEG/MHP) specific | |
97  * | 'porting' layer(s) | +-object data/info-+
98  * +--Trigger-->| | |
99  * +----------+ | | | |
100  * | Timers |--+ +-----| | |
101  * +----------+ | |------synchronous-------+-asynchronous-+
102  * A | |==============(clDsmAPI)===============|
103  * | | | |
104  * +---start/stop--+ | |
105  * | DSM-CC |
106  * | CORE (IP) LAYER |
107  * | |
108  * | |
109  * | |
110  * +-------------------/\------------------+
111  * +--------\/--------+
112  * | DSMCC DATA CACHE |
113  * +------------------+
114  *
115  *
116  * --------------------------------------------------------------------------------
117  */
118 #ifndef _DSMCC_H_
119 #define _DSMCC_H_
120 
121 /*---includes for this file--------------------------------------------------*/
122 #include "cldsmtypes.h"
123 #include "stdfuncs.h"
124 
125 #ifdef __cplusplus
126 extern "C" {
127 #endif
128 
129 
130 /*---Constant and macro definitions for public use---------------------------*/
131 
132 #define NUM_OPEN_DSM_OBJECTS_MAX 128
133 
134 #define DSMCC_MINIMUM_CACHE_SIZE (1024 * 1024 * 1)
135 #define DSMCC_DEFAULT_CACHE_SIZE (1024 * 1024 * 6)
136 
137 /* -- caching priority rules */
138 #define CACHE_RULES_DEFAULT 0x3F
139 #define CACHE_RULES_FROM_STREAM 0x00
140 #define CACHE_RULES_STATIC 0x80
141 
142 /* -- Progress codes */
143 #define CLDSM_PROG_CURR_SERVICE_CACHE_FULL 0
144 /* + ? */
145 
146 
147 /*---Enumerations for public use---------------------------------------------*/
148 
149 /*---Global type defs for public use-----------------------------------------*/
150 
151 /* E_CacheRules is like, and could be, an enum, with 8-bit values defined above */
152 typedef U8BIT E_CacheRules;
153 
154 /*
155 -- **** TIMER EVENT TYPES ***
156 */
157 
158 /* -- Timer event status -- */
159 typedef enum
160 {
161  TIMER_TRIGGERED = 0,
162  TIMER_ABORTED
163 } E_TimerStatus;
164 
165 
166 /*
167 -- **** OBJECT DATA TYPES ***
168 */
169 
170 typedef struct s_DsmObject *H_DsmObject;
171 
172 /* -- Object kind -- */
173 typedef enum
174 {
175  ANON_OBJ = 0,
176  FILE_OBJ,
177  DIRECTORY_OBJ,
178  SERVICE_GATEWAY_OBJ,
179  STREAM_OBJ,
180  STREAM_OBJ_WITH_EVENTS,
181  LINK_TO_ALTERNATE_OC_OBJ
182 } E_DsmObjectKind;
183 
184 
185 /*
186 -- Status type for object load
187 */
188 typedef enum
189 {
190  /*0*/ OBJ_LOAD_UNINITIATED = 0,
191  /*1*/ OBJ_LOAD_IN_PROGRESS,
192  /*2*/ OBJ_LOAD_COMPLETED,
193  /*3*/ OBJ_LOAD_ABORTED_TIMEOUT,
194  /*4*/ OBJ_LOAD_ABORTED_PATH_ERROR,
195  /*5*/ OBJ_LOAD_ABORTED_ERROR,
196 #ifdef DSM_MHP_PROFILE
197  /*6*/ OBJ_LOAD_ABORTED_UNLOAD,
198  /* -- NOT CURRENTLY IMPLEMENTED */
199  /*7*/ OBJ_LOAD_PARENT_DIR_LOADED
200 #else
201  /*6*/ OBJ_LOAD_ABORTED_UNLOAD
202 #endif
203 } E_ObjLoadStatus;
204 
205 
206 typedef struct s_ObjUserData *H_ObjUserData;
207 
208 /*
209  This is the current status of the notification of a Stream Event.
210 */
211 typedef enum
212 {
213  SEN_INITIAL,
214  SEN_NOTIFIED,
215  SEN_ABORTED_OBJ_LOAD_FAILED,
216  SEN_ABORTED_SUBSCRIBE_FAILED,
217  SEN_TRIGGERED,
218  SEN_ACKNOWLEDGE_UNSUBSCRIBE
219 } E_SENotifyStatus;
220 
221 
222 /* --------------- REQUIRED API - CALLBACK TYPE DEFINITIONS ----------------- */
223 
224 /*
225 -- NOTES:
226 --
227 -- The calling environment must provide functions that match these callback
228 -- type definitions (except F_Progress which is optional). All
229 -- required callbacks should be non-blocking. The callback addresses are
230 -- supplied to the DSM-CC instance at instance create/setup.
231 --
232 -- The callbacks are not expected to fail except under exception conditions.
233 --
234 -- For callbacks with 'int' return values, this should be used to indicate:
235 -- zero: Successful execution/registration of call with calling env.
236 -- non-zero: Failure to execute/register call (eg. due to memory failure)
237 --
238 -- The DSMCC library will attempt to take some logical actions in response to a
239 -- failure of a start/add callback that may enable it to continue.(eg. abandon
240 -- request and notify client of a load failure due to system error).
241 --
242 -- The stop/delete callbacks are not provided with return values since there is
243 -- no meaningful action the DSM-CC library can take in response to these
244 -- failing. If it is possible that these callbacks fail to execute the
245 -- requested action then the internal state of the DSM-CC library will become
246 -- inconsistent with the calling environment. The calling environment must
247 -- handle this situatation - eg. by raising an exception and processing it when
248 -- the DSM-CC API call that triggered it completes. The calling environment
249 -- should deal with the problem before making any further DSM-CC API calls
250 -- (except clDsmSysReset or clDsmSysDestroy). It should either ensure that the
251 -- action requested by the callback is successfully executed or clear the problem
252 -- and reset/restart the DSM-CC library.
253 --
254 */
255 
256 
257 /* -- ERROR/PROGRESS CALLBACKS -- */
258 
259 /*******************************************************************************
260 * Informs calling environment of errors triggered during stream/section
261 * processing
262 *******************************************************************************/
263 typedef void (*F_Error) ( /*I*/ E_DscError err, void *args );
264 
265 
266 /*******************************************************************************
267 * Informs calling environment of state changes triggered during
268 * stream/section processing
269 *******************************************************************************/
270 typedef void (*F_Progress) ( /*I*/ U32BIT prog, void *args );
271 
272 
273 
274 /* -- TIMER CALLBACKS -- */
275 
276 /*******************************************************************************
277 * Starts timer with specified period
278 *
279 * Timer trigger/timeout notified via CDSM_SysProcessTimerEvent().
280 *
281 * When notifying a timeout then the value of clDsmTmrUserData
282 * supplied to this call MUST also be input to clDsmProcessTimerEvent.
283 *
284 * Returning a timerHandle value is optional but it should be set to Null if
285 * not used/available. This value is input to the stopTimerFunc callback.
286 *
287 * If a timerHandle is not available synchronously then it can be also be
288 * supplied when clDsmSysProcessTimerEvent is called.
289 *
290 *******************************************************************************/
291 typedef E_DscError (*F_StartTimer) ( H_DsmControl dsmControl,
292  /*I*/ U32BIT timePeriod,
293  void *clDsmTmrUserData,
294  /*O*/ void **pTimerHandle );
295 
296 
297 /*******************************************************************************
298 * Stops timer
299 *
300 * Timers will always be explicity stopped via this call, even after they have
301 * triggered. Both application and component handles/references are supplied for
302 * flexibility.
303 *
304 * NB. If a timer is stopped (aborted) before it has triggered (ie. before a
305 * timeout has been notified via clDsmSysProcessTimerEvent), timer abort must be
306 * notified via CDSM_SysProcessTimerEvent() instead. The call to
307 * clDsmSysProcessTimerEvent can be made from within this callback.
308 *
309 *******************************************************************************/
310 typedef void (*F_StopTimer) ( H_DsmControl dsmControl,
311  /*I*/ void *timerHandle );
312 
313 
314 
315 /* -- SI QUERY CALLBACKS -- */
316 
317 /*******************************************************************************
318 * Makes (starts) SI query (eg. database lookup)
319 *
320 * Meaning of return values in this context:
321 *
322 * CLDSM_OK
323 * - Query has (synchronously) returned successful result.
324 *
325 * CLDSM_PENDING
326 * - Query is being executed asynchronously - results/events
327 * will be returned via CDSM_SysProcessSIQueryEvent()
328 *
329 * CLDSM_ERR_SI_QUERY_FAILED
330 * - Query has (synchronously) failed to determine requested
331 * information (due to error in SI lookup).
332 *
333 * If a query result is to be returned asynchronously then the value of
334 * clDsmSIQueryRef and clDsmSIUserData supplied to this call MUST also be input
335 * to clDsmProcessSIQueryEvent along with the result.
336 *
337 * Returning a queryHandle value in pResult is optional. If not used/available,
338 * it should be set to Null. This value is input to the stopSIQueryFunc callback.
339 *
340 * If a queryHandle is not available synchronously then it can be also be
341 * supplied when clDsmSysProcessSIQueryEvent is called.
342 *
343 * NB. In this case, if the query is stopped for any reason before this event
344 * then the calling environment will have to identify the correct query to stop
345 * from the DSM-CC reference (clDsmSIQueryRef).
346 *
347 *******************************************************************************/
348 typedef E_DscError (*F_StartSIQuery) ( H_SiqInstance siqInstance,
349  P_SIQueryRequest pQuery, H_SIQueryRef clDsmSIQueryRef,
350  void* clDsmSIUserData,
351  P_SIQueryResult pResult );
352 
353 
354 /*******************************************************************************
355 * Stops an SI query
356 *
357 * Any asynchronous SI queries (ie. those that returned a status SIQUERY_PENDING
358 * to the StartSIQueryFunc call) will be explicity stopped via this call, even
359 * after they have completed.
360 *
361 * Both application and component handles/references are supplied for
362 * flexibility.
363 *
364 * NB. If an SI query is stopped (aborted) before it has completed (ie. before
365 * a result has been supplied via clDsmSysProcessSIQueryEvent), SI query abort
366 * must be notified via CDSM_SysProcessSIQueryEvent() instead. The call to
367 * clDsmSysProcessSIQueryEvent can be made from within this callback.
368 *
369 *******************************************************************************/
370 typedef void (*F_StopSIQuery) ( H_SiqInstance siqInstance,
371  /*I*/ void *queryHandle, H_SIQueryRef clDsmSIQueryRef );
372 
373 
374 
375 /* -- SI CHANGE REGISTRATION CALLBACKS -- */
376 
377 /*******************************************************************************
378 * Register to receive notifications of changes to the SI for the specified
379 * service (on the current transport stream/multiplex).
380 *
381 * When a duplicate subscribe is made (ie. for a service that is already
382 * subscribed) it should increment the count of subscriptions for that service.
383 * Matching unsubscribe will be made for each subscribe.
384 *
385 * Changes are notified via the clDsmSysProcessSIChangeEvent function in the
386 * following situations:
387 *
388 * - The subscribed service cannot be located
389 * - The service is deleted from the multiplex (eg. PAT updated)
390 * - The service info is updated (ie. PMT updated).
391 *
392 * If it can be determined immediately (ie. synchronously) that the requested
393 * service does not exist in the current multiplex (eg. it is not listed in the
394 * most recent stored copy of the PAT) then the output parameter serviceNotFound
395 * can be set to TRUE (otherwise set it to FALSE).
396 *
397 *******************************************************************************/
398 typedef E_DscError (*F_SubscribeSIChanged) ( H_SiqInstance siqInstance,
399  /*I*/ U16BIT service_id );
400 
401 
402 /*******************************************************************************
403 * Decrement number of subscriptions to the specified service. Only when this
404 * number reaches zero should this function de-register for notifications of
405 * changes to the SI for the service.
406 *
407 * This will be called to de-register for a previously subscribed service,
408 * even if the DSM-CC library has been notified that the subscribed service
409 * cannot be located.
410 *
411 *******************************************************************************/
412 typedef void (*F_UnsubscribeSIChanged) ( H_SiqInstance siqInstance,
413  /*I*/ U16BIT service_id );
414 
415 
416 
417 /* -- SECTION FILTER CALLBACKS -- */
418 
419 /*******************************************************************************
420 * Requests a section filter to be started.
421 *
422 * It is assumed that the number of section filters that may be simultaneously
423 * requested (in use) is unlimited. Typically it is expected that the worst case
424 * requirement (eg. with full carousel caching and multiple stream events) is
425 * less than that specified in the setup.
426 *
427 * Filtered private sections are returned via CDSM_SysProcessPrivateSection().
428 * The clDsmFilterRef value MUST be stored and also
429 * returned with any sections that matched the requested filter.
430 *
431 * Exact duplicate filters will never be requested simultaneously but filters
432 * with 'wildcard' (ie. tableIdExtMask) bits set may overlap with other
433 * requested filters with less or no mask bits set.
434 *
435 * If a section aligns with two or more such filters then it should only be
436 * matched to the 'narrowest' (ie. most exact) filter and that clDsmFilterRef
437 * value passed with the section data to clDsmSysProcessPrivateSection.
438 *
439 * Filters requested with high priority will always be narrower (ie. less mask
440 * bits set) than any overlapping low priority filters and this rule ensures
441 * that sections will always be matched to high priority filters in preference
442 * to low.
443 *
444 * NB. The worst case number of exact filters (ie. with no mask bits set)
445 * requested simultaneously may be large (eg. 100s) but the worst case number of
446 * simultaneous filters with (one or more) mask bits set is expected to be much
447 * smaller (eg. ~10).
448 *
449 * The filter should always remain in effect with continuous supply of section data,
450 * until delSectionFilterFunc is called.
451 *
452 * If platform requires priority rating in this callback, it can use
453 * CDSM_SectionFilterPriority().
454 *
455 * Parameters:
456 *
457 * PID MPEG2 PID
458 *
459 * tableId DSM-CC tableId filter value for sections (byte 0).
460 * NB. Only the tableId values of 0x3B, 0x3C, 0x3D will
461 * be used for DSM-CC section filters.
462 *
463 * tableIdExt DSM-CC tableIdExtension filter value (bytes 3&4)
464 *
465 * tableIdExtMask DSM-CC active filter bits.
466 * NB.'Wildcard' bitmasks will only be set on contiguous
467 * bits starting at LSBit.
468 *
469 * Return: void*
470 * This is the platform filter handle value. It is given as input to the
471 * delSectionFilterFunc callback. NULL value is considered failure, and any other
472 * value is considered a successful operation.
473 *
474 *******************************************************************************/
475 typedef void * (*F_AddSectionFilter) ( H_SfmInstance sfm,
476  /*I*/ P_SecFilter pFilter, H_DscSFRef dsmFilterRef );
477 
478 
479 /*******************************************************************************
480 * Requests a section filter to be stopped
481 *
482 * To give flexibility in identifying the filter to delete, both application
483 * and component handles/references are supplied. Also a repeat of the section
484 * filter details are supplied (which are unique for any active filter) .
485 *
486 * NB. To avoid problems due to delays in deleting filters or caused by queuing
487 * sections the clDsmSysProcessPrivateSection function can detect sections being
488 * supplied from 'stale' (ie. deleted) filters. This will waste CPU time so the
489 * calling environment should ensure as soon as possible (after this callback
490 * is made) that sections matching the deleted filter are stopped.
491 *
492 *******************************************************************************/
493 typedef void (*F_DelSectionFilter) ( H_SfmInstance sfm,
494  /*I*/ void *filterHandle, H_DscSFRef clDsmFilterRef );
495 
496 
497 /*******************************************************************************
498 * Notify a section filter priority changed
499 *
500 *******************************************************************************/
501 typedef void (*F_SFPriorityChanged) ( H_SfmInstance sfm,
502  /*I*/ void *filterHandle, H_DscSFRef clDsmFilterRef,
503  E_SFPriority priority );
504 
505 
506 /* -- LOAD & STREAM EVENT CALLBACKS -- */
507 
508 /*******************************************************************************
509 * Notify of a load carousel event.
510 *
511 * Called when carousel booted, load completed (ie. SRG module loaded) or load
512 * aborted before completion (due to errors, timeout or unload). Component
513 * handle and userData values supplied for flexibility.
514 *
515 * If CDSM_UnloadCarousel() is called before the carousel load is completed
516 * (ie. before this callback has been called with status OC_LOAD_COMPLETED)
517 * then the callback will actually be made from within the clDsmUnloadCarousel
518 * call with status OC_LOAD_ABORTED_UNLOAD.
519 *
520 * Any of the Synchronous or Asynchronous Client API calls (ie. API calls that
521 * do NOT start with clDsmSys...) can be made from within this callback. When
522 * doing this, care must be taken to avoid blocking or re-entrancy problems in
523 * the calling environment. Re-entrancy may occur when unloading objects or
524 * carousels since this can cause a (re-entrant) call to this callback.
525 *
526 *
527 *******************************************************************************/
528 typedef void (*F_NotifyCarouselLoadEvent) (
529  /*I*/ H_DsmCarousel clDsmCarouselHandle, E_OCLoadStatus status,
530  U32BIT carouselId );
531 
532 
533 /*******************************************************************************
534 * Notify of a load object event.
535 *
536 * Called when object load completed or load aborted before completion (due to
537 * errors, timeout or unload of object or carousel). Component handle and
538 * userData values supplied for flexibility.
539 *
540 * If CDSM_UnloadObject() (or clDsmUnloadCarousel) is called before the object
541 * load is completed (ie. before this callback has been called with status
542 * OBJ_LOAD_COMPLETED) then the callback will actually be made from within the
543 * CDSM_UnloadObject(or clDsmUnloadCarousel) call with status
544 * OBJ_LOAD_ABORTED_UNLOAD.
545 *
546 * Any of the Synchronous or Asynchronous Client API calls (ie. API calls that
547 * do NOT start with clDsmSys...) can be made from within this callback. When
548 * doing this, care must be taken to avoid blocking or re-entrancy problems in
549 * the calling environment. Re-entrancy may occur when unloading objects or
550 * carousels since this can cause a (re-entrant) call to this callback.
551 *
552 *
553 *******************************************************************************/
554 typedef void (*F_NotifyObjectLoadEvent) (
555  /*I*/ H_DsmObject clDsmObjectHandle, E_ObjLoadStatus status,
556  H_ObjUserData pCopyOfObjLoadUserData );
557 
558 
594 typedef void (*F_NotifyStreamEvent)(
595  /*I*/ H_DsmEvent eventHandle, E_SENotifyStatus status,
596  void *userData1, void *userData2,
597  U8BIT *namePtr, U8BIT *dataPtr, U8BIT namelen, U8BIT dataLen );
598 
599 
600 
615 typedef void (*F_NotifyDeferredService) (
616  /*I*/ void *userData1, void *userData2,
617  S_DvbLocator *pDeferredService );
618 
619 
620 /*
621 -- Type definitions for setup variables
622 --
623 */
624 
625 /*
626 -- Setup structure for use at initialisation
627 */
628 typedef struct
629 {
630  /*
631  -- General callback pointers
632  --
633  -- NOTES:
634  -- All callbacks MUST be provided except where indicated
635  --
636  */
637  F_MemAlloc allocFunc;
638  F_MemFree freeFunc;
639 
640  /* -- errorFunc - optional (Null if not used) */
641  F_Error errorFunc;
642  /* -- progressFunc - optional (Null if not used) */
643  F_Progress progressFunc;
644 
645  F_AddSectionFilter addSectionFilterFunc;
646  F_DelSectionFilter delSectionFilterFunc;
647  /* -- sfPriorityChangeFunc - optional (Null if not used) */
648  F_SFPriorityChanged sfPriorityChangeFunc;
649 
650  F_StartTimer startTimerFunc;
651  F_StopTimer stopTimerFunc;
652 
653  F_StartSIQuery startSIQueryFunc;
654  F_StopSIQuery stopSIQueryFunc;
655 
656  F_SubscribeSIChanged subscribeSIChangeFunc;
657  F_UnsubscribeSIChanged unsubscribeSIChangeFunc;
658 
659  /* -- notifyCarouselLoadEventFunc - optional (Null if not used) */
660  F_NotifyCarouselLoadEvent notifyCarouselLoadEventFunc;
661  /* -- notifyObjectLoadEventFunc - optional (Null if not used) */
662  F_NotifyObjectLoadEvent notifyObjectLoadEventFunc;
663 
664  /* notifyStreamEventFunc can be Null when Stream Events are not required */
665  F_NotifyStreamEvent notifyStreamEventFunc;
666 
667  /* notifyDeferredServiceFunc can be Null when deferred service for Stream Objects are not required */
668  F_NotifyDeferredService notifyDeferredServiceFunc;
669 
670  S_SsuConfig ssuFuncs;
671 
672  /* -- Control flags */
673 
674  H_DsmControl dsmControl;
675  /*
676  -- Instance handle for external Service Information Query module
677  */
678  H_SiqInstance siqInstance; /* -- Suggested default: Null */
679 
680  /*
681  -- Instance handle for external Section Filter Manager module
682  */
683  H_SfmInstance sfmInstance; /* -- Suggested default: Null */
684 
685  /*
686  -- Pointer (optional) that can be used by calling environment for
687  -- passing setup info to the memory manager (via clDsmMemMgr API) at
688  -- memStart time.
689  */
690  void *memMgrSetup; /* -- Suggested default: Null */
691 
692 
693  /*
694  -- Specifies resolution of time units used on API in _milliseconds_
695  -- (can be set to resolution of external timers)
696  --
697  -- NB. Time values are represented on the API and internally as U32BIT so
698  -- timeUnitResolution should be chosen so that overflow problems will not
699  -- occur during any likely period of continuous use for a receiver (eg. if
700  -- timeUnitResolution = 10mS, wrap-round time = 1.36 years!).
701  */
702  U32BIT timeUnitResolution; /* -- Suggested default: 10 */
703 
704 
705  /*
706  -- Sets the size of dynamic memory available for DSM-CC to use.
707  -- Apart from 100KB approx. the remainder of this memory will be requested
708  -- and accessed via the dynamic memory manager API (clDsmMemMgrAPI.h).
709  --
710  -- NB. In debug builds DSM-CC may allocate slightly (<5%) more than this
711  -- specified amount.
712  --
713  -- If clDsmMemMgrAPI is mapped to a system memory manager then it
714  -- has an additional option (when it is opened) to decrease the amount
715  -- of (the remainder of this) memory it makes available.
716  */
717  U32BIT maxMemorySize; /* -- Absolute minimum: DSMCC_MINIMUM_CACHE_SIZE */
718  /* -- Recommended min: DSMCC_DEFAULT_CACHE_SIZE */
719 
720  /*
721  -- Specifies the maximum number of section filters that are available
722  -- in the calling environment (to this instance) for simultaneously
723  -- acquiring DSM-CC private sections.
724  --
725  -- If client requests (or other events) cause the core stack to
726  -- simultaneously require more section filters than the number available
727  -- it will rotate its requests through the available filters. This may
728  -- cause delays in responding to client requests so the larger this
729  -- number the better.
730  --
731  -- The minimum value is NUM_SECTION_FILTERS_MINIMUM.
732  -- Setting to zero will be interpreted as no restriction on the
733  -- number of section filters available in the calling environment, and
734  -- NUM_SECTION_FILTERS_MAXIMUM will be used.
735  -- Setting to a value less than this the minimum will be ignored, and
736  -- NUM_SECTION_FILTERS_MINIMUM will be used.
737  -- Suggested Default: NUM_SECTION_FILTERS_DEFAULT
738  */
739  U16BIT maxAvailableSectionFilters;
740 
741  /*
742  -- Sets whether DSM-CC component maintains an internal record
743  -- of SI query results so that it does not need to repeatedly
744  -- make the same SI queries (to the calling env). Typically this
745  -- will be used for storing association_tag to PID mappings.
746  */
747  BOOLEAN storeSIQueryResults; /* -- Default: FALSE */
748 
749 
750  /*
751  -- Sets whether DSM-CC component pre-fetches modules into its
752  -- internal cache.
753  --
754  -- NB. This requires a large available memory size and a large number of
755  -- available section filters.
756  --
757  -- Enabling turboCaching also activates full transparent caching (ie.
758  -- automatic re-loading of cached modules that have version updates).
759  -- This is because turboCaching will not work effectively without this
760  -- and also because only when turboCaching is enabled are there
761  -- likely to be sufficient section filters available to support
762  -- automatic module re-loading.
763  */
764  BOOLEAN turboCaching; /* -- Default: FALSE */
765 
766  /*
767  */
768  BOOLEAN multipleSsuDownloads;
770 
771 
772 
773 /*---Global variable declarations for public use-----------------------------*/
774 
775 
776 /******************************************
777 * EXPORTED (PROVIDED) FUNCTION PROTOTYPES *
778 *******************************************/
779 
780 /* ---------------------- SYNCHRONOUS SYSTEM API CALLS ---------------------- */
781 
782 /*
783 -- NOTES:
784 --
785 -- The following functions must be called synchronously with each other and
786 -- with the Synchronous Client API calls since they use and modify common
787 -- instance data. If they need to be called/triggered from different threads
788 -- the calling environment must ensure synchronous behaviour - eg. by using
789 -- a mutex semaphore round the call (or queueing and calling from the same
790 -- thread).
791 --
792 -- In some circumstances it is possible to make one Synchronous API call from
793 -- within another one:
794 --
795 -- eg. clDsmSysProcessTimerEvent can be called within the stopTimerFunc
796 -- callback which itself may have been called from within.
797 -- clDsmSysProcessPrivateSection
798 --
799 -- eg. All Synchronous Client API calls can be called from within the
800 -- notifyCarouselLoadEvent or notifyObjectLoadEvent callbacks which may
801 -- themselves have been called within clDsmSysProcessPrivateSection.
802 --
803 -- These cases are clearly specified in the comments. The calling environment
804 -- must avoid possible permanent blocks in these circumstances, eg. from trying
805 -- to get a mutex on a thread that has it already.
806 --
807 */
808 
809 
810 /*******************************************************************************
811 * Create DSM-CC Core Layer instance
812 *
813 * Only call at startup of an instance (before ANY other DSM-CC Core Layer API
814 * calls are made for that instance). Allocates all required 'static' memory
815 * for the instance (via allocFunc). Also stores (copies) data supplied in
816 * setup structure.
817 *
818 * NB. Dynamic (heap) memory used by the instance is allocated/deallocated and
819 * accessed via the dynamic memory manager API (clDsmMemMgrApi.h).
820 *
821 * Returns instance value which is used to reference the unique data used by
822 * this DSM Core instance. It MUST be stored by the calling environment and
823 * passed to any clDsm API calls for the instance.
824 *
825 * Also returns memContext parameter (obtained when memory manager started).
826 * If implemented/required, this gives the calling environment independent
827 * access to the memory manager context used by this DSM Core instance.
828 *
829 * CALLBACKS THAT MAY BE INITIATED DURING THIS CALL:
830 * allocFunc
831 * freeFunc - only on error
832 *
833 * RETURNS:
834 * CLDSM_OK (0)
835 * CLDSM_ERR_ALLOC_FAILED,
836 * CLDSM_ERR_MEM_HEAP_FULL
837 * CLDSM_ERR_ILLEGAL_SETUP
838 *
839 *******************************************************************************/
840 E_DscError CDSM_SysCreate(
841  /*I*/ P_DsmSetup pSetup,
842  /*O*/ H_DsmCoreInst *pInstance, void **pMemContext );
843 
844 
845 
876 E_DscError CDSM_SysDestroy( H_DsmCoreInst instance,
877  H_SiqInstance *pSiqInst, H_SfmInstance *pSfmInst );
878 
879 
885 H_DsmControl CDSM_SysGetControl( H_DsmCoreInst instance );
886 
887 
925 E_DscError CDSM_SysReset( H_DsmCoreInst instance, E_DsmRstMode mode );
926 
932 void CDSM_SysSetMemoryMax( H_DsmCoreInst instance, U32BIT maxMemory );
933 
965 E_DscError CDSM_SysSetCurrService( H_DsmCoreInst instance,
966  /*I*/ U16BIT original_network_id, U16BIT transport_stream_id,
967  U16BIT service_id );
968 
969 U16BIT CDSM_SysCurrServiceId( H_DsmCoreInst instance );
970 
971 
997 E_DscError CDSM_SysProcessTimerEvent( H_DsmCoreInst instance,
998  /*I*/ void *clDsmTmrUserData, E_TimerStatus status, void *timerHandle );
999 
1000 
1001 
1042 E_DscError CDSM_SysProcessSIQueryEvent( H_DsmCoreInst instance,
1043  /*I*/ H_SIQueryRef clDsmSIQueryRef, void *clDsmSIUserData,
1044  P_SIQueryResult pResult );
1045 
1046 
1047 
1083 E_DscError CDSM_SysProcessSIChangeEvent( H_DsmCoreInst instance,
1084  E_SIChangeEvent evnt, U16BIT service_id, U32BIT carousel_id );
1085 
1086 
1087 
1088 /*******************************************************************************
1089 * Process DSM-CC private section data
1090 *
1091 * NOTES:
1092 *
1093 * Call each time the Demux provides a private section from one of the
1094 * requested PIDs (main TS data input of DSM-CC Core API).
1095 *
1096 * It is assumed that the calling environment has already CRC checked the
1097 * section (if relevant) and only sections that pass this check will be
1098 * supplied to clDsmSysProcessPrivateSection.
1099 *
1100 * The clDsmFilterRef and clDsmSfUserData inputs MUST be set to the values
1101 * supplied when the filter for this section was requested
1102 * (via addSectionFilterFunc).
1103 *
1104 * If sections have to be queued (or discarded) in the calling environment
1105 * then those matching filters with a high priority MUST always be supplied
1106 * to this function in preference to those matching low priority filters.
1107 *
1108 * NB. Although sections matching low priority filters (or even high priority
1109 * filters) can be discarded if necessary. The order in which they were
1110 * broadcast should always be maintained when they are supplied to this
1111 * function.
1112 *
1113 * CALLBACKS THAT MAY BE INITIATED DURING THIS CALL:
1114 * errorFunc
1115 * progressFunc
1116 * addSectionFilterFunc
1117 * delSectionFilterFunc
1118 * stopTimerFunc
1119 * startSIQueryFunc
1120 * notifyCarouselLoadEventFunc
1121 * notifyObjectLoadEventFunc
1122 *
1123 * RETURNS:
1124 * CLDSM_OK (0)
1125 * CLDSM_ERR_INVALID_INSTANCE
1126 * CLDSM_ERR_ILLEGAL_PARAMETER
1127 * CLDSM_ERR_ABORTED When dsmFilterRef is not recognised (maybe stale)
1128 *
1129 *******************************************************************************/
1130 E_DscError CDSM_SysProcessPrivateSection( H_DsmCoreInst instance,
1131  /*I*/ U8BIT *pSection, H_DscSFRef dsmFilterRef );
1132 
1133 
1134 /*******************************************************************************
1135 * Request priority for DSM-CC private section data
1136 *
1137 *******************************************************************************/
1138 E_DscError CDSM_SectionFilterPriority( H_DsmCoreInst instance,
1139  H_DscSFRef dsmFilterRef,
1140  E_SFPriority *pPriority );
1141 
1142 
1143 /* ---------------------- SYNCHRONOUS CLIENT API CALLS ---------------------- */
1144 
1145 /*
1146 -- NOTES:
1147 --
1148 -- The following functions must be called synchronously with each other and
1149 -- with the above System API calls. If they need to be called/triggered
1150 -- from different threads the calling environment must ensure synchronous
1151 -- behaviour - eg. by using a mutex semaphore round the call (or queueing and
1152 -- calling from the same thread).
1153 --
1154 -- Any of the Synchronous (or Asynchronous) Client API calls (ie. API
1155 -- calls that do NOT start with clDsmSys...) can be made from within the
1156 -- notifyCarouselLoadEvent or notifyObjectLoadEvent callbacks. When doing
1157 -- this, care must be taken to avoid blocking or re-entrancy problems in
1158 -- the calling environment. Re-entrancy may occur when unloading objects or
1159 -- carousels since this can cause a (re-entrant) call to these callbacks.
1160 --
1161 */
1162 
1163 
1164 /* -- CAROUSEL LOAD FUNCS -- */
1165 
1166 /*******************************************************************************
1167 *
1168 * Loads DSM-CC object carousel specified by carousel_id from indicated service
1169 * (on the current multiplex/transport stream)
1170 *
1171 * If carousel_id is set to INVALID_CAROUSEL_ID, then this function loads the
1172 * initiate boot carousel for the service
1173 *
1174 * NOTES:
1175 *
1176 * The returned clDsmCarouselHandle value must always be supplied by the
1177 * calling environment whenever accessing objects in this carousel.
1178 *
1179 * Initially a section filter will be set up to acquire the DSI message for the
1180 * carousel. Once the DSI message is acquired the calling environment is
1181 * notified via the notifyCarouselLoadEventFunc callback (if supplied at
1182 * setup/create) that the carousel is BOOTED. Open object requests can then be
1183 * made for this carousel.
1184 *
1185 * When the service gateway (SRG) is loaded for this carousel the calling
1186 * environment is notified again via the callback that the carousel is now
1187 * LOADED. Objects in the carousel cannot be accessed (opened) until the
1188 * service gateway for the carousel is loaded.
1189 *
1190 * If timeout occurs before the SRG is loaded a timeout error is returned. If
1191 * an error is encountered while loading the carousel then an aborted error is
1192 * returned.
1193 *
1194 * Using the ocLoadUserData1 and ocLoadUserData2 values is optional. These
1195 * values are returned unchecked into the load event callback. They can be used
1196 * for any purpose (eg. to aid in matching callbacks with corresponding load
1197 * requests and/or clients).
1198 *
1199 * If timeout value is set to zero it means no (ie. infinite) timeout.
1200 *
1201 * If a duplicate request is made to load a boot carousel then an error will be
1202 * generated but the clDsmCarouselHandle will be set to the value of the already
1203 * loaded carousel.
1204 *
1205 * CALLBACKS THAT MAY BE INITIATED DURING THIS CALL:
1206 * startTimerFunc
1207 * startSIQueryFunc
1208 * addSectionFilterFunc
1209 *
1210 * RETURNS:
1211 * CLDSM_OK (0)
1212 * CLDSM_DUPLICATE_REQUEST
1213 * CLDSM_ERR_MEM_HEAP_FULL
1214 * CLDSM_ERR_NO_CURRENT_SERVICE_SET
1215 * ?
1216 *
1217 *******************************************************************************/
1218 E_DscError CDSM_LoadCarousel( H_DsmCoreInst instance,
1219  U16BIT service_id, U32BIT carousel_id, E_SIQueryKind kind,
1220  H_DsmCarousel *pclDsmCarouselHandle );
1221 
1222 
1223 
1224 
1265 E_DscError CDSM_UnloadCarousel( H_DsmCoreInst instance,
1266  /*I*/ H_DsmCarousel clDsmCarouselHandle, E_DsmRstMode mode );
1267 
1276 E_DscError CDSM_UnloadModule( H_DsmCoreInst idp, H_DsmCarousel hCarousel,
1277  U32BIT moduleRef );
1278 
1288 E_DscError CDSM_GetCarouselId( H_DsmCoreInst instance,
1289  /*I*/ H_DsmCarousel carouselHandle,
1290  /*O*/ U32BIT *pCarouselId );
1291 
1297 H_DsmCarousel CDSM_CurrentCarousel( H_DsmCoreInst instance );
1298 
1307 E_DscError CDSM_SetCurrentCarousel( H_DsmCoreInst instance,
1308  /*I*/ H_DsmCarousel carouselHandle );
1309 
1321 E_DscError CDSM_CarouselLoadFileGroups( H_DsmCoreInst instance,
1322  /*I*/ H_DsmCarousel clDsmCarouselHandle,
1323  /*O*/ U16BIT *total, S_CarouselInfoFileGroup **pGroups );
1324 
1337 E_DscError CDSM_CarouselUnloadFileGroups( H_DsmCoreInst instance,
1338  /*I*/ H_DsmCarousel clDsmCarouselHandle,
1339  /*I*/ S_CarouselInfoFileGroup *groups );
1340 
1341 /* -- OBJECT LOAD FUNCS -- */
1342 
1343 /*******************************************************************************
1344 *
1345 * Load an object with the requested pathname into cache.
1346 *
1347 * Unless the carousel is specifed in the path, this will load an object from
1348 * the 'Current' object carousel. The client may specify another carousel by
1349 * setting the 'Current' object carousel with use of CDSM_SetCurrentCarousel().
1350 * If the path does specify a new carousel (as defined by "ETSI TS 102 851"),
1351 * then the function will attempt to load this carousel and make it the new
1352 * 'Current' object carousel.
1353 *
1354 * NOTES:
1355 *
1356 * Currently, an object can only be loaded once the carousel is booted (DSI
1357 * message acquired).
1358 *
1359 * Requested pathname must be a full (absolute) object pathname starting with
1360 * an object in the root (ie. service gateway) directory of the specified
1361 * carousel, eg. dir1/dir2/file3 is treated as DSM:/dir1/dir1/file3. Any
1362 * characters defined in PATH_SEPERATOR_LIST_STRING will be treated as path
1363 * token seperators all other chars are treated as part of a path token. An
1364 * empty pathname U8BIT* (or U8BIT* containing only path token seperators)
1365 * will open the service gateway directory itself.
1366 *
1367 * **** NB. SRG (& directory) ACCESS NOT YET IMPLEMENTED ****
1368 *
1369 * Returns an clDsmObjectHandle which the client uses to access the requested
1370 * object. If the object is already cached then the status parameter will be
1371 * set to OBJ_LOAD_COMPLETED. In this case the objectRef value can be used to
1372 * access (eg. open for reading) the object/file data immediately.
1373 *
1374 * If the object is not in the cache then a fetch from the input stream is
1375 * initiated and the status parameter set to OBJ_LOAD_IN_PROGRESS. When the
1376 * object is loaded into the cache the calling environment is notified via the
1377 * notifyObjectlLoadEventFunc callback (if supplied at setup/create).
1378 *
1379 * Using the objLoadUserData1 and objLoadUserData2 values is optional. These
1380 * values are returned unchecked into the load event callback. They can be used
1381 * for any purpose (eg. to aid in matching callbacks with corresponding load
1382 * requests and/or clients).
1383 *
1384 * If multiple load requests are made for the same object before it is
1385 * available each request will initiate a new (parallel) fetch from the input
1386 * stream and a callback will be generated for each request when the object is
1387 * loaded.
1388 *
1389 * While an object is LOADED it's contents are guaranteed to remain available
1390 * and constant in cache memory (ie. it will not be updated from the input
1391 * stream or deleted to create space in the cache).
1392 *
1393 * Any load request for an object (that is not already loaded) will only get
1394 * completed by a call to clDsmysProcessPrivateSection. This will either have
1395 * delivered the last part of the module containing the object or delivered a
1396 * module containing a previously missing higher level directory in the object
1397 * path that results in the requested object now being accessible in the cache.
1398 *
1399 * If a load proceeds part way down a path and then encounters an error, the
1400 * load is aborted and the appropriate status returned via the callback. The
1401 * clDsmObjectHandle cannot be used to access object/file DATA until/unless
1402 * it is successfully loaded.
1403 *
1404 * **** NB. ONLY CACHING RULE 'fromStream' CURRENTLY IMPLEMENTED ****
1405 * If caching rules are specified they are applied as below. If pCachingRules
1406 * is set to Null the object will be given the default caching rules.
1407 *
1408 * If the object is not in the cache then the caching rules only have an
1409 * effect on the subsequent caching of the object/module once the object load
1410 * is completed and the object is actually unloaded (via clDsmUnloadObject),
1411 * ie. when it is made available for caching.
1412 *
1413 * If the same object is requested multiple times in parallel, then once the
1414 * object load is completed the highest priority caching rules are selected
1415 * (fromStream overrides any other settings). These are applied only when
1416 * the last of the object load instances is unloaded.
1417 *
1418 * If the requested object is already in the cache and the caching rules have
1419 * fromStream set, then the object/module is immediately deleted from the cache
1420 * and a new fetch from the input stream is initiated.
1421 *
1422 * If the same object is loaded multiple times in parallel then the caching
1423 * rules specified at each load call will only replace the currently set
1424 * caching rules for this object if they specify a higher caching priority
1425 * (fromStream overrides any priority setting). If fromStream is set on any
1426 * load then it will cause a re-fetch of the object for that load instance.
1427 * The data for any previous load instances will only get physically deleted
1428 * when they are unloaded.
1429 *
1430 * NB. For module based caching (as currently implemented) the whole module
1431 * inherits the caching rules MOST RECENTLY SPECIFIED for any object in that
1432 * module.
1433 *
1434 * The rules for when multiple objects from the same module are requested (or
1435 * loaded) in parallel are applied to a module on the same basis as described
1436 * for multiple instances of the same object.
1437 *
1438 * **** NOT YET IMPLEMENTED ****
1439 * If timeout value is set to zero it means no (ie. infinite) timeout. If a
1440 * timeout is specified and the object has not been loaded in the specified
1441 * time (for any reason) then the load request is aborted and the client
1442 * notified. Timeout is expressed in periods of timerResolution (specified at
1443 * setup/create).
1444 *
1445 *
1446 * CALLBACKS THAT MAY BE INITIATED DURING THIS CALL:
1447 * addSectionFilterFunc
1448 * startTimerFunc
1449 * startSIQueryFunc
1450 *
1451 * RETURNS:
1452 * CLDSM_OK (0)
1453 * CLDSM_ERR_MEM_HEAP_FULL
1454 * CLDSM_ERR_INVALID_CAROUSEL_HANDLE
1455 * CLDSM_ERR_INVALID_CACHING_RULES
1456 * CLDSM_ERR_CAROUSEL_NOT_BOOTED
1457 *
1458 * CLDSM_ERR_INVALID_PATHNAME - Null pointer or path too long
1459 *
1460 * CLDSM_ERR_LOAD_FAILURE - Failed to load requested file (because
1461 * some part of path could not be located)
1462 * +?
1463 *
1464 *******************************************************************************/
1465 E_DscError CDSM_LoadObject( H_DsmCoreInst instance,
1466  /*I*/ U8BIT *pathname, U32BIT timeout, E_CacheRules cachingRules,
1467  H_ObjUserData pUserData, U32BIT sizeOfUserData,
1468  /*O*/ E_ObjLoadStatus *pStatus, H_DsmObject *pclDsmObjectHandle );
1469 
1470 
1471 
1530 E_DscError CDSM_UnloadObject( H_DsmCoreInst instance,
1531  /*I*/ H_DsmObject clDsmObjectHandle, E_DsmRstMode mode );
1532 
1533 
1560 E_DscError CDSM_OpenObject(
1561  /*I*/ H_DsmCoreInst instance,
1562  /*I*/ H_DsmObject clDsmObjectHandle,
1563  /*O*/ E_DsmObjectKind *pKind );
1564 
1565 
1566 
1567 
1568 /*******************************************************************************
1569 * Close a loaded object
1570 *
1571 * NOTES:
1572 *
1573 * Closes the loaded object data. If an object is open this must be called
1574 * before it can be unloaded (via clDsmUnloadObject).
1575 *
1576 *
1577 * CALLBACKS THAT MAY BE INITIATED DURING THIS CALL:
1578 * none
1579 *
1580 * RETURNS:
1581 * CLDSM_OK (0)
1582 * CLDSM_ERR_INVALID_OBJECT_HANDLE
1583 * CLDSM_ERR_OBJECT_NOT_LOADED
1584 * CLDSM_ERR_OBJECT_NOT_OPEN
1585 * ?
1586 *
1587 *******************************************************************************/
1588 E_DscError CDSM_CloseObject( H_DsmCoreInst instance,
1589  /*I*/ H_DsmObject clDsmObjectHandle );
1590 
1591 
1597 H_DsmCoreInst CDSM_ObjectGetInstance(H_DsmObject clDsmObjectHandle);
1598 
1599 
1600 /*******************************************************************************
1601 * **** NB. ONLY CACHING RULE 'fromStream' CURRENTLY IMPLEMENTED ****
1602 *
1603 * Set caching rules for any (cached) object.
1604 *
1605 * Unless the carousel is specifed in the path, this will load an object from
1606 * the 'Current' object carousel. The client may specify another carousel by
1607 * setting the 'Current' object carousel with use of CDSM_SetCurrentCarousel().
1608 * If the path does specify a new carousel (as defined by "ETSI TS 102 851"),
1609 * then the function will attempt to load this carousel and make it the new
1610 * 'Current' object carousel.
1611 *
1612 * NOTES:
1613 *
1614 * If the object (OR ANY DIRECTORY ON THE PATH TO THE OBJECT) is not found in
1615 * the cache this command is ignored. Object load failure problems detected at
1616 * call time are not indicated.
1617 *
1618 * If the object is located in the cache the new caching rules are applied
1619 * immediately. If fromStream is set the object is deleted from the cache.
1620 *
1621 * If the object is found in the cache but it is currently loaded the current
1622 * caching rules for this object are set to the specified values (whatever they
1623 * were previously). If fromStream is set, the current object load instance is
1624 * marked for deletion, ie. it is no longer available to subsequent loads
1625 * (although the data is only physically deleted when the object is unloaded
1626 * via clDsmUnloadObject).
1627 *
1628 * Other caching rules are only applied when the object is unloaded.
1629 * If the same object is loaded multiple times in parallel, then these caching
1630 * rules are applied when the last of the object load instances is unloaded.
1631 * Any caching rules set by this call may get overriden if a subsequent parallel
1632 * load of the object that specifies higher priority caching rules is made.
1633 *
1634 * NB. For module based caching (as currently implemented) the whole module
1635 * inherits the caching rules MOST RECENTLY SPECIFIED for any object in that
1636 * module.
1637 *
1638 * The rules for when multiple objects from the same module are requested (or
1639 * loaded) in parallel are applied to a module on the same basis as described
1640 * for multiple instances of the same object.
1641 *
1642 *
1643 * CALLBACKS THAT MAY BE INITIATED DURING THIS CALL:
1644 * delSectionFilterFunc
1645 *
1646 * RETURNS:
1647 * CLDSM_OK (0)
1648 * CLDSM_ERR_INVALID_PATHNAME
1649 * CLDSM_ERR_INVALID_CACHING_RULES
1650 * CLDSM_ERR_INVALID_CAROUSEL_HANDLE
1651 * CLDSM_ERR_CAROUSEL_NOT_BOOTED
1652 * CLDSM_ERR_CAROUSEL_LOAD_FAILED
1653 * ?
1654 *
1655 *******************************************************************************/
1656 E_DscError CDSM_SetObjectCachingRules( H_DsmCoreInst instance,
1657  /*I*/ U8BIT *pathname, E_CacheRules cachingRules );
1658 
1659 
1660 
1661 /*******************************************************************************
1662 *
1663 * Request pre-fetch into cache of the specified object.
1664 *
1665 * Unless the carousel is specifed in the path, this will load an object from
1666 * the 'Current' object carousel. The client may specify another carousel by
1667 * setting the 'Current' object carousel with use of CDSM_SetCurrentCarousel().
1668 * If the path does specify a new carousel (as defined by "ETSI TS 102 851"),
1669 * then the function will attempt to load this carousel and make it the new
1670 * 'Current' object carousel.
1671 *
1672 * NOTES:
1673 *
1674 * The pre-fetch is always 'silent', ie. no notification is given when (or
1675 * whether) the object has been pre-fetched into the cache (ie. object load
1676 * failure errors detected at start time are also not indicated). If the object
1677 * is already in the cache then the pre-fetch request is ignored.
1678 *
1679 * Pre-fetches work like load requests (ie. they are always performed) but
1680 * if necessary, load requests (clDsmLoadObject) have priority on section filter
1681 * resources.
1682 *
1683 * If the object has to be fetched into the cache then it is given the default
1684 * caching rules (nb. fromStream is not set!).
1685 *
1686 * **** NOT YET IMPLEMENTED ****
1687 * If timeout value is set to zero it means no (ie. infinite) timeout. If a
1688 * timeout is specified and the object has not been pre-fetched in the specified
1689 * time (for any reason) then the pre-fetch request is abandoned (silently).
1690 * Timeout is expressed in periods of timerResolution (specified at
1691 * setup/create).
1692 *
1693 *
1694 * CALLBACKS THAT MAY BE INITIATED DURING THIS CALL:
1695 * addSectionFilterFunc
1696 * startTimerFunc
1697 * startSIQueryFunc
1698 *
1699 * RETURNS:
1700 * CLDSM_OK (0)
1701 * CLDSM_ERR_MEM_HEAP_FULL
1702 * CLDSM_ERR_INVALID_PATHNAME
1703 * CLDSM_ERR_INVALID_CAROUSEL_HANDLE
1704 * CLDSM_ERR_CAROUSEL_NOT_BOOTED
1705 * CLDSM_ERR_CAROUSEL_LOAD_FAILED
1706 * ?
1707 *
1708 *******************************************************************************/
1709 E_DscError CDSM_PrefetchObject( H_DsmCoreInst instance,
1710  /*I*/ U8BIT *pathname, U32BIT timeout );
1711 
1712 
1713 
1759 E_DscError CDSM_StreamEventSubscribe(
1760  /*I*/ H_DsmCoreInst dsmccInstance,
1761  /*I*/ H_DsmObject streamObject,
1762  /*I*/ U8BIT *eventName,
1763  /*I*/ void *userData1,
1764  /*I*/ void *userData2,
1765  /*O*/ H_DsmEvent *pEventHandle );
1766 
1767 
1783 E_DscError CDSM_StreamEventUnsubscribe(
1784  /*I*/ H_DsmCoreInst dsmccInstance,
1785  /*I*/ H_DsmEvent eventHandle );
1786 
1787 
1824 E_DscError CDSM_SpecialEventSubscribe(
1825  /*I*/ H_DsmCoreInst dsmccInstance,
1826  /*I*/ U16BIT associationTag,
1827  /*I*/ U16BIT eventId,
1828  /*I*/ void *userData1,
1829  /*I*/ void *userData2,
1830  /*O*/ H_DsmEvent *pEventHandle );
1831 
1832 
1845 E_DscError CDSM_SpecialEventUnsubscribe(
1846  /*I*/ H_DsmCoreInst dsmccInstance,
1847  /*I*/ H_DsmEvent eventHandle );
1848 
1849 
1850 
1851 /* ---------------------- ASYNCHRONOUS CLIENT API CALLS --------------------- */
1852 
1853 /*
1854 -- NOTES:
1855 --
1856 -- These functions can always be called asynchronously (ie. from a different
1857 -- task/thread) since they can only access an individual object/file data area
1858 -- which must have first been opened (& locked) by a previous synchronous API
1859 -- call.
1860 --
1861 */
1862 
1863 
1864 /*******************************************************************************
1865 * Get specified object kind (also returned by clDsmOpenObject)
1866 *
1867 * The object (clDsmObjectHandle) must be LOADED.
1868 *
1869 * NB. This can also be called to poll for when an object is loaded.
1870 *
1871 * RETURNS:
1872 * CLDSM_OK (0)
1873 * CLDSM_ERR_INVALID_OBJECT_HANDLE
1874 * CLDSM_ERR_OBJECT_NOT_LOADED
1875 *
1876 *******************************************************************************/
1877 E_DscError CDSM_ObjectGetKind(
1878  /*I*/ H_DsmObject clDsmObjectHandle,
1879  /*O*/ E_DsmObjectKind *pKind );
1880 
1881 
1882 
1883 /*******************************************************************************
1884 * Get specified object carousel handle.
1885 *
1886 * The object (clDsmObjectHandle) must be LOADED.
1887 *
1888 * NB. This can also be called to poll for when an object is loaded.
1889 *
1890 * RETURNS:
1891 * CLDSM_OK (0)
1892 * CLDSM_ERR_INVALID_OBJECT_HANDLE
1893 * CLDSM_ERR_INVALID_OBJECT_TYPE
1894 * CLDSM_ERR_OBJECT_NOT_LOADED
1895 *
1896 *******************************************************************************/
1897 E_DscError CDSM_ObjectGetCarouselHandle(
1898  /*I*/ H_DsmObject clDsmObjectHandle,
1899  /*O*/ void **hCarouselHandle );
1900 
1901 
1902 
1903 /* -- SERVICE GATEWAY ACCESS FUNCS -- */
1904 
1905 
1906 
1940 E_DscError CDSM_ObjectGetServiceContext(
1941  /*I*/ H_DsmObject clDsmObjectHandle,
1942  /*I*/ U32BIT serviceId,
1943  /*O*/ U8BIT **pSrvCtxtData,
1944  /*O*/ U32BIT *pSrvCtxtLen);
1945 
1946 
1947 /* -- FILE OBJECT ACCESS FUNCS -- */
1948 
1949 /*******************************************************************************
1950 * Get length of specified file data
1951 *
1952 * The file object (clDsmFileObjectHandle) must be LOADED and OPEN.
1953 *
1954 * RETURNS:
1955 * CLDSM_OK (0)
1956 * CLDSM_ERR_INVALID_OBJECT_HANDLE
1957 * CLDSM_ERR_INVALID_OBJECT_TYPE
1958 * CLDSM_ERR_OBJECT_NOT_LOADED
1959 * CLDSM_ERR_OBJECT_NOT_OPEN
1960 * ?
1961 *
1962 *******************************************************************************/
1963 E_DscError CDSM_FileGetSize(
1964  /*I*/ H_DsmObject clDsmFileObjectHandle,
1965  /*O*/ U32BIT *pSize );
1966 
1967 
1968 
1969 /*******************************************************************************
1970 * Read specified number of bytes of data from (opened) file into
1971 * destination address, starting at the current 'cursor' ('file' ptr) position.
1972 *
1973 * The file object (clDsmFileObjectHandle) must be LOADED and OPEN. The
1974 * destination memory area MUST be large enough to hold the numBytes requested.
1975 *
1976 * If call attempts to read past end of the file data it will read as many
1977 * bytes as possible and returns error code: CLDSM_ERR_END_OF_DATA
1978 *
1979 * Number of bytes read is stored in pNumBytesActual and 'cursor' position is
1980 * incremented by numBytesActual.
1981 *
1982 * RETURNS:
1983 * CLDSM_OK (0)
1984 * CLDSM_ERR_INVALID_OBJECT_HANDLE
1985 * CLDSM_ERR_INVALID_OBJECT_TYPE
1986 * CLDSM_ERR_OBJECT_NOT_LOADED
1987 * CLDSM_ERR_OBJECT_NOT_OPEN
1988 * CLDSM_ERR_END_OF_DATA
1989 * ?
1990 *
1991 *******************************************************************************/
1992 E_DscError CDSM_FileRead(
1993  /*I*/ H_DsmObject clDsmFileObjectHandle, U32BIT numBytes,
1994  /*O*/ U8BIT *pDest, U32BIT *pNumBytesActual );
1995 
1996 /*******************************************************************************
1997 * Returns pointer to file data and number of bytes in the file.
1998 *
1999 * The file object (clDsmFileObjectHandle) must be LOADED and OPEN. The
2000 * destination memory area MUST be large enough to hold the numBytes requested.
2001 *
2002 * Number of bytes read is stored in pNumBytesActual.
2003 *
2004 * RETURNS:
2005 * CLDSM_OK (0)
2006 * CLDSM_ERR_INVALID_OBJECT_HANDLE
2007 * CLDSM_ERR_OBJECT_NOT_LOADED
2008 *
2009 *******************************************************************************/
2010 E_DscError CDSM_FileDirect(
2011  /*I*/ H_DsmObject clDsmFileObjectHandle,
2012  /*O*/ U8BIT **ppDest, U32BIT *pNumBytesActual );
2013 
2014 
2015 /*******************************************************************************
2016 * Read single byte of data from (opened) file at current 'cursor' position
2017 * into destination and increment 'cursor' position.
2018 *
2019 * The file object (clDsmFileObjectHandle) must be LOADED and OPEN.
2020 *
2021 * If call attempts to read past end of the object data, returns error code:
2022 * CLDSM_ERR_END_OF_DATA
2023 *
2024 * RETURNS:
2025 * CLDSM_OK (0)
2026 * CLDSM_ERR_INVALID_OBJECT_HANDLE
2027 * CLDSM_ERR_INVALID_OBJECT_TYPE
2028 * CLDSM_ERR_OBJECT_NOT_LOADED
2029 * CLDSM_ERR_OBJECT_NOT_OPEN
2030 * CLDSM_ERR_END_OF_DATA
2031 * ?
2032 *
2033 *******************************************************************************/
2034 E_DscError CDSM_FileReadByte(
2035  /*I*/ H_DsmObject clDsmFileObjectHandle,
2036  /*O*/ U8BIT *pDest );
2037 
2038 
2039 
2040 /*******************************************************************************
2041 * Set absolute file data 'cursor' position
2042 *
2043 * The file object (clDsmFileObjectHandle) must be LOADED and OPEN.
2044 *
2045 * Cursor can point to any byte in file data AND to notional 'position'
2046 * immediately after last byte of data but setting to anywhere else will return
2047 * error code: CLDSM_ERR_END_OF_DATA
2048 *
2049 * RETURNS:
2050 * CLDSM_OK (0)
2051 * CLDSM_ERR_INVALID_OBJECT_HANDLE
2052 * CLDSM_ERR_INVALID_OBJECT_TYPE
2053 * CLDSM_ERR_OBJECT_NOT_LOADED
2054 * CLDSM_ERR_OBJECT_NOT_OPEN
2055 * CLDSM_ERR_END_OF_DATA
2056 * ?
2057 *
2058 *******************************************************************************/
2059 E_DscError CDSM_FileSetPosAbs(
2060  /*I*/ H_DsmObject clDsmFileObjectHandle, U32BIT absPosition );
2061 
2062 
2063 
2064 /*******************************************************************************
2065 * Set file data 'cursor' position relative to current position
2066 *
2067 * The file object (clDsmFileObjectHandle) must be LOADED and OPEN.
2068 *
2069 * Cursor can point to any byte in file data AND to notional 'position'
2070 * immediately after last byte of data but setting to anywhere else will return
2071 * error code: CLDSM_ERR_END_OF_DATA
2072 *
2073 * RETURNS:
2074 * CLDSM_OK (0)
2075 * CLDSM_ERR_INVALID_OBJECT_HANDLE
2076 * CLDSM_ERR_INVALID_OBJECT_TYPE
2077 * CLDSM_ERR_OBJECT_NOT_LOADED
2078 * CLDSM_ERR_OBJECT_NOT_OPEN
2079 * CLDSM_ERR_END_OF_DATA
2080 * ?
2081 *
2082 *******************************************************************************/
2083 E_DscError CDSM_FileSetPosRel(
2084  /*I*/ H_DsmObject clDsmFileObjectHandle, S32BIT relPosition );
2085 
2086 
2087 
2088 /*******************************************************************************
2089 * Read (absolute) file data 'cursor' position
2090 *
2091 * The file object (clDsmFileObjectHandle) must be LOADED and OPEN.
2092 *
2093 * Value returned in 'position' is the offset (in bytes) from the start (zero
2094 * position) of the file data to the current cursor position.
2095 *
2096 * If the current cursor position points to past the end of the file data, then
2097 * the position returned is equal to the file data size. Note that it is not
2098 * legal to _read_ data from this cursor position/offset.
2099 *
2100 * RETURNS:
2101 * CLDSM_OK (0)
2102 * CLDSM_ERR_INVALID_OBJECT_HANDLE
2103 * CLDSM_ERR_INVALID_OBJECT_TYPE
2104 * CLDSM_ERR_OBJECT_NOT_LOADED
2105 * CLDSM_ERR_OBJECT_NOT_OPEN
2106 * ?
2107 *
2108 *******************************************************************************/
2109 E_DscError CDSM_FileGetPos(
2110  /*I*/ H_DsmObject clDsmFileObjectHandle,
2111  /*O*/ U32BIT *pPosition );
2112 
2113 
2114 /* -- DIRECTORY ACCESS FUNCS -- */
2115 
2116 /*******************************************************************************
2117 *
2118 * The directory object (dirObj) must be LOADED and OPEN.
2119 *
2120 * Retrieves the total number of directory entries and the total length of all
2121 * entry names.
2122 *
2123 * RETURNS:
2124 * CLDSM_OK (0)
2125 * CLDSM_ERR_INVALID_OBJECT_HANDLE
2126 * CLDSM_ERR_INVALID_OBJECT_TYPE
2127 * CLDSM_ERR_OBJECT_NOT_LOADED
2128 * CLDSM_ERR_OBJECT_NOT_OPEN
2129 *
2130 *******************************************************************************/
2131 E_DscError CDSM_DirEntrySizes(
2132  /*I*/ H_DsmObject dirObj,
2133  /*O*/ U16BIT *nameCount,
2134  /*O*/ U16BIT *totalNameLength );
2135 
2136 /*******************************************************************************
2137 *
2138 * The directory object must be LOADED and OPEN.
2139 *
2140 * Retrieve the first entry handle
2141 *
2142 * RETURNS:
2143 * CLDSM_OK (0)
2144 * CLDSM_ERR_INVALID_OBJECT_HANDLE
2145 * CLDSM_ERR_INVALID_OBJECT_TYPE
2146 * CLDSM_ERR_OBJECT_NOT_LOADED
2147 * CLDSM_ERR_OBJECT_NOT_OPEN
2148 * CLDSM_ERR_END_OF_DATA
2149 *
2150 *******************************************************************************/
2151 E_DscError CDSM_DirEntryFirst(
2152  /*I*/ H_DsmObject dirObj,
2153  /*O*/ void **pFirstEntry );
2154 
2155 /*******************************************************************************
2156 *
2157 * Directory entry handle (entryHandle) is return by dsmDirEntryFirst or
2158 * dsmDirEntryNext.
2159 *
2160 * Retrieve the next entry handle
2161 *
2162 * RETURNS:
2163 * CLDSM_OK (0)
2164 * CLDSM_ERR_INTERNAL
2165 *
2166 *******************************************************************************/
2167 E_DscError CDSM_DirEntryNext(
2168  /*I*/ void *entryHandle,
2169  /*O*/ void **pNextEntry );
2170 
2171 /*******************************************************************************
2172 *
2173 * The directory entry handle is return by dsmDirEntryFirst or
2174 * dsmDirEntryNext.
2175 *
2176 * Retrieve name length
2177 *
2178 * RETURNS:
2179 * Length of name copied
2180 *
2181 *******************************************************************************/
2182 U16BIT CDSM_DirEntryNameLength(
2183  /*I*/ void *entryHandle );
2184 
2185 /*******************************************************************************
2186 *
2187 * The directory entry handle is return by dsmDirEntryFirst or
2188 * dsmDirEntryNext.
2189 *
2190 * Copy name for entry to supplied memory location (pName)
2191 * Caller should ensure there is enough space in location
2192 *
2193 * RETURNS:
2194 * Length of name copied
2195 *
2196 *******************************************************************************/
2197 U16BIT CDSM_DirEntryNameCopy(
2198  /*I*/ void *entryHandle,
2199  /*O*/ U8BIT *pName );
2200 
2201 /*******************************************************************************
2202 *
2203 * Get the kind of entry this is
2204 *
2205 * RETURNS:
2206 * E_DsmObjectKind
2207 *
2208 *******************************************************************************/
2209 E_DsmObjectKind CDSM_DirEntryKind( void *entryHandle );
2210 
2211 
2212 /* -- STREAM OBJECT ACCESS FUNCS -- */
2213 
2244 E_DscError CDSM_StreamGetDeferredService( H_DsmCoreInst instance,
2245  /*I*/ H_DsmObject streamObject, void *userData1, void *userData2,
2246  /*O*/ S_DvbLocator **ppDeferredService );
2247 
2248 /* -- STREAM EVENT ACCESS FUNCS -- */
2249 
2276 E_DscError CDSM_StreamEventNameList(
2277  /*I*/ H_DsmCoreInst dsmccInstance,
2278  /*I*/ H_DsmObject streamObject,
2279  /*O*/ U8BIT **pNamesPtr, U16BIT *pNamesLen );
2280 
2296 E_DscError CDSM_StreamEventXmlData(
2297  /*I*/ H_DsmCoreInst dsmccInstance,
2298  /*I*/ H_DsmObject streamObject,
2299  /*O*/ U8BIT **ppXmlData, U16BIT *pXmlLen);
2300 
2301 U32BIT CDSM_UtilCalculateCRC(U8BIT *msg, U32BIT len);
2302 
2303 /*----------------------------------------------------------------------------*/
2304 
2305 #ifdef __cplusplus
2306 }
2307 #endif
2308 #endif /* _DSMCC_H_ */
2309 
E_DscError CDSM_StreamEventNameList(H_DsmCoreInst dsmccInstance, H_DsmObject streamObject, U8BIT **pNamesPtr, U16BIT *pNamesLen)
The Client uses this function to request list of event names for stream object Before calling this fu...
Definition: streamEvent.c:1279
E_DscError CDSM_StreamGetDeferredService(H_DsmCoreInst instance, H_DsmObject streamObject, void *userData1, void *userData2, S_DvbLocator **ppDeferredService)
The Client calls this function to obtain the Association Tag which can be used to determine the PID o...
Definition: streamObject.c:141
E_DscError CDSM_SpecialEventUnsubscribe(H_DsmCoreInst dsmccInstance, H_DsmEvent eventHandle)
Same as clDsmStreamEventUnsubscribe - used in conjuction with clDsmSpecialEventSubscribe.
Definition: streamEvent.c:700
E_DscError CDSM_GetCarouselId(H_DsmCoreInst instance, H_DsmCarousel carouselHandle, U32BIT *pCarouselId)
Retrieve Carousel Id for the loaded DSM-CC Object Carousel.
E_DscError CDSM_CarouselUnloadFileGroups(H_DsmCoreInst instance, H_DsmCarousel clDsmCarouselHandle, S_CarouselInfoFileGroup *groups)
Release "File Group Info" data allocated by used by CDSM_CarouselLoadFileGroups() ...
H_DsmCoreInst CDSM_ObjectGetInstance(H_DsmObject clDsmObjectHandle)
Get DSM instance to which the object belongs.
H_DsmCarousel CDSM_CurrentCarousel(H_DsmCoreInst instance)
Retrieve handle to the current carousel for DSM-CC Instance.
void(* F_NotifyDeferredService)(void *userData1, void *userData2, S_DvbLocator *pDeferredService)
Called when request for deferred service of stream object has completed after clDsmStreamGetDeferredS...
Definition: cldsmcc.h:615
E_DscError CDSM_StreamEventXmlData(H_DsmCoreInst dsmccInstance, H_DsmObject streamObject, U8BIT **ppXmlData, U16BIT *pXmlLen)
The Client uses this function to request data in XML format for stream object and associated events...
Definition: streamEvent.c:1310
E_DscError CDSM_CarouselLoadFileGroups(H_DsmCoreInst instance, H_DsmCarousel clDsmCarouselHandle, U16BIT *total, S_CarouselInfoFileGroup **pGroups)
Retrieve from Object Carousel's User Info, the "File Group Info" used by Australia and South Africa M...
E_DscError CDSM_SetCurrentCarousel(H_DsmCoreInst instance, H_DsmCarousel carouselHandle)
Sets current carousel for DSM-CC Instance.
H_DsmControl CDSM_SysGetControl(H_DsmCoreInst instance)
Get control handle from DSM instance .
Definition: clDsmMain.c:532
E_DscError CDSM_SysProcessTimerEvent(H_DsmCoreInst instance, void *clDsmTmrUserData, E_TimerStatus status, void *timerHandle)
Definition: clDsmMain.c:916
E_DscError CDSM_UnloadModule(H_DsmCoreInst idp, H_DsmCarousel hCarousel, U32BIT moduleRef)
Unload SSU module. To be called once the client has finished saving this module data.
DSM-CC global types header Used by SI Query and Section Filter code.
E_DscError CDSM_SysProcessSIQueryEvent(H_DsmCoreInst instance, H_SIQueryRef clDsmSIQueryRef, void *clDsmSIUserData, P_SIQueryResult pResult)
Notifies the result of the specified SI query (ie. a callback to startSIQueryFunc that returned SIQUE...
Definition: clDsmMain.c:1034
E_DscError CDSM_LoadCarousel(H_DsmCoreInst instance, U16BIT service_id, U32BIT carousel_id, E_SIQueryKind kind, H_DsmCarousel *pclDsmCarouselHandle)
Request load of a DSM-CC Object Carousel (service domain).
E_DscError CDSM_UnloadObject(H_DsmCoreInst instance, H_DsmObject clDsmObjectHandle, E_DsmRstMode mode)
Unload (or cancel the requested load of) a DSM-CC object The client MUST first close and/or unsubscri...
void CDSM_SysSetMemoryMax(H_DsmCoreInst instance, U32BIT maxMemory)
Set maximum memory usage.
Definition: clDsmMain.c:772
E_DscError CDSM_UnloadCarousel(H_DsmCoreInst instance, H_DsmCarousel clDsmCarouselHandle, E_DsmRstMode mode)
Unload (or cancel the requested load of) a DSM-CC Object Carousel (service domain). The client MUST first unload all objects before calling this function (which implies it must also have previously closed and/or unsubscribed any events on any loaded objects). If there are any active object loads in the carousel when clDsmUnloadCarousel is called then the unload will not be executed and an error returned. If the carousel is in the process of loading and/or booting the load operation will be aborted (and the notifyCarouselLoadEventFunc callback made with status OC_LOAD_ABORTED_UNLOAD). Any carousel load request that returned a valid CDSM_CarouselHandle(ie. did not generate an error at clDsmLoadCarousel call time), must be explicitly unloaded via clDsmUnloadCarousel. This is necessary, whether the carousel was successfully loaded or the load was aborted due to timeout or error. Once unload is called for a carousel, the clDsmCarouselHandle is no longer valid and must not be used by the client/calling env. If it needs to access the carousel subsequently it must re-load it and get a new clDsmCarouselHandle value. To forcefully destroy loaded objects and/or carousels (eg. where the handles may be unknown/lost) then clDsmReset can be used with force switches. Note that this physically deletes them from the cache whereas unloading (objects or carousels) does not. CALLBACKS THAT MAY BE INITIATED DURING THIS CALL: delSectionFilterFunc stopTimerFunc stopSIQueryFunc unsubscribeSIChange notifyCarouselLoadEventFunc.
E_DscError CDSM_OpenObject(H_DsmCoreInst instance, H_DsmObject clDsmObjectHandle, E_DsmObjectKind *pKind)
Open object data for subsequent access via API functions for given object kind. The object must have ...
void(* F_NotifyStreamEvent)(H_DsmEvent eventHandle, E_SENotifyStatus status, void *userData1, void *userData2, U8BIT *namePtr, U8BIT *dataPtr, U8BIT namelen, U8BIT dataLen)
The Client defines this function to enable the DSMCC to communicate to the Client when any subscribed...
Definition: cldsmcc.h:594
E_DscError CDSM_StreamEventUnsubscribe(H_DsmCoreInst dsmccInstance, H_DsmEvent eventHandle)
This function is called by the Client to let DSMCC know when a previously subscribed stream event is ...
Definition: streamEvent.c:638
E_DscError CDSM_SysSetCurrService(H_DsmCoreInst instance, U16BIT original_network_id, U16BIT transport_stream_id, U16BIT service_id)
Set/notify the current service (initially and when changing it). This MUST be called initially (ie...
Definition: clDsmMain.c:819
E_DscError CDSM_StreamEventSubscribe(H_DsmCoreInst dsmccInstance, H_DsmObject streamObject, U8BIT *eventName, void *userData1, void *userData2, H_DsmEvent *pEventHandle)
The Client uses this function to request that the DSMCC notifies it when a named stream event occurs...
Definition: streamEvent.c:329
E_DscError CDSM_SysReset(H_DsmCoreInst instance, E_DsmRstMode mode)
Reset DSM-CC Core Layer instance. Resets conditions to the same state as after CDSM_SysCreate(ie. keeps setup parameters). In normal operation the client MUST first unsubscribe all events, close and and unload all objects and unload all carousels before calling this function. This will have also stopped/deleted all associated system resources (ie. SI queries, timers, SI change monitors, section filters). If any client transactions or system transactions are still active when clDsmReset is called the reset will not be executed and an error returned. NB. The calling environment (system side) must acknowledge stop commands for SI Queries and timers (via processSIQueryEvent, processTimerEvent) and that these may occur asynchronously (ie. after a delay). This means that there may still be some active system transactions for some time after all objects and carousels are unloaded. FORCING RESET IN ERROR CONDITIONS: If all client and system transactions are apparently completed but still returns an error (eg. because handles are unknown/lost or system resource stop requests are not acknowledged) then clDsmReset can be called with appropriate force switches to clear the error condition. Any client transaction errors must first be cleared before system transaction errors can be cleared and both force switches cannot be set at the same time. NB. Only use force switches in known error conditions. It is potentially fatal (may cause illegal memory access) to call the functions: streamEventUnsubscribe, unloadObject, unloadCarousel, processSIQueryEvent, processTimerEvent with old/stale handles after clDsmReset has been forced. CALLBACKS THAT MAY BE INITIATED DURING THIS CALL: deleteSectionFilter stopTimer stopSIQuery unsubscribeSIChange.
Definition: clDsmMain.c:669
E_DscError CDSM_SysDestroy(H_DsmCoreInst instance, H_SiqInstance *pSiqInst, H_SfmInstance *pSfmInst)
Destroy DSM-CC Core Layer instance. De-allocates all 'static' memory used by the instance (via freeFu...
Definition: clDsmMain.c:467
E_DscError CDSM_SysProcessSIChangeEvent(H_DsmCoreInst instance, E_SIChangeEvent evnt, U16BIT service_id, U32BIT carousel_id)
Notify that the SI for the indicated service has changed Changes should be notified in the following ...
Definition: clDsmMain.c:1113
Define standard function types.
E_DscError CDSM_ObjectGetServiceContext(H_DsmObject clDsmObjectHandle, U32BIT serviceId, U8BIT **pSrvCtxtData, U32BIT *pSrvCtxtLen)
This function gets service context of DSM object (if available) Need by MHEG5 for specified service g...
E_DscError CDSM_SpecialEventSubscribe(H_DsmCoreInst dsmccInstance, U16BIT associationTag, U16BIT eventId, void *userData1, void *userData2, H_DsmEvent *pEventHandle)
Like clDsmStreamEventSubscribe, except that no stream object is required. This function subscribes to...
Definition: streamEvent.c:504