DVBCore  20.3.0
DVBCore Documentation
ap_cihc.c
Go to the documentation of this file.
1 /*******************************************************************************
2  * Copyright © 2016 The DTVKit Open Software Foundation Ltd (www.dtvkit.org)
3  *
4  * This file is part of a DTVKit Software Component
5  * You are permitted to copy, modify or distribute this file subject to the terms
6  * of the DTVKit 1.0 Licence which can be found in licence.txt or at www.dtvkit.org
7  *
8  * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
9  * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES
10  * OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
11  *
12  * If you or your organisation is not a member of DTVKit then you have access
13  * to this source code outside of the terms of the licence agreement
14  * and you are expected to delete this and any associated files immediately.
15  * Further information on DTVKit, membership and terms can be found at www.dtvkit.org
16  *******************************************************************************/
24 //---includes for this file----------------------------------------------------
25 // compiler library header files
26 
27 #include <stdio.h>
28 #include <string.h>
29 
30 // third party header files
31 
32 // Ocean Blue Software header files
33 #include "techtype.h"
34 #include "dbgfuncs.h"
35 
36 #include "stbhwos.h"
37 
38 #include "stberc.h"
39 #include "stbheap.h"
40 
41 #include "ap_dbdef.h"
42 #include "ap_cntrl.h"
43 
44 #include "stbci.h"
45 #include "stbcicc.h"
46 #include "ap_ci_int.h"
47 #include "ap_ci_support.h"
48 #include "ap_cihc.h"
49 
50 //---constant definitions for this file----------------------------------------
51 
52 #define DEBUG_HC
53 #ifdef DEBUG_HC
54 #define DBG_HC(x, ...) STB_SPDebugWrite( "%s:%d " x, __FUNCTION__, __LINE__, ##__VA_ARGS__);
55 #else
56 #define DBG_HC(x, ...)
57 #endif
58 
59 #define DBG_ERR(x, ...) STB_SPDebugWrite( "ERROR %s:%d" x, __FUNCTION__, __LINE__, ##__VA_ARGS__);
60 
61 #define DTAG_DEL_SYS_DVBT 0x5a
62 #define DTAG_DEL_SYS_DVBT2 0x04
63 #define DTAG_DEL_SYS_DVBC 0x44
64 #define DTAG_DEL_SYS_DVBC2 0x0d
65 #define DTAG_DEL_SYS_DVBS 0x43
66 #define DTAG_DEL_SYS_DVBS2 0x79
67 #define DTAG_EXT_DESC 0x7f
68 
69 //---local typedefs, structs, enumerations for this file--------------------------------------------
70 
71 
72 typedef struct s_hc_status
73 {
74  struct s_hc_status *next;
75  U32BIT module;
76  BOOLEAN tune_started;
77  BOOLEAN ask_release;
78  BOOLEAN disabled;
79 } S_HC_STATUS;
80 
81 //---local (static) variable declarations for this file------------------------
82 // (internal variables declared static to make them local)
83 
84 static S_HC_STATUS *cihc_list = NULL;
85 static void *cihc_mutex;
86 
87 //---local function prototypes for this file-----------------------------------
88 // (internal functions declared static to make them local)
89 
90 static S_HC_STATUS *FindHcState(U32BIT module);
91 static void* FindService(U16BIT net_id, U16BIT onet_id, U16BIT ts_id, U16BIT sid);
92 static void* FindTransport(U16BIT net_id, U16BIT onet_id, U16BIT ts_id);
93 
94 //----------------------------------------------------------------------------
95 //--- Global function for this file ------------------------------------------
96 //----------------------------------------------------------------------------
97 
102 {
103  cihc_mutex = STB_OSCreateMutex();
104 }
105 
119 {
120  S_HC_STATUS *hc_state;
121  U8BIT path;
122  S_ACTL_OWNER_INFO owner_info;
123 
124  FUNCTION_START(ACI_HcNotifyHostControlSession);
125 
126  if (FindHcState(module) != NULL)
127  {
128  DBG_ERR("(%u) HC module already exists", module)
129  }
130  else
131  {
132  hc_state = STB_GetMemory(sizeof(S_HC_STATUS));
133  if (hc_state == NULL)
134  {
135  DBG_ERR("(%u) Memory alloc failed", module)
136  }
137  else
138  {
139  hc_state->module = module;
140  hc_state->tune_started = FALSE;
141  hc_state->ask_release = FALSE;
142  hc_state->next = cihc_list;
143  cihc_list = hc_state;
144 
145  if ((path = STB_DPGetLivePath()) != INVALID_RES_ID)
146  {
147  /* Tune the live path to the service requested by CI+ */
148  owner_info.owner = RES_OWNER_CIPLUS;
149  owner_info.data = &module;
150  owner_info.data_size = sizeof(module);
151 
152  if (ACTL_AcquirePathOwnership(path, &owner_info))
153  {
154  /* Ownership of the live path has been acquired */
155  DBG_HC("(%u): Acquired ownership of path %u", module, path)
156  }
157  else
158  {
159  /* Ownership of the live path has been denied */
160  DBG_HC("(%u): Couldn't acquire ownership of path %u", module, path)
161  }
162  }
163  else
164  {
165  /* No live path available, which means the CI stack will be able to take ownership
166  * of the tuner if it issues a tune request, so ownership can be deferred */
167  DBG_HC("(%u): No live path", module)
168  }
169  }
170  }
171 
172  FUNCTION_FINISH(ACI_HcNotifyHostControlSession);
173 }
174 
185 {
186  S_HC_STATUS *hc_state;
187  S_HC_STATUS **phc_state;
188 
189  FUNCTION_START(ACI_HcNotifyHostControlSessionClosed);
190 
191  phc_state= &cihc_list;
192  hc_state = cihc_list;
193  while (hc_state != NULL)
194  {
195  if (hc_state->module == module)
196  {
197  U8BIT path;
198  for (path = 0; path != STB_DPGetNumPaths(); path++)
199  {
200  if (ACI_PathOwnedByModule(path, module))
201  {
202  /* Release ownership of this path */
203  DBG_HC("(%u): Releasing ownership of path %u (slot_id=%u)", module, path, STB_DPGetPathCISlot(path))
204  ACTL_ReleasePathOwnership(path, RES_OWNER_CIPLUS);
205  if (hc_state->ask_release)
206  {
207  S_CIP_RELEASE_REPLY reply_data;
208  /* The host has asked the module to release host control, but the module hasn't
209  * replied and is now closing the session, so respond to the release request first */
210  reply_data.module = module;
211  reply_data.reply = 0;
212  reply_data.path = path;
213  STB_ERSendEvent(FALSE, FALSE, EV_CLASS_CI, EV_TYPE_CI_RELEASE_REPLY, &reply_data, sizeof(reply_data));
214  }
215  }
216  }
217 
218  *phc_state = hc_state->next;
219  STB_FreeMemory(hc_state);
220  break;
221  }
222  phc_state = &(hc_state->next);
223  hc_state = hc_state->next;
224  }
225 
226  FUNCTION_FINISH(ACI_HcNotifyHostControlSessionClosed);
227 }
228 
229 
236 BOOLEAN ACI_HcAskRelease(U32BIT module)
237 {
238  S_HC_STATUS *hc_state;
239  BOOLEAN retval;
240 
241  FUNCTION_START(ACI_HcAskRelease);
242 
243  DBG_HC("(%u)", module)
244 
245  hc_state = FindHcState(module);
246  if (hc_state != NULL)
247  {
248  if (!hc_state->ask_release)
249  {
250  hc_state->ask_release = TRUE;
251  retval = STB_CIAskRelease(module);
252  }
253  else
254  {
255  DBG_HC("(%u): already asked to release HC session", module)
256  retval = TRUE;
257  }
258  }
259  else
260  {
261  retval = FALSE;
262  }
263 
264  FUNCTION_FINISH(ACI_HcAskRelease);
265 
266  return(retval);
267 }
268 
278 void ACI_HcAskReleaseReply(U32BIT module, U8BIT release_reply)
279 {
280  S_HC_STATUS *hc_state;
281  S_CIP_RELEASE_REPLY reply_data;
282  U8BIT path;
283 
284  FUNCTION_START(ACI_HcAskReleaseReply);
285 
286  DBG_HC("(%u, reply=%u)", module, release_reply)
287 
288  hc_state = FindHcState(module);
289  if (hc_state != NULL)
290  {
291  if (!hc_state->ask_release)
292  {
293  DBG_HC("(%u): Host hasn't asked for release", module)
294  }
295 
296  for (path = 0; path != STB_DPGetNumPaths(); path++)
297  {
298  if (ACI_PathOwnedByModule(path, module))
299  {
300  reply_data.path = path;
301  reply_data.module = module;
302  reply_data.reply = release_reply;
303 
304  STB_ERSendEvent(FALSE, FALSE, EV_CLASS_CI, EV_TYPE_CI_RELEASE_REPLY, &reply_data, sizeof(reply_data));
305  }
306  }
307  hc_state->ask_release = FALSE;
308  }
309 
310  FUNCTION_FINISH(ACI_HcAskReleaseReply);
311 }
312 
321 void ACI_HcTune(U32BIT module, U16BIT nid, U16BIT onid, U16BIT tsid, U16BIT sid)
322 {
323  S_HC_STATUS *hc_state;
324  void *target;
325 
326  FUNCTION_START(ACI_HcTune);
327 
328  DBG_HC("(%u, nid=%u, onid=%u, tid=%u, sid=%u)", module, nid, onid, tsid, sid)
329 
330  hc_state = FindHcState(module);
331  if (hc_state == NULL)
332  {
333  DBG_ERR("(%u): host control module not recognised",module)
334  STB_CITuneReply(module, STB_CI_TUNE_BAD_PARAMETER);
335  }
336  else
337  {
338  if (hc_state->tune_started)
339  {
340  /* Tuner is already in use */
341  DBG_HC("(%u): Tuner is already tuning", module)
342  STB_CITuneReply(module, STB_CI_TUNE_TUNER_BUSY);
343  }
344  else
345  {
346  if (sid == 0)
347  {
348  target = FindTransport(nid, onid, tsid);
349  if (target == NULL)
350  {
351  DBG_HC("(%u): Failed to find transport", module)
352  STB_CITuneReply(module, STB_CI_TUNE_SERVICE_NOT_FOUND);
353  }
354  else
355  {
356  hc_state->tune_started = TRUE;
357  ACI_TuneToTransport(module, target);
358  }
359  }
360  else
361  {
362  target = FindService(nid, onid, tsid, sid);
363  if (target == NULL)
364  {
365  DBG_HC("(%u): Failed to find service", module)
366  STB_CITuneReply(module, STB_CI_TUNE_SERVICE_NOT_FOUND);
367  }
368  else
369  {
370  hc_state->tune_started = TRUE;
371  ACI_TuneToService(module, target, CIP_NORMAL_TUNE);
372  }
373  }
374  }
375  }
376 
377  FUNCTION_FINISH(ACI_HcTune);
378 }
379 
396 void ACI_HcTuneBroadcastRequest(U32BIT module, U16BIT service_id,
397  U16BIT desc_loop_len, U8BIT *desc_loop, U8BIT *pmt, E_CIP_TUNE_FLAGS flags)
398 {
399  S_HC_STATUS *hc_state;
400  U8BIT dtag;
401  U8BIT dlen;
402  S_CIP_TUNE_DEL_SYS_DESC tune_del_sys;
403  BOOLEAN tune_valid;
404  SI_STRING_DESC *provider;
405 
406  FUNCTION_START(ACI_HcTuneBroadcastRequest);
407 
408  DBG_HC("(%u, service_id=%u, desc_loop_len=%u, pmt=%p)", module, service_id, desc_loop_len, pmt)
409 
410  hc_state = FindHcState(module);
411  if (hc_state != NULL)
412  {
413  if (!hc_state->tune_started)
414  {
415  if ((desc_loop_len > 0) && (desc_loop != NULL))
416  {
417  tune_valid = TRUE;
418 
419  if (pmt != NULL)
420  {
421  /* Check that the PMT is for the requested service ... */
422  if ((service_id == 0) || (service_id != ((pmt[3] << 8) + pmt[4])) ||
423  /* ... and that the CICAM has authenticated */
424  !STB_CiCcAuthenticated(STB_GetCIHostControlSlotId(module)))
425  {
426  STB_CITuneReply(module, STB_CI_TUNE_BAD_PARAMETER);
427  tune_valid = FALSE;
428  }
429  }
430 
431  if (tune_valid)
432  {
433  memset(&tune_del_sys, 0, sizeof(tune_del_sys));
434  while ((desc_loop_len > 0) && tune_valid)
435  {
436  dtag = desc_loop[0];
437 
438  /* Descriptor length is +2 to allow for the tag and length bytes */
439  dlen = desc_loop[1] + 2;
440 
441  switch (dtag)
442  {
443  case DTAG_DEL_SYS_DVBT: /* Terrestrial delivery descriptor */
444  case DTAG_DEL_SYS_DVBS: /* Satellite delivery descriptor */
445  case DTAG_DEL_SYS_DVBC: /* Cable delivery descriptor */
446  {
447  DBG_HC("%s delivery descriptor", (dtag == DTAG_DEL_SYS_DVBT) ? "DTAG_DEL_SYS_DVBT" :
448  (dtag == DTAG_DEL_SYS_DVBS) ? "DTAG_DEL_SYS_DVBS" :
449  (dtag == DTAG_DEL_SYS_DVBC) ? "DTAG_DEL_SYS_DVBC" : "Unknown")
450  if (tune_del_sys.desc == NULL)
451  {
452  if (!STB_SIParseDelSysDesc(desc_loop, &tune_del_sys.type,
453  &tune_del_sys.desc))
454  {
455  DBG_HC("could not parse delivery descriptor")
456  STB_CITuneReply(module, STB_CI_TUNE_BAD_PARAMETER);
457  tune_valid = FALSE;
458  }
459  }
460  else
461  {
462  /* Already have a delivery descriptor, so skip this one */
463  DBG_HC("(%u): Skipping additional delivery desc, dtag=0x%02x", module, dtag)
464  }
465  break;
466  }
467 
468  case 0x48: /* Service descriptor */
469  DBG_HC("(%u): Service desc", module)
470  if (STB_SIParseServiceDescriptor(desc_loop, &tune_del_sys.service_type, &provider,
471  &tune_del_sys.service_name))
472  {
473  /* Provider string isn't used so free it */
474  if (provider != NULL)
475  {
476  STB_SIReleaseStringDesc(provider);
477  }
478  }
479  break;
480 
481  case 0x4d: /* Short event descriptor */
482  DBG_HC("(%u): Short event desc", module)
483  tune_del_sys.event_desc = (ADB_EVENT_DESC *)STB_AppGetMemory(sizeof(ADB_EVENT_DESC) + dlen);
484  if (tune_del_sys.event_desc != NULL)
485  {
486  tune_del_sys.event_desc->desc_data = (U8BIT *)(tune_del_sys.event_desc + 1);
487  memcpy(tune_del_sys.event_desc->desc_data, desc_loop, dlen);
488  tune_del_sys.event_desc->next = NULL;
489  }
490  //STB_SIParseShortEventDescriptor(desc_loop, &tune_del_sys.event_desc);
491  break;
492 
493  case 0x50: /* Component descriptor */
494  DBG_HC("(%u): Component desc", module)
495  break;
496 
497  case 0x55: /* Parental rating descriptor */
498  DBG_HC("(%u): Parental rating desc", module)
499  break;
500 
501  case 0x54: /* Content descriptor */
502  DBG_HC("(%u): Content desc", module)
503  break;
504 
505  default:
506  /* Skip the unhandled descriptor */
507  DBG_HC("Skipping unhandled descriptor 0x%02x, len %u bytes", dtag, dlen);
508  break;
509  }
510 
511  desc_loop += dlen;
512  desc_loop_len -= dlen;
513  }
514 
515  if (tune_valid)
516  {
517  hc_state->tune_started = TRUE;
518 
519  tune_del_sys.service_id = service_id;
520  tune_del_sys.pmt = pmt;
521 
522  ACI_TuneToDelSysDesc(module, &tune_del_sys, flags);
523  }
524  }
525  }
526  else
527  {
528  DBG_ERR("(%u): descriptor loop invalid (%p,%u)",module, desc_loop, desc_loop_len)
529  STB_CITuneReply(module, STB_CI_TUNE_BAD_PARAMETER);
530  }
531  }
532  else
533  {
534  DBG_HC("(%u): Tuner is already tuning", module)
535  STB_CITuneReply(module, STB_CI_TUNE_TUNER_BUSY);
536  }
537  }
538  else
539  {
540  DBG_ERR("(%u): host control module not recognised",module)
541  STB_CITuneReply(module, STB_CI_TUNE_BAD_PARAMETER);
542  }
543 
544  FUNCTION_FINISH(ACI_HcTuneBroadcastRequest);
545 }
546 
553 void ACI_HcTuneService(U32BIT module, void *s_ptr, E_CIP_TUNE_FLAGS flags)
554 {
555  S_HC_STATUS *hc_state;
556 
557  FUNCTION_START(ACI_HcTuneService);
558 
559  DBG_HC("(%u, lcn=%u, flgs=%x)", module, ADB_GetServiceLcn(s_ptr), flags)
560 
561  hc_state = FindHcState(module);
562  if (hc_state == NULL)
563  {
564  DBG_ERR("(%u): host control module not recognised",module)
565  STB_CITuneReply(module, STB_CI_TUNE_BAD_PARAMETER);
566  }
567  else
568  {
569  if (hc_state->tune_started)
570  {
571  /* Tuner is already in use */
572  DBG_HC("(%u): Tuner is already tuning", module)
573  STB_CITuneReply(module, STB_CI_TUNE_TUNER_BUSY);
574  }
575  else
576  {
577  hc_state->tune_started = TRUE;
578  ACI_TuneToService(module, s_ptr, flags);
579  }
580  }
581 
582  FUNCTION_FINISH(ACI_HcTuneService);
583 }
584 
591 BOOLEAN ACI_HcTuneReply(U32BIT module, E_STB_CI_TUNE_STATUS status)
592 {
593  S_HC_STATUS *hc_state;
594  BOOLEAN retval;
595 
596  FUNCTION_START(ACI_HcTuneReply);
597 
598  DBG_HC("(mod=%u, status=%u)", module, status)
599 
600  hc_state = FindHcState(module);
601  if (hc_state != NULL)
602  {
603  retval = TRUE;
604  if (hc_state->tune_started)
605  {
606  hc_state->tune_started = FALSE;
607  DBG_HC("(%u, status=%s)", module,
608  (status == STB_CI_TUNE_OK) ? "CIP_TUNER_LOCKED" :
609  (status == STB_CI_TUNE_TUNER_NOT_LOCKING) ? "CIP_TUNER_NOTLOCKED" :
610  (status == STB_CI_TUNE_TUNER_BUSY) ? "CIP_TUNER_BUSY" :
611  (status == STB_CI_TUNE_UNSUPPORTED_SYSTEM) ? "CIP_TUNER_UNSUPPORTED_SYSTEM" :
612  (status == STB_CI_TUNE_BAD_PARAMETER) ? "CIP_TUNER_BAD_PARAM" :
613  (status == STB_CI_TUNE_SERVICE_NOT_FOUND) ? "CIP_TUNER_SERVICE_NOT_FOUND" :
614  (status == STB_CI_TUNE_UNDEFINED_ERROR) ? "CIP_TUNER_UNDEFINED_ERROR" : "unknown (returning UNDEFINED_ERROR)")
615  (void)STB_CITuneReply(module, status);
616  }
617  else
618  {
619  DBG_HC("(%u): already asked to release HC session", module)
620  }
621  }
622  else
623  {
624  retval = FALSE;
625  }
626 
627  FUNCTION_FINISH(ACI_HcTuneReply);
628 
629  return(retval);
630 }
631 
632 //----------------------------------------------------------------------------
633 //--- Local function for this file ------------------------------------------
634 //----------------------------------------------------------------------------
635 
641 static S_HC_STATUS *FindHcState(U32BIT module)
642 {
643  S_HC_STATUS *hc_state;
644  STB_OSMutexLock(cihc_mutex);
645  hc_state = cihc_list;
646  while (hc_state != NULL)
647  {
648  if (module == hc_state->module)
649  {
650  if (hc_state->disabled)
651  {
652  hc_state = NULL;
653  }
654  break;
655  }
656  hc_state = hc_state->next;
657  }
658  STB_OSMutexUnlock(cihc_mutex);
659  return hc_state;
660 }
661 
670 static void* FindService(U16BIT net_id, U16BIT onet_id, U16BIT ts_id, U16BIT sid)
671 {
672  ADB_SERVICE_REC *service;
673 
674  FUNCTION_START(FindService);
675 
677  service = DBDEF_GetNextServiceRec(NULL);
678  while (service != NULL)
679  {
680  /* Network id 0 is used as a wildcard */
681  if ((service->serv_id == sid) &&
682  (service->transport->tran_id == ts_id) &&
683  (service->transport->orig_net_id == onet_id) &&
684  ((net_id == 0) || (service->transport->network->net_id == net_id)))
685  {
686  break;
687  }
688  service = DBDEF_GetNextServiceRec(service);
689  }
691 
692  FUNCTION_FINISH(FindService);
693 
694  return service;
695 }
696 
704 static void* FindTransport(U16BIT net_id, U16BIT onet_id, U16BIT ts_id)
705 {
706  ADB_TRANSPORT_REC *transport;
707 
708  FUNCTION_START(FindTransport);
709 
711  transport = DBDEF_GetNextTransportRec(NULL);
712  while (transport != NULL)
713  {
714  /* Network id 0 is used as a wildcard */
715  if ((transport->tran_id == ts_id) &&
716  (transport->orig_net_id == onet_id) &&
717  ((net_id == 0) || (transport->network->net_id == net_id)))
718  {
719  break;
720  }
721  transport = DBDEF_GetNextTransportRec(transport);
722  }
724 
725  FUNCTION_FINISH(FindTransport);
726 
727  return transport;
728 }
729 
void ACI_HcTuneService(U32BIT module, void *s_ptr, E_CIP_TUNE_FLAGS flags)
Handle tune to service request from the CAM.
Definition: ap_cihc.c:553
CI plus support functions.
void * STB_GetMemory(U32BIT bytes)
Attempts to allocate memory from the heap.
Definition: stbheap.c:221
U8BIT STB_DPGetPathCISlot(U8BIT path)
Returns the CI slot id associated with the given path.
Definition: stbdpc.c:1082
BOOLEAN STB_CiCcAuthenticated(U8BIT slot_id)
Tell whether authenticated CI+ module is in the slot.
Definition: stbcicc.c:374
Application database control.
BOOLEAN ACI_PathOwnedByModule(U8BIT path, U32BIT module)
Checks whether path is owned by CI module.
Definition: ap_ci.c:2324
void * STB_AppGetMemory(U32BIT bytes)
Attempts to allocate memory from the application heap.
Definition: stbheap.c:651
BOOLEAN ACI_HcAskRelease(U32BIT module)
Ask the module to restore replaced PIDs and to close the session with the host control resource...
Definition: ap_cihc.c:236
void STB_SIReleaseStringDesc(SI_STRING_DESC *desc)
Frees the memory used by the descriptor specified.
Definition: stbsitab.c:12040
BOOLEAN ACI_HcTuneReply(U32BIT module, E_STB_CI_TUNE_STATUS status)
Send status of tune operation to the CAM host control module.
Definition: ap_cihc.c:591
void ACI_HcInitialise(void)
Initialise CI Host Control support.
Definition: ap_cihc.c:101
void ACI_TuneToService(U32BIT module, void *s_ptr, E_CIP_TUNE_FLAGS flags)
Schedule a tune to a service.
Definition: ap_ci.c:2020
void ACI_TuneToDelSysDesc(U32BIT module, S_CIP_TUNE_DEL_SYS_DESC *tune, E_CIP_TUNE_FLAGS flags)
Tune to a service/transport defined by a delivery system descriptor, possibly with PMT data...
Definition: ap_ci.c:2044
void STB_OSMutexUnlock(void *mutex)
Unlock a mutex (a.k.a. &#39;leave&#39;, &#39;signal&#39; or &#39;release&#39;)
void STB_ERSendEvent(BOOLEAN latched, BOOLEAN repeat, U16BIT path_class, U16BIT type, void *data, U32BIT data_size)
Sends an event to event reporting control module.
Definition: stberc.c:571
Application level CI Host Control functions.
CI Content Control.
U8BIT STB_DPGetNumPaths(void)
Returns the maximum number of decode paths.
Definition: stbdpc.c:532
U8BIT STB_DPGetLivePath(void)
Returns the ID of the decode path being used for live viewing.
Definition: stbdpc.c:1271
ADB_TRANSPORT_REC * DBDEF_GetNextTransportRec(ADB_TRANSPORT_REC *t_ptr)
Returns the transport following the one given. If the argument is NULL then the first transport will ...
Definition: ap_dbdef.c:4842
void STB_FreeMemory(void *addr)
Releases previously allocated heap memory.
Definition: stbheap.c:336
BOOLEAN STB_SIParseDelSysDesc(U8BIT *data, SI_DELIVERY_SYS_DESC_TYPE *type, SI_DELIVERY_SYS_DESC **desc)
Parses and allocates a system delivery descriptor which should be freed by calling STB_SIReleaseDelSy...
Definition: stbsitab.c:11071
BOOLEAN STB_SIParseServiceDescriptor(U8BIT *data, U8BIT *type, SI_STRING_DESC **provider, SI_STRING_DESC **name)
Parses a service descriptor, tag 0x48, allocating SI strings that must be freed using STB_SIReleaseSt...
Definition: stbsitab.c:11148
void DBDEF_ReleaseAccess(void)
Releases access to the app&#39;s database.
Definition: ap_dbdef.c:245
U16BIT ADB_GetServiceLcn(void *s_ptr)
Returns the logical channel number assigned to the given service.
Definition: ap_dbacc.c:4940
Debug functions header file.
void STB_OSMutexLock(void *mutex)
Lock a mutex (a.k.a. &#39;enter&#39;, &#39;wait&#39; or &#39;get&#39;).
ADB_SERVICE_REC * DBDEF_GetNextServiceRec(ADB_SERVICE_REC *s_ptr)
Returns the service after the one given. If NULL is passed then the first service in the list is retu...
Definition: ap_dbdef.c:5535
Application level CI - internal functions.
Header file - Function prototypes for Event Reporting.
void DBDEF_RequestAccess(void)
Requests access to the app&#39;s database.
Definition: ap_dbdef.c:235
void ACI_HcTune(U32BIT module, U16BIT nid, U16BIT onid, U16BIT tsid, U16BIT sid)
Handle Tune request from the CAM.
Definition: ap_cihc.c:321
Application stb layer control.
Header file - Function prototypes for operating system.
System Wide Global Technical Data Type Definitions.
void ACI_HcTuneBroadcastRequest(U32BIT module, U16BIT service_id, U16BIT desc_loop_len, U8BIT *desc_loop, U8BIT *pmt, E_CIP_TUNE_FLAGS flags)
This function is used by the CI+ stack to request that the host tunes to a transport stream using the...
Definition: ap_cihc.c:396
void ACI_HcNotifyHostControlSessionClosed(U32BIT module)
This function is used by the CI stack to notify the host that a session with the host control resourc...
Definition: ap_cihc.c:184
BOOLEAN ACTL_ReleasePathOwnership(U8BIT path, E_STB_DP_RES_OWNER owner)
Releases ownership of the path, and frees any associated data, if the given owner is the path&#39;s owner...
Definition: ap_cntrl.c:5011
void ACI_TuneToTransport(U32BIT module, void *t_ptr)
Schedule a tune to a transport.
Definition: ap_ci.c:2000
void ACI_HcAskReleaseReply(U32BIT module, U8BIT release_reply)
This function is called by the CI+ stack to send the reply of a release request to the host...
Definition: ap_cihc.c:278
Header file - Function prototypes for heap memory.
void ACI_HcNotifyHostControlSession(U32BIT module)
This function is used by the CI stack to notify the host that a session with the host countrol resour...
Definition: ap_cihc.c:118
void * STB_OSCreateMutex(void)
Create a mutex.
BOOLEAN ACTL_AcquirePathOwnership(U8BIT path, S_ACTL_OWNER_INFO *owner_info)
Attempts to take ownership of the given path (used by CI+)
Definition: ap_cntrl.c:4978