DVBCore  20.3.0
DVBCore Documentation
stberc.c
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  *
5  * This file is part of a DTVKit Software Component
6  * You are permitted to copy, modify or distribute this file subject to the terms
7  * of the DTVKit 1.0 Licence which can be found in licence.txt or at www.dtvkit.org
8  *
9  * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
10  * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES
11  * OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
12  *
13  * If you or your organisation is not a member of DTVKit then you have access
14  * to this source code outside of the terms of the licence agreement
15  * and you are expected to delete this and any associated files immediately.
16  * Further information on DTVKit, membership and terms can be found at www.dtvkit.org
17  *******************************************************************************/
25 //#define DEBUG_PRINTING_ENABLED
26 
27 //---includes for this file----------------------------------------------------
28 // compiler library header files
29 #include <stdio.h>
30 
31 // third party header files
32 
33 // Ocean Blue Software header files
34 
35 #include <techtype.h>
36 #include <dbgfuncs.h>
37 
38 #include "stberc.h"
39 #include "stbpvr.h"
40 #include "stbdpc.h"
41 #include "stbhwos.h"
42 
43 #ifdef INCLUDE_CA
44 #include "ca_glue.h"
45 #endif
46 
47 //---constant definitions for this file----------------------------------------
48 
49 #define EVENT_LATCHED_MAX 10 // Max number of outstanding latched events
50 
51 #define INTERACTION_STACK_SIZE 1024
52 #define INTERACTION_TASK_PRIORITY 8 /* Not a critical task so can have a low priority */
53 
54 
55 //---local typedef structs for this file---------------------------------------
56 
57 typedef struct
58 {
59  BOOLEAN (*app_func)(BOOLEAN latched, BOOLEAN repeat, U16BIT class, U16BIT type, void *data, U32BIT data_size);
60 } ER_STATUS;
61 
62 typedef struct
63 {
64  U8BIT class;
65  U16BIT type;
66 } ER_LATCHED;
67 
68 //---local (static) variable declarations for this file------------------------
69 // (internal variables declared static to make them local)
70 
71 static void *er_protect;
72 static ER_STATUS event_status;
73 static ER_LATCHED latched_events[EVENT_LATCHED_MAX];
74 
75 static void *user_interaction_sem = NULL;
76 static void *user_interaction_task = NULL;
77 static U32BIT user_interaction_timeout = 0;
78 static U32BIT last_user_interaction_time = 0;
79 
80 //---local function prototypes for this file-----------------------------------
81 // (internal functions declared static to make them local)
82 
83 static void EventCallback(BOOLEAN repeat, U16BIT path_class, U16BIT type, void *data, U32BIT data_size);
84 static void UserInteractionTask(void *param);
85 
86 //---local function definitions------------------------------------------------
87 
99 static void EventCallback(BOOLEAN repeat, U16BIT path_class, U16BIT type, void *data, U32BIT data_size)
100 {
101  U8BIT path, class;
102  U8BIT tuner_num;
103  U32BIT rec_handle;
104 #ifdef INCLUDE_CA
105  U32BIT ca_handle;
106 #endif
107 
108 // FUNCTION_START(STB_HWEventCallback); FLOODS THE DEBUGGER !!
109 
110  class = (U8BIT)(path_class & 0xff);
111 
112  switch (class)
113  {
114  case HW_EV_CLASS_HANDSET:
115  {
116  DBGPRINT("handset: r=%d t=%x", repeat, type);
117  STB_ERSendEvent(FALSE, repeat, EV_CLASS_HSET, type, data, data_size);
118  last_user_interaction_time = STB_OSGetClockMilliseconds();
119  break;
120  }
121 
122  case HW_EV_CLASS_KEYPAD:
123  {
124  DBGPRINT("keypad: t=%x", type);
125  STB_ERSendEvent(FALSE, repeat, EV_CLASS_KEYP, type, data, data_size);
126  last_user_interaction_time = STB_OSGetClockMilliseconds();
127  break;
128  }
129 
130  case HW_EV_CLASS_SCART:
131  {
132  switch (type)
133  {
134  case HW_EV_TYPE_TRUE:
135  {
136  STB_ERSendEvent(FALSE, repeat, EV_CLASS_SCART, EV_TYPE_FORCE, data, data_size);
137  break;
138  }
139 
140  case HW_EV_TYPE_FALSE:
141  {
142  STB_ERSendEvent(FALSE, repeat, EV_CLASS_SCART, EV_TYPE_DISCONNECTED, data, data_size);
143  break;
144  }
145 
146  case HW_EV_TYPE_4_3:
147  {
148  STB_ERSendEvent(FALSE, repeat, EV_CLASS_SCART, EV_TYPE_4_3, data, data_size);
149  break;
150  }
151 
152  case HW_EV_TYPE_16_9:
153  {
154  STB_ERSendEvent(FALSE, repeat, EV_CLASS_SCART, EV_TYPE_16_9, data, data_size);
155  break;
156  }
157  }
158  break;
159  }
160 
161  case HW_EV_CLASS_LNB:
162  {
163  if (type == HW_EV_TYPE_FALSE)
164  {
165  STB_ERSendEvent(TRUE, repeat, EV_CLASS_LNB, EV_TYPE_FAIL, data, data_size);
166  }
167  break;
168  }
169 
170  case HW_EV_CLASS_TUNER:
171  {
172  if (data != NULL)
173  {
174  /* A tuner can be associated with multiple paths so send event
175  * to all paths using this tuner */
176  path = INVALID_RES_ID;
177  tuner_num = *(U8BIT *)data;
178 
179  while ((path = STB_DPPathForTuner(path, tuner_num)) != INVALID_RES_ID)
180  {
181  switch (type)
182  {
183  case HW_EV_TYPE_LOCKED:
184  {
185  /* Clear any additional frequencies that have been set now the tuner has locked
186  * to prevent them being used in situations where the tuner loses lock */
187  STB_DPSetAdditionalFrequencies(path, 0, NULL);
188  STB_DPSetTuneStatus(path, TUNE_LOCKED);
189  break;
190  }
191 
192  case HW_EV_TYPE_NOTLOCKED:
193  {
194  STB_DPSetTuneStatus(path, TUNE_NO_LOCK);
195  break;
196  }
197 
198  default:
199  {
200  break;
201  }
202  }
203  }
204 
205  switch (type)
206  {
207  case HW_EV_TYPE_LOCKED:
208  {
209  STB_ERSendEvent(FALSE, repeat, EV_CLASS_TUNE, EV_TYPE_LOCKED, data, data_size);
210  break;
211  }
212 
213  case HW_EV_TYPE_NOTLOCKED:
214  {
215  if (STB_DPTryAdditionalFrequency(tuner_num))
216  {
217  /* A possible alternative frequency has been set so try tuning again on all
218  * decode paths using the tuner and don't pass the not locked event on yet */
219  path = INVALID_RES_ID;
220  while ((path = STB_DPPathForTuner(path, tuner_num)) != INVALID_RES_ID)
221  {
222  STB_DPStartTune(path);
223  }
224  }
225  else
226  {
227  STB_ERSendEvent(FALSE, repeat, EV_CLASS_TUNE, EV_TYPE_NOTLOCKED, data, data_size);
228  }
229  break;
230  }
231 
232  case HW_EV_TYPE_SIGNAL_DATA_BAD:
233  {
234  STB_ERSendEvent(FALSE, repeat, EV_CLASS_TUNE, EV_TYPE_SIGNAL_DATA_BAD, data, data_size);
235  break;
236  }
237 
238  case HW_EV_TYPE_SIGNAL_DATA_OK:
239  {
240  STB_ERSendEvent(FALSE, repeat, EV_CLASS_TUNE, EV_TYPE_SIGNAL_DATA_OK, data, data_size);
241  break;
242  }
243  }
244  }
245  break;
246  }
247 
248  case HW_EV_CLASS_DECODE:
249  {
250  if (data != NULL)
251  {
252  /* Map decoder to decode path */
253  if ((type == HW_EV_TYPE_AUDIO_STARTED) || (type == HW_EV_TYPE_AUDIO_STOPPED) ||
254  (type == HW_EV_TYPE_SAMPLE_STOPPED))
255  {
256  path = STB_DPPathForAudioDecoder(*(U8BIT *)data);
257  }
258  else if ((type == HW_EV_TYPE_VIDEO_STARTED) || (type == HW_EV_TYPE_VIDEO_STOPPED))
259  {
260  path = STB_DPPathForVideoDecoder(*(U8BIT *)data);
261  }
262  else if ((type == HW_EV_TYPE_AD_STARTED) || (type == HW_EV_TYPE_AD_STOPPED))
263  {
264  path = STB_DPPathForADDecoder(*(U8BIT *)data);
265  }
266  }
267  else
268  {
269  path = INVALID_RES_ID;
270  }
271 
272  if (path != INVALID_RES_ID)
273  {
274  if (type == HW_EV_TYPE_AUDIO_STARTED)
275  {
276  STB_DPSetAudioStatus(path, DECODE_RUNNING);
277  STB_ERSendEvent(FALSE, repeat, EV_CLASS_DECODE, EV_TYPE_AUDIO_STARTED, data, data_size);
278  }
279  if (type == HW_EV_TYPE_VIDEO_STARTED)
280  {
281  STB_DPSetVideoStatus(path, DECODE_RUNNING);
282  STB_ERSendEvent(FALSE, repeat, EV_CLASS_DECODE, EV_TYPE_VIDEO_STARTED, data, data_size);
283  }
284  if (type == HW_EV_TYPE_AD_STARTED)
285  {
286  STB_DPSetADStatus(path, DECODE_RUNNING);
287  STB_ERSendEvent(FALSE, repeat, EV_CLASS_DECODE, EV_TYPE_AD_STARTED, data, data_size);
288  }
289  if (type == HW_EV_TYPE_AUDIO_STOPPED)
290  {
291  STB_DPSetAudioStatus(path, DECODE_STOPPED);
292  STB_ERSendEvent(FALSE, repeat, EV_CLASS_DECODE, EV_TYPE_AUDIO_STOPPED, data, data_size);
293  }
294  if (type == HW_EV_TYPE_VIDEO_STOPPED)
295  {
296  if (STB_DPGetVideoStatus(path) == DECODE_STOPPING)
297  {
298  STB_DPSetVideoStatus(path, DECODE_STOPPED);
299  STB_ERSendEvent(FALSE, repeat, EV_CLASS_DECODE, EV_TYPE_VIDEO_STOPPED, data, data_size);
300  }
301  else
302  {
303  STB_DPSetVideoStatus(path, DECODE_STOPPED);
304  STB_ERSendEvent(FALSE, repeat, EV_CLASS_DECODE, EV_TYPE_FAIL, data, data_size);
305  }
306  }
307  if (type == HW_EV_TYPE_AD_STOPPED)
308  {
309  STB_DPSetADStatus(path, DECODE_STOPPED);
310  STB_ERSendEvent(FALSE, repeat, EV_CLASS_DECODE, EV_TYPE_AD_STOPPED, data, data_size);
311  }
312  if (type == HW_EV_TYPE_VIDEO_UNDERFLOW)
313  {
314  STB_ERSendEvent(FALSE, repeat, EV_CLASS_DECODE, EV_TYPE_VIDEO_UNDERFLOW, data, data_size);
315  }
316  if (type == HW_EV_TYPE_AUDIO_UNDERFLOW)
317  {
318  STB_ERSendEvent(FALSE, repeat, EV_CLASS_DECODE, EV_TYPE_AUDIO_UNDERFLOW, data, data_size);
319  }
320  if (type == HW_EV_TYPE_SAMPLE_STOPPED)
321  {
322  STB_DPSetAudioStatus(path, DECODE_STOPPED);
323  STB_ERSendEvent(FALSE, repeat, EV_CLASS_DECODE, EV_TYPE_SAMPLE_STOPPED, data, data_size);
324  }
325  }
326  break;
327  }
328 
329  case HW_EV_CLASS_DVD:
330  {
331  if (type == HW_EV_TYPE_DVD_DISK_INSERTED)
332  {
333  STB_ERSendEvent(FALSE, FALSE, EV_CLASS_DVD, EV_TYPE_DVD_DISK_INSERTED, data, data_size);
334  }
335  else if (type == HW_EV_TYPE_DVD_DISK_REMOVED)
336  {
337  STB_ERSendEvent(FALSE, FALSE, EV_CLASS_DVD, EV_TYPE_DVD_DISK_REMOVED, data, data_size);
338  }
339  break;
340  }
341 
342  case HW_EV_CLASS_DISK:
343  {
344  if (type == HW_EV_TYPE_DISK_CONNECTED)
345  {
346  if (STB_PVRIsInitialised())
347  {
348  /* PVR functions are interested in this event before it's passed on */
350  }
351 
352  STB_ERSendEvent(FALSE, FALSE, EV_CLASS_DISK, EV_TYPE_DISK_CONNECTED, data, data_size);
353  }
354  else if (type == HW_EV_TYPE_DISK_REMOVED)
355  {
356  if (STB_PVRIsInitialised())
357  {
358  /* PVR functions are interested in this event before it's passed on */
360  }
361 
362  STB_ERSendEvent(FALSE, FALSE, EV_CLASS_DISK, EV_TYPE_DISK_REMOVED, data, data_size);
363  }
364  else if (type == HW_EV_TYPE_DISK_FULL)
365  {
366  STB_ERSendEvent(FALSE, FALSE, EV_CLASS_DISK, EV_TYPE_DISK_FULL, data, data_size);
367  }
368  break;
369  }
370 
371  case HW_EV_CLASS_PVR:
372  {
373  switch (type)
374  {
375  case HW_EV_TYPE_PVR_REC_START:
376  if ((data != NULL) && (data_size == sizeof(U8BIT)))
377  {
378  /* Data sent with the event should be the recording index, so change this to
379  * the recording handle before passing it on to the app */
380  rec_handle = STB_PVRGetHandleForRecordingIndex(*(U8BIT *)data);
381 #ifdef INCLUDE_CA
382  /* Find the decode path being used for the recording */
383  path = STB_PVRGetPathForRecordingIndex(*(U8BIT*)data);
384  if ((path != INVALID_RES_ID) && STB_DPGetPathCADescrambler(path, &ca_handle))
385  {
386  STB_CANotifyRecordingStatus(ca_handle, TRUE);
387  }
388 #endif
389  }
390  else
391  {
392  rec_handle = STB_PVR_INVALID_HANDLE;
393  }
394  STB_ERSendEvent(FALSE, repeat, EV_CLASS_PVR, EV_TYPE_PVR_REC_START, &rec_handle, sizeof(U32BIT));
395  break;
396  case HW_EV_TYPE_PVR_REC_STOP:
397 #ifdef INCLUDE_CA
398  if ((data != NULL) && (data_size == sizeof(U8BIT)))
399  {
400  /* Data sent with the event should be the recording index.
401  * Find the decode path from this */
402  path = STB_PVRGetPathForRecordingIndex(*(U8BIT*)data);
403  if ((path != INVALID_RES_ID) && STB_DPGetPathCADescrambler(path, &ca_handle))
404  {
405  STB_CANotifyRecordingStatus(ca_handle, FALSE);
406  }
407  }
408 #endif
409  STB_ERSendEvent(FALSE, repeat, EV_CLASS_PVR, EV_TYPE_PVR_REC_STOP, NULL, 0);
410  break;
411  case HW_EV_TYPE_PVR_PLAY_START:
412  path = STB_DPGetPlaybackPath();
413  STB_ERSendEvent(FALSE, repeat, EV_CLASS_PVR, EV_TYPE_PVR_PLAY_START, &path, sizeof(path));
414  break;
415  case HW_EV_TYPE_PVR_PLAY_STOP:
416  path = STB_DPGetPlaybackPath();
417  STB_ERSendEvent(FALSE, repeat, EV_CLASS_PVR, EV_TYPE_PVR_PLAY_STOP, &path, sizeof(path));
418  break;
419  case HW_EV_TYPE_PVR_PLAY_BOF:
420  path = STB_DPGetPlaybackPath();
421  STB_ERSendEvent(FALSE, repeat, EV_CLASS_PVR, EV_TYPE_PVR_PLAY_BOF, &path, sizeof(path));
422  break;
423  case HW_EV_TYPE_PVR_PLAY_EOF:
424  path = STB_DPGetPlaybackPath();
425  STB_ERSendEvent(FALSE, repeat, EV_CLASS_PVR, EV_TYPE_PVR_PLAY_EOF, &path, sizeof(path));
426  break;
427  case HW_EV_TYPE_PVR_PLAY_NOTIFY_TIME:
428  path = STB_DPGetPlaybackPath();
430  break;
431  default:
432  break;
433  }
434  break;
435  }
436 
437  case HW_EV_CLASS_HDMI:
438  {
439  switch (type)
440  {
441  case HW_EV_TYPE_HDMI_CONNECT:
442  {
443  STB_ERSendEvent(FALSE, repeat, EV_CLASS_HDMI, EV_TYPE_CONNECTED, data, data_size);
444  break;
445  }
446 
447  case HW_EV_TYPE_HDMI_DISCONNECT:
448  {
449  STB_ERSendEvent(FALSE, repeat, EV_CLASS_HDMI, EV_TYPE_DISCONNECTED, data, data_size);
450  break;
451  }
452 
453  default:
454  break;
455  }
456  break;
457  }
458 
459  case HW_EV_CLASS_PRIVATE:
460  {
461  /* Pass all private events on without any changes */
462  STB_ERSendEvent(FALSE, repeat, EV_CLASS_PRIVATE, type, data, data_size);
463  break;
464  }
465 
466  default:
467  {
468  break;
469  }
470  }
471 
472 // FUNCTION_FINISH(STB_HWEventCallback); FLOODS THE DEBUGGER !!
473 }
474 
475 //---global function definitions-----------------------------------------------
488 {
489  FUNCTION_START(STB_ERInitialise);
490 
491  er_protect = STB_OSCreateSemaphore();
492 
493  // register callback func and init hw events
494  STB_OSRegisterCallback(&EventCallback);
495 
496  FUNCTION_FINISH(STB_ERInitialise);
497 }
498 
510 void STB_ERRegisterHandler(BOOLEAN (*func)(BOOLEAN latched, BOOLEAN repeat, U16BIT class, U16BIT type,
511  void *data, U32BIT data_size))
512 {
513  FUNCTION_START(STB_ERRegisterHandler);
514 
515  event_status.app_func = func;
516 
517  FUNCTION_FINISH(STB_ERRegisterHandler);
518 }
519 
532 void STB_ERNotifyEvent(U8BIT event_class, U16BIT event_type)
533 {
534  U8BIT latch_index;
535 
536  FUNCTION_START(STB_ERNotifyEvent);
537 
538  latch_index = 0;
539  while (latch_index < EVENT_LATCHED_MAX)
540  {
541  // Clear flags and stop searching if this event is latched
542  if ((latched_events[latch_index].class == event_class) &&
543  (latched_events[latch_index].type == event_type))
544  {
545  // Clear the latched event
546  latched_events[latch_index].class = 0;
547  latched_events[latch_index].type = 0;
548  break;
549  }
550 
551  latch_index++;
552  }
553 
554  FUNCTION_FINISH(STB_ERNotifyEvent);
555 }
556 
571 void STB_ERSendEvent(BOOLEAN latched, BOOLEAN repeat, U16BIT path_class, U16BIT type, void *data, U32BIT data_size)
572 {
573  BOOLEAN do_queue_event;
574  U8BIT latch_index;
575  U8BIT free_index;
576  U8BIT class;
577 
578  FUNCTION_START(STB_ERSendEvent);
579 
580  STB_OSSemaphoreWait(er_protect);
581 
582  // Gets set FALSE if there was already a latched event of same class and type
583  do_queue_event = TRUE;
584 
585  if (latched == TRUE)
586  {
587  // Find an available slot in the latched events array
588  class = (U8BIT)(path_class & 0xff);
589 
590  free_index = EVENT_LATCHED_MAX;
591  for (latch_index = 0; latch_index < EVENT_LATCHED_MAX; latch_index++)
592  {
593  // Stop searching if this event is already latched
594  if ((latched_events[latch_index].class == class) &&
595  (latched_events[latch_index].type == type))
596  {
597  do_queue_event = FALSE;
598  break;
599  }
600 
601  if ((free_index == EVENT_LATCHED_MAX) && (latched_events[latch_index].class != 0))
602  {
603  free_index = latch_index;
604  }
605  }
606 
607  // If an available slot was found
608  if (do_queue_event && (free_index != EVENT_LATCHED_MAX))
609  {
610  // Record the event details
611  latched_events[free_index].class = class;
612  latched_events[free_index].type = type;
613  }
614  }
615 
616  // Send the event to the queue if needed
617  if (do_queue_event == TRUE)
618  {
619  // If an application callback is registered...
620  if (event_status.app_func != NULL)
621  {
622  // ...make the callback with the event details
623  (*event_status.app_func)(latched, repeat, path_class, type, data, data_size);
624  }
625  }
626 
627  STB_OSSemaphoreSignal(er_protect);
628 
629  FUNCTION_FINISH(STB_ERSendEvent);
630 }
631 
639 {
640  FUNCTION_START(STB_ERSetUserInteractionTimeout);
641 
642  if (user_interaction_timeout != timeout * 1000)
643  {
644  user_interaction_timeout = timeout * 1000;
645 
646  if (user_interaction_task == NULL)
647  {
648  /* Auto standby time has been set, so start the monitoring task */
649  if ((user_interaction_sem = STB_OSCreateSemaphore()) != NULL)
650  {
651  /* Grab the semaphore initially so the task won't run until required */
652  STB_OSSemaphoreWait(user_interaction_sem);
653 
654  user_interaction_task = STB_OSCreateTask(UserInteractionTask, user_interaction_sem,
655  INTERACTION_STACK_SIZE, INTERACTION_TASK_PRIORITY, (U8BIT*)"UserInteractionTask");
656  }
657  }
658  else
659  {
660  /* Wake the task up so it can re-evaluate the timeout */
661  STB_OSSemaphoreSignal(user_interaction_sem);
662  }
663  }
664 
665  FUNCTION_FINISH(STB_ERSetUserInteractionTimeout);
666 }
667 
668 static void UserInteractionTask(void *sem)
669 {
670  U32BIT timeout;
671 
672  while(TRUE)
673  {
674  /* Work out how long to wait */
675  if (user_interaction_timeout == 0)
676  {
677  /* No user interaction timeout is set, so wait until one is set */
678  STB_OSSemaphoreWait(sem);
679  }
680  else
681  {
682  timeout = user_interaction_timeout - STB_OSGetClockDiff(last_user_interaction_time);
683 
684  /* Wait for a max of 65 seconds (semaphore timeout is a 16 bit value) */
685  if (timeout > 65000)
686  {
687  timeout = 65000;
688  }
689 
690  STB_OSSemaphoreWaitTimeout(sem, (U16BIT)timeout);
691  }
692 
693  if (user_interaction_timeout != 0)
694  {
695  if (STB_OSGetClockDiff(last_user_interaction_time) >= user_interaction_timeout)
696  {
697  /* Send event to indicate user interaction time has expired */
698  STB_ERSendEvent(FALSE, FALSE, EV_CLASS_TIMER, EV_TYPE_USER_INTERACTION_TIMEOUT, NULL, 0);
699 
700  /* Set last user interation time to stop the event from being sent continually */
701  last_user_interaction_time = STB_OSGetClockMilliseconds();
702  }
703  }
704  }
705 }
706 
707 //*****************************************************************************
708 // End of file
709 //*****************************************************************************
710 
U8BIT STB_DPPathForADDecoder(U8BIT decoder_num)
Returns the decode path that is using the given AD decoder.
Definition: stbdpc.c:1463
void STB_DPSetAudioStatus(U8BIT path, E_STB_DP_DECODE_STATUS state)
Writes the audio status into decode path store.
Definition: stbdpc.c:3617
U32BIT STB_OSGetClockDiff(U32BIT timestamp)
Get Difference between Given Time and Current Time.
Header file - macros and function prototypes for public use.
void * STB_OSCreateSemaphore(void)
Create a Semaphore.
U8BIT STB_DPPathForTuner(U8BIT start_path, U8BIT tuner_num)
Returns the decode path that is using the given tuner ID.
Definition: stbdpc.c:1400
void STB_ERInitialise(void)
Initialises STB layer Event Reporting control.
Definition: stberc.c:487
void STB_ERRegisterHandler(BOOLEAN(*func)(BOOLEAN latched, BOOLEAN repeat, U16BIT class, U16BIT type, void *data, U32BIT data_size))
Called by app to register callback function for events.
Definition: stberc.c:510
void STB_ERNotifyEvent(U8BIT event_class, U16BIT event_type)
Called by app to notify consumption of latched event.
Definition: stberc.c:532
BOOLEAN STB_OSSemaphoreWaitTimeout(void *semaphore, U16BIT timeout)
Wait on Semaphore for Set Time Period in an Attempt to Acquire.
void STB_OSSemaphoreSignal(void *semaphore)
Signal a Semaphore to Release it by decrementing its counter.
void STB_DPSetADStatus(U8BIT path, E_STB_DP_DECODE_STATUS state)
Writes the AD status into decode path store.
Definition: stbdpc.c:3524
void STB_ERSetUserInteractionTimeout(U32BIT timeout)
Sets the time, in seconds, after which the STB_EVENT_USER_INTERACTION_TIMEOUT event will be sent to i...
Definition: stberc.c:638
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
BOOLEAN STB_PVRIsInitialised(void)
Returns Initialised status.
Definition: stbpvr.c:480
void STB_PVRPlaybackNotifyTime(U8BIT path)
Handles the notification received from the platform code when playback reaches a set position...
Definition: stbpvr.c:4582
void STB_CANotifyRecordingStatus(U32BIT handle, BOOLEAN status)
This function is called when a recording starts and when it stops.
Definition: ca_glue.c:399
void STB_OSSemaphoreWait(void *semaphore)
Wait on Semaphore Indefinity or Until Released.
Header file - macros and function prototypes for public use.
void STB_DPSetAdditionalFrequencies(U8BIT path, U8BIT num_freqs, U32BIT *frequencies)
Sets an array of frequencies that can be tried when tuning to a transport if the tuner fails to lock ...
Definition: stbdpc.c:6933
U8BIT STB_PVRGetPathForRecordingIndex(U8BIT rec_index)
Returns the path for the given recording index.
Definition: stbpvr.c:1389
void STB_DPSetVideoStatus(U8BIT path, E_STB_DP_DECODE_STATUS decoder)
Writes the video status into decode path store.
Definition: stbdpc.c:3710
U8BIT STB_DPGetPlaybackPath(void)
Returns the ID of the decode path being used for playback.
Definition: stbdpc.c:1373
void STB_OSRegisterCallback(void(*func)(BOOLEAN, U16BIT, U16BIT, void *, U32BIT))
Register the function that will be called when STB_OSSendEvent is used.
Debug functions header file.
void STB_DPStartTune(U8BIT path)
Requests start of tuning process.
Definition: stbdpc.c:2206
BOOLEAN STB_DPTryAdditionalFrequency(U8BIT path)
Checks to see if there&#39;s an additional frequency available on the given decode path that hasn&#39;t yet b...
Definition: stbdpc.c:6973
Header file - Function prototypes for Event Reporting.
Glue layer between DVB and conditional access systems.
E_STB_DP_DECODE_STATUS STB_DPGetVideoStatus(U8BIT path)
Reads the video status from decode path store.
Definition: stbdpc.c:3767
Header file - Function prototypes for operating system.
System Wide Global Technical Data Type Definitions.
BOOLEAN STB_DPGetPathCADescrambler(U8BIT path, U32BIT *handle)
Get the handle of the CA descrambler associated with the given path.
Definition: stbdpc.c:1244
void * STB_OSCreateTask(void(*function)(void *), void *param, U32BIT stack, U8BIT priority, U8BIT *name)
Create a New Task to the calling process. Upon success, the created task runs on its own stack...
U8BIT STB_DPPathForAudioDecoder(U8BIT decoder_num)
Returns the decode path that is using the given audio decoder.
Definition: stbdpc.c:1436
U32BIT STB_OSGetClockMilliseconds(void)
Get Current Computer Clock Time.
U32BIT STB_PVRGetHandleForRecordingIndex(U8BIT rec_index)
Returns the handle for the given recording index.
Definition: stbpvr.c:1362
#define DBGPRINT(...)
Definition: dbgfuncs.h:74
void STB_DPSetTuneStatus(U8BIT path, E_STB_DP_TUNE_STATUS state)
Writes the tuning status into decode path store.
Definition: stbdpc.c:3304
void STB_PVRUpdateRecordings(BOOLEAN force_load)
Called when a disk is added or removed and updates the disk database and the recordings that are now ...
Definition: stbpvr.c:715
U8BIT STB_DPPathForVideoDecoder(U8BIT decoder_num)
Returns the decode path that is using the given video decoder.
Definition: stbdpc.c:1490