DVBCore  22.11.0
Open Source DVB Engine
All Classes Files Functions Variables Typedefs Enumerations Macros Pages
ap_pvr.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  *
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  *******************************************************************************/
24 // pre-processor mechanism so multiple inclusions don't cause compilation error
25 
26 #ifndef _AP_PVR_H
27 
28 #define _AP_PVR_H
29 
30 #include "techtype.h"
31 
32 //---macro definitions for this file-------------------------------------------
33 
34 
35 //---Enumerations for public use-----------------------------------------------
36 typedef enum e_pvr_play_status
37 {
38  PVR_PLAY_STATUS_NULL = 0, // X - no action
39  PVR_PLAY_STATUS_STOP = 1, // . - stop
40  PVR_PLAY_STATUS_PAUSE = 2, // || - pause
41  PVR_PLAY_STATUS_SF = 3, // >| - slow forward
42  PVR_PLAY_STATUS_SR = 4, // |< - slow reverse
43  PVR_PLAY_STATUS_NORMAL = 5, // > - play
44  PVR_PLAY_STATUS_FF = 6, // >> - fast forward
45  PVR_PLAY_STATUS_FR = 7, // << - fast reverse
46  PVR_PLAY_STATUS_QR = 8 // |<< - quick repeat
47 } E_PVR_PLAY_STATUS;
48 
49 typedef enum e_pvr_stop_type
50 {
51  PVR_STOP_REC_ONLY = 0,
52  PVR_STOP_PLAY = 1,
53  PVR_STOP_PAUSE = 2
54 } E_PVR_STOP_TYPE;
55 
56 //---Global type defs for public use-------------------------------------------
57 
58 //---Global Function prototypes for public use---------------------------------
59 
64 BOOLEAN APVR_IsInitialised(void);
65 
74 void APVR_SetNotifyTime(U16BIT notify_time);
75 
80 U16BIT APVR_GetNotifyTime(void);
81 
88 void APVR_SetStartPadding(S32BIT padding);
89 
96 void APVR_SetEndPadding(S32BIT padding);
97 
102 S32BIT APVR_GetStartPadding(void);
103 
108 S32BIT APVR_GetEndPadding(void);
109 
110 // ----play list----
111 
129 U16BIT APVR_GetPlayList(U32BIT **handle_list, U8BIT ***name_list, U32BIT **rec_status_list,
130  U32BIT **locked_list, U32BIT **selected_list, U32BIT **split_list);
131 
140 void APVR_ReleasePlayList(U32BIT *handle_list, U8BIT **name_list, U32BIT *rec_status_list,
141  U32BIT *locked_list, U32BIT *selected_list, U32BIT *split_list);
142 
143 // ----playing----
144 
158 BOOLEAN APVR_PlayRecording(U32BIT recording_handle, BOOLEAN resume_playback, void *monitor_service);
159 
164 U32BIT APVR_GetPlaybackHandle(void);
165 
170 BOOLEAN APVR_IsPlaying(void);
171 
181 BOOLEAN APVR_GetPlaybackElapsedTime(U32BIT handle, U8BIT *hours, U8BIT *mins, U8BIT *secs, U8BIT *progress);
182 
187 void APVR_StopPlay(BOOLEAN return_to_live);
188 
193 void APVR_NormalPlay(void);
194 
198 void APVR_PausePlay(void);
199 
206 void APVR_FFPlay(void);
207 
214 void APVR_FRPlay(void);
215 
220 E_PVR_PLAY_STATUS APVR_GetPlayMode(void);
221 
227 S16BIT APVR_GetPlaySpeed(void);
228 
235 BOOLEAN APVR_SetPlaySpeed(S16BIT speed);
236 
237 // ---- recording ----
238 
248 U8BIT APVR_PrepareNewRecording(U16BIT onet_id, U16BIT trans_id, U16BIT service_id, BOOLEAN *new_tuned_service);
249 
261 BOOLEAN APVR_StartNewRecording(U16BIT disk_id, U8BIT path, U8BIT *recording_name, U16BIT event_id,
262  U8BIT *prog_crid, U8BIT *other_crid, U32BIT *rec_handle);
263 
269 BOOLEAN APVR_StopRecording(U32BIT recording_handle);
270 
278 U8BIT APVR_GetActiveRecordingList(U32BIT **handle_list);
279 
284 void APVR_ReleaseActiveRecordingList(U32BIT *handle_list);
285 
294 BOOLEAN APVR_GetPathRecordingName(U8BIT path, U8BIT **name_ptr);
295 
303 BOOLEAN APVR_DeleteRecording(U32BIT handle);
304 
312 void APVR_SetTimeshiftBufferSize(U16BIT time_in_mins);
313 
318 U16BIT APVR_GetTimeshiftBufferSize(void);
319 
324 BOOLEAN APVR_IsTimeshiftStarted(void);
325 
331 BOOLEAN APVR_IsTimeshiftRecordingPath(U8BIT path);
332 
338 BOOLEAN APVR_IsTimeshiftRecording(U32BIT handle);
339 
347 U8BIT APVR_StartPauseRecord(void);
348 
356 U8BIT APVR_StartPausePlay(void);
357 
363 void APVR_StopPauseRecord(BOOLEAN return_to_live);
364 
369 BOOLEAN APVR_IsRecordingInProgress(void);
370 
378 BOOLEAN APVR_IsRecordingHandle(U8BIT path, U32BIT recording_handle);
379 
387 BOOLEAN APVR_GetRecordingHandle(U8BIT path, U32BIT *recording_handle_ptr);
388 
389 // ---- disk ----
394 U8BIT APVR_GetTotalSpacePercentUsed(U16BIT disk_id);
395 
406 void APVR_GetDiskTime(U16BIT disk_id, U8BIT *used_hour_ptr, U8BIT *used_min_ptr,
407  U8BIT *free_hour_ptr, U8BIT *free_min_ptr,
408  U8BIT *size_hour_ptr, U8BIT *size_min_ptr);
409 
417 void APVR_GetDiskMbyte(U16BIT disk_id, U32BIT *used_mbyte_ptr, U32BIT *free_mbyte_ptr, U32BIT *size_mbyte_ptr);
418 
425 BOOLEAN APVR_CheckSpaceForEvent(U16BIT disk_id, void *event_ptr);
426 
433 BOOLEAN APVR_CheckSpaceDuration(U16BIT disk_id, U32BIT duration);
434 
442 BOOLEAN APVR_CheckSpaceForDuration(U16BIT disk_id, U8BIT hours, U8BIT mins);
443 
444 // ---- pause ----
449 U32BIT APVR_GetPauseProgress(void);
450 
455 U32BIT APVR_GetPlaybackTime(void);
456 
462 BOOLEAN APVR_SetPlaybackTime(U32BIT position_in_secs);
463 
468 U8BIT APVR_GetPlaybackPath(void);
469 
475 BOOLEAN APVR_IsEventInRecordList(U8BIT *prog_crid);
476 
483 void APVR_RecordSeries(void *crid_ptr);
484 
491 void APVR_RecordRecommendations(void *crid_ptr);
492 
500 BOOLEAN APVR_FindNextSplitEvent(U32BIT curr_handle, U32BIT *next_handle);
501 
506 void APVR_EitUpdated(void);
507 
515 void APVR_PidsUpdated(U8BIT path);
516 
523 void* APVR_GetPlaybackService(void);
524 
530 BOOLEAN APVR_HandlePrivateTimer(U32BIT timer_handle);
531 
532 #ifdef COMMON_INTERFACE
533 
540 void APVR_CIRecordReplyReceived(BOOLEAN start_succeeded, U8BIT slot_id);
541 #endif
542 
543 //---Global Function prototypes for internal use---------------------------------
547 void APVR_Initialise(void);
548 
552 void APVR_Terminate(void);
553 
558 BOOLEAN APVR_IsDecodingFile(void);
559 
563 void APVR_SlowMoPlay(void);
564 
565 // quick replay current playing recording
566 void APVR_QRPlay(void);
567 
568 // quick replay current playing recording
569 void APVR_JTLPlay(void);
570 
574 void APVR_TrickModeMuteOn(void);
575 
579 void APVR_TrickModeMuteOff(void);
580 
589 BOOLEAN APVR_DeleteAllSelectedRecordings(U32BIT *handles, U16BIT num_handles);
590 
594 void APVR_UnselectAllRecordings(U32BIT *handles, U16BIT num_handles);
595 
602 BOOLEAN APVR_AreSelectedRecordings(U32BIT *handles, U16BIT num_handles);
603 
612 void APVR_EncryptRecordings(BOOLEAN state);
613 
614 #endif // _AP_PVR_H
void APVR_JTLPlay(void)
quick replay current playing recording
Definition: ap_pvr.c:1594
void APVR_PausePlay(void)
Pause playback.
Definition: ap_pvr.c:1379
BOOLEAN APVR_CheckSpaceDuration(U16BIT disk_id, U32BIT duration)
Check if there is enough space for the recording of the given duration to take place.
Definition: ap_pvr.c:2958
BOOLEAN APVR_PlayRecording(U32BIT recording_handle, BOOLEAN resume_playback, void *monitor_service)
Starts playback of the given recording.
Definition: ap_pvr.c:1035
void * APVR_GetPlaybackService(void)
A service instance is associated to the playback, this function returns its pointer. The handle can be used, for example, to call ADB_ServiceHasSubtitles as it&#39;s done for live channels.
Definition: ap_pvr.c:3607
BOOLEAN APVR_GetRecordingHandle(U8BIT path, U32BIT *recording_handle_ptr)
Returns the handle of the recording taking place on the given decode path.
Definition: ap_pvr.c:2870
void APVR_Initialise(void)
Initialise all PVR resources: filters, recordings etc.
Definition: ap_pvr.c:657
BOOLEAN APVR_CheckSpaceForEvent(U16BIT disk_id, void *event_ptr)
Checks if there is enough space for the recording of the given event to take place.
Definition: ap_pvr.c:2898
BOOLEAN APVR_SetPlaybackTime(U32BIT position_in_secs)
Sets returns the number of seconds in playback buffer.
Definition: ap_pvr.c:3162
void APVR_QRPlay(void)
quick replay current playing recording
Definition: ap_pvr.c:1573
U32BIT APVR_GetPauseProgress(void)
Calculates and returns the number of seconds behind live TV.
Definition: ap_pvr.c:3083
void APVR_PidsUpdated(U8BIT path)
This function should be called when there&#39;s an update to the PIDs for a service that&#39;s being recorded...
Definition: ap_pvr.c:3791
void APVR_FRPlay(void)
If paused, playback will go into the first available slow motion speed in a reverse direction...
Definition: ap_pvr.c:1470
void APVR_NormalPlay(void)
If playback has been paused or is subject to some trick mode, calling this function will result in pl...
Definition: ap_pvr.c:1285
void APVR_StopPlay(BOOLEAN return_to_live)
Stops playback and optionally returns to live TV.
Definition: ap_pvr.c:1306
void APVR_RecordSeries(void *crid_ptr)
Seaches the schedule for events that are part of the given series and that haven&#39;t already been recor...
Definition: ap_pvr.c:3267
void APVR_Terminate(void)
Destroy all PVR resources: filters, recordings etc.
Definition: ap_pvr.c:710
void APVR_FFPlay(void)
If paused, playback will go into the first available slow motion speed in a forwards direction...
Definition: ap_pvr.c:1417
U8BIT APVR_StartPauseRecord(void)
Starts recording the live service ready for timeshift playback. The recording may not have started wh...
Definition: ap_pvr.c:2533
BOOLEAN APVR_IsEventInRecordList(U8BIT *prog_crid)
Determines whether the given programme CRID is already in the list of recorded events.
Definition: ap_pvr.c:3247
BOOLEAN APVR_StartNewRecording(U16BIT disk_id, U8BIT path, U8BIT *recording_name, U16BIT event_id, U8BIT *prog_crid, U8BIT *other_crid, U32BIT *rec_handle)
Starts a recording after any tuning has completed and sets the info to be stored with it...
Definition: ap_pvr.c:1839
BOOLEAN APVR_IsRecordingHandle(U8BIT path, U32BIT recording_handle)
Returns TRUE if given recording handle is still in progress on the given decode path.
Definition: ap_pvr.c:2838
U16BIT APVR_GetTimeshiftBufferSize(void)
Returns the maximum size of the timeshift buffer in minutes.
Definition: ap_pvr.c:2445
BOOLEAN APVR_IsPlaying(void)
Returns whether playback is in progress.
Definition: ap_pvr.c:1199
BOOLEAN APVR_AreSelectedRecordings(U32BIT *handles, U16BIT num_handles)
Checks if any recording in a list is selected.
Definition: ap_pvr.c:2402
void APVR_SetEndPadding(S32BIT padding)
Sets the default time that will be added to the end of all recording timers created after this value ...
Definition: ap_pvr.c:807
void APVR_GetDiskTime(U16BIT disk_id, U8BIT *used_hour_ptr, U8BIT *used_min_ptr, U8BIT *free_hour_ptr, U8BIT *free_min_ptr, U8BIT *size_hour_ptr, U8BIT *size_min_ptr)
Gets an estimate of disk space in time (hour / min): used, free and size.
Definition: ap_pvr.c:3014
U8BIT APVR_GetTotalSpacePercentUsed(U16BIT disk_id)
get total percentage of recording space used
Definition: ap_pvr.c:2972
void APVR_SetTimeshiftBufferSize(U16BIT time_in_mins)
Sets the size of the timeshift buffer so that it&#39;s able to store a recording of the given length befo...
Definition: ap_pvr.c:2433
BOOLEAN APVR_GetPlaybackElapsedTime(U32BIT handle, U8BIT *hours, U8BIT *mins, U8BIT *secs, U8BIT *progress)
Returns the playback progress in time and as a percentage.
Definition: ap_pvr.c:1229
BOOLEAN APVR_IsTimeshiftRecordingPath(U8BIT path)
Checks whether the given path is the one that&#39;s being used for timeshift recording.
Definition: ap_pvr.c:2481
U8BIT APVR_StartPausePlay(void)
Starts playback of a live timeshift recording started with APVR_StartPauseRecord. This function shoul...
Definition: ap_pvr.c:2646
void APVR_TrickModeMuteOff(void)
Unmute for trick mode.
Definition: ap_pvr.c:1764
U32BIT APVR_GetPlaybackHandle(void)
Returns the handle of the recording currently being played back.
Definition: ap_pvr.c:1147
U8BIT APVR_PrepareNewRecording(U16BIT onet_id, U16BIT trans_id, U16BIT service_id, BOOLEAN *new_tuned_service)
Acquires a decode path for recording the given service and tunes to it.
Definition: ap_pvr.c:1795
E_PVR_PLAY_STATUS APVR_GetPlayMode(void)
Returns the current play mode according to the current play speed.
Definition: ap_pvr.c:1608
BOOLEAN APVR_IsInitialised(void)
Use to query whether the PVR function is available and ready to be used.
Definition: ap_pvr.c:745
void APVR_GetDiskMbyte(U16BIT disk_id, U32BIT *used_mbyte_ptr, U32BIT *free_mbyte_ptr, U32BIT *size_mbyte_ptr)
Ges disk space in Mbytes: used, free and size.
Definition: ap_pvr.c:3054
U32BIT APVR_GetPlaybackTime(void)
Calculates and returns the number of seconds in playback buffer.
Definition: ap_pvr.c:3128
BOOLEAN APVR_GetPathRecordingName(U8BIT path, U8BIT **name_ptr)
Get the name of the recording currently taking place on the given decode path.
Definition: ap_pvr.c:2297
void APVR_EncryptRecordings(BOOLEAN state)
Used to set whether all recordings should be encrypted or not. The default is that recordings aren&#39;t ...
Definition: ap_pvr.c:3818
U16BIT APVR_GetPlayList(U32BIT **handle_list, U8BIT ***name_list, U32BIT **rec_status_list, U32BIT **locked_list, U32BIT **selected_list, U32BIT **split_list)
Returns a list of all the existing recordings that can be played. All the arrays returned will be all...
Definition: ap_pvr.c:857
void APVR_ReleaseActiveRecordingList(U32BIT *handle_list)
Frees the arrays allocated by APVR_GetActiveRecordingList.
Definition: ap_pvr.c:2277
U8BIT APVR_GetPlaybackPath(void)
Returns the path currently acquired fro playback.
Definition: ap_pvr.c:3189
void APVR_ReleasePlayList(U32BIT *handle_list, U8BIT **name_list, U32BIT *rec_status_list, U32BIT *locked_list, U32BIT *selected_list, U32BIT *split_list)
Frees the arrays allocated by APVR_GetPlayList.
Definition: ap_pvr.c:982
void APVR_StopPauseRecord(BOOLEAN return_to_live)
Stops timeshifted playback and recording and optionally restarts decoding of the live signal...
Definition: ap_pvr.c:2730
BOOLEAN APVR_IsRecordingInProgress(void)
Returns TRUE if there are any recordings currently in progress.
Definition: ap_pvr.c:2798
System Wide Global Technical Data Type Definitions.
void APVR_TrickModeMuteOn(void)
Mute for trick mode.
Definition: ap_pvr.c:1741
void APVR_SetStartPadding(S32BIT padding)
Sets the default time that will be added to the start of all recording timers created after this valu...
Definition: ap_pvr.c:792
BOOLEAN APVR_StopRecording(U32BIT recording_handle)
Stops the given recording.
Definition: ap_pvr.c:2158
U8BIT APVR_GetActiveRecordingList(U32BIT **handle_list)
Returns an array of recordings currently in progress. Use APVR_ReleaseActiveRecordingList to free the...
Definition: ap_pvr.c:2215
BOOLEAN APVR_CheckSpaceForDuration(U16BIT disk_id, U8BIT hours, U8BIT mins)
Check if there is enough space for the recording of the given duration to take place.
Definition: ap_pvr.c:2917
BOOLEAN APVR_IsDecodingFile(void)
Returns the PVR play status.
Definition: ap_pvr.c:1158
void APVR_RecordRecommendations(void *crid_ptr)
Searches the schedule for events that are part of the given recommendation and that haven&#39;t already b...
Definition: ap_pvr.c:3433
void APVR_SlowMoPlay(void)
Play in slow mothing mode.
Definition: ap_pvr.c:1521
S16BIT APVR_GetPlaySpeed(void)
Returns the current play speed as a signed percentage value representing the speed, where 100% is normal playback speed.
Definition: ap_pvr.c:1678
BOOLEAN APVR_DeleteAllSelectedRecordings(U32BIT *handles, U16BIT num_handles)
Delete all the recordings marked as selected but not locked in the given list, including all files as...
Definition: ap_pvr.c:2350
void APVR_SetNotifyTime(U16BIT notify_time)
Sets the time, in seconds, when an event will be sent as a notification that a recording is about to ...
Definition: ap_pvr.c:766
BOOLEAN APVR_HandlePrivateTimer(U32BIT timer_handle)
Deals with any private timers started by the PVR module.
Definition: ap_pvr.c:3619
S32BIT APVR_GetStartPadding(void)
Returns the current setting for the start padding time added to all recording timers.
Definition: ap_pvr.c:820
BOOLEAN APVR_FindNextSplitEvent(U32BIT curr_handle, U32BIT *next_handle)
If the current playback recording is a split event then the next chronological part of the event is f...
Definition: ap_pvr.c:3583
BOOLEAN APVR_IsTimeshiftRecording(U32BIT handle)
Checks whether the given recording handle is the timeshift recording handle.
Definition: ap_pvr.c:2506
S32BIT APVR_GetEndPadding(void)
Returns the current setting for the end padding time added to all recording timers.
Definition: ap_pvr.c:831
void APVR_UnselectAllRecordings(U32BIT *handles, U16BIT num_handles)
Un-select all recordings.
Definition: ap_pvr.c:2379
void APVR_EitUpdated(void)
Ensures that any EIT updates are processed to handle scenarios such as checking for new series record...
Definition: ap_pvr.c:3770
BOOLEAN APVR_DeleteRecording(U32BIT handle)
Delete the given recording, including all files associated with it and remove it from the database of...
Definition: ap_pvr.c:2322
BOOLEAN APVR_IsTimeshiftStarted(void)
Checks whether timeshift has been started, which includes both recording and playback.
Definition: ap_pvr.c:2456
U16BIT APVR_GetNotifyTime(void)
Returns the current recording notification time in seconds.
Definition: ap_pvr.c:779
BOOLEAN APVR_SetPlaySpeed(S16BIT speed)
Set current play speed as a signed percentage value representing the speed, where 100% is normal play...
Definition: ap_pvr.c:1712