DVBCore  17.9.0
Open Source DVB Engine
 All Data Structures Files Functions Typedefs 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 
66 // ----play list----
67 
85 U16BIT APVR_GetPlayList(U32BIT **handle_list, U8BIT ***name_list, U32BIT **rec_status_list,
86  U32BIT **locked_list, U32BIT **selected_list, U32BIT **split_list);
87 
96 void APVR_ReleasePlayList(U32BIT *handle_list, U8BIT **name_list, U32BIT *rec_status_list,
97  U32BIT *locked_list, U32BIT *selected_list, U32BIT *split_list);
98 
99 // ----playing----
100 
114 BOOLEAN APVR_PlayRecording(U32BIT recording_handle, BOOLEAN resume_playback, void *monitor_service);
115 
120 U32BIT APVR_GetPlaybackHandle(void);
121 
126 BOOLEAN APVR_IsPlaying(void);
127 
137 BOOLEAN APVR_GetPlaybackElapsedTime(U32BIT handle, U8BIT *hours, U8BIT *mins, U8BIT *secs, U8BIT *progress);
138 
143 void APVR_StopPlay(BOOLEAN return_to_live);
144 
149 void APVR_NormalPlay(void);
150 
154 void APVR_PausePlay(void);
155 
162 void APVR_FFPlay(void);
163 
170 void APVR_FRPlay(void);
171 
176 E_PVR_PLAY_STATUS APVR_GetPlayMode(void);
177 
183 S16BIT APVR_GetPlaySpeed(void);
184 
185 // ---- recording ----
186 
196 U8BIT APVR_PrepareNewRecording(U16BIT onet_id, U16BIT trans_id, U16BIT service_id, BOOLEAN *new_tuned_service);
197 
209 BOOLEAN APVR_StartNewRecording(U16BIT disk_id, U8BIT path, U8BIT *recording_name, U16BIT event_id,
210  U8BIT *prog_crid, U8BIT *other_crid, U32BIT *rec_handle);
211 
217 BOOLEAN APVR_StopRecording(U32BIT recording_handle);
218 
226 U8BIT APVR_GetActiveRecordingList(U32BIT **handle_list);
227 
232 void APVR_ReleaseActiveRecordingList(U32BIT *handle_list);
233 
242 BOOLEAN APVR_GetPathRecordingName(U8BIT path, U8BIT **name_ptr);
243 
251 BOOLEAN APVR_DeleteRecording(U32BIT handle);
252 
260 void APVR_SetTimeshiftBufferSize(U16BIT time_in_mins);
261 
269 U8BIT APVR_StartPauseRecord(void);
270 
278 U8BIT APVR_StartPausePlay(void);
279 
285 void APVR_StopPauseRecord(BOOLEAN return_to_live);
286 
291 BOOLEAN APVR_IsRecordingInProgress(void);
292 
300 BOOLEAN APVR_IsRecordingHandle(U8BIT path, U32BIT recording_handle);
301 
309 BOOLEAN APVR_GetRecordingHandle(U8BIT path, U32BIT *recording_handle_ptr);
310 
311 // ---- disk ----
316 U8BIT APVR_GetTotalSpacePercentUsed(U16BIT disk_id);
317 
328 void APVR_GetDiskTime(U16BIT disk_id, U8BIT *used_hour_ptr, U8BIT *used_min_ptr,
329  U8BIT *free_hour_ptr, U8BIT *free_min_ptr,
330  U8BIT *size_hour_ptr, U8BIT *size_min_ptr);
331 
339 void APVR_GetDiskMbyte(U16BIT disk_id, U32BIT *used_mbyte_ptr, U32BIT *free_mbyte_ptr, U32BIT *size_mbyte_ptr);
340 
347 BOOLEAN APVR_CheckSpaceForEvent(U16BIT disk_id, void *event_ptr);
348 
355 BOOLEAN APVR_CheckSpaceDuration(U16BIT disk_id, U32BIT duration);
356 
364 BOOLEAN APVR_CheckSpaceForDuration(U16BIT disk_id, U8BIT hours, U8BIT mins);
365 
366 // ---- pause ----
371 U32BIT APVR_GetPauseProgress(void);
372 
377 U8BIT APVR_GetPlaybackPath(void);
378 
384 BOOLEAN APVR_IsEventInRecordList(U8BIT *prog_crid);
385 
393 void APVR_RecordSeries(void *crid_ptr, BOOLEAN radio_service);
394 
402 void APVR_RecordRecommendations(void *crid_ptr, BOOLEAN radio_service);
403 
411 BOOLEAN APVR_FindNextSplitEvent(U32BIT curr_handle, U32BIT *next_handle);
412 
417 void APVR_EitUpdated(void);
418 
426 void APVR_PidsUpdated(U8BIT path);
427 
434 void* APVR_GetPlaybackService(void);
435 
441 BOOLEAN APVR_HandlePrivateTimer(U32BIT timer_handle);
442 
443 #ifdef COMMON_INTERFACE
444 
451 void APVR_CIRecordReplyReceived(BOOLEAN start_succeeded, U8BIT slot_id);
452 #endif
453 
454 //---Global Function prototypes for internal use---------------------------------
458 void APVR_Initialise(void);
459 
463 void APVR_Terminate(void);
464 
469 BOOLEAN APVR_IsDecodingFile(void);
470 
474 void APVR_SlowMoPlay(void);
475 
476 // quick replay current playing recording
477 void APVR_QRPlay(void);
478 
479 // quick replay current playing recording
480 void APVR_JTLPlay(void);
481 
485 void APVR_TrickModeMuteOn(void);
486 
490 void APVR_TrickModeMuteOff(void);
491 
500 BOOLEAN APVR_DeleteAllSelectedRecordings(U32BIT *handles, U16BIT num_handles);
501 
505 void APVR_UnselectAllRecordings(U32BIT *handles, U16BIT num_handles);
506 
513 BOOLEAN APVR_AreSelectedRecordings(U32BIT *handles, U16BIT num_handles);
514 
515 #endif // _AP_PVR_H
void APVR_JTLPlay(void)
quick replay current playing recording
Definition: ap_pvr.c:1497
void APVR_PausePlay(void)
Pause playback.
Definition: ap_pvr.c:1274
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:2735
BOOLEAN APVR_PlayRecording(U32BIT recording_handle, BOOLEAN resume_playback, void *monitor_service)
Starts playback of the given recording.
Definition: ap_pvr.c:927
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's done for live channels.
Definition: ap_pvr.c:3316
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:2647
void APVR_Initialise(void)
Initialise all PVR resources: filters, recordings etc.
Definition: ap_pvr.c:647
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:2675
void APVR_QRPlay(void)
quick replay current playing recording
Definition: ap_pvr.c:1476
U32BIT APVR_GetPauseProgress(void)
Calculates and returns the number of seconds behind live TV.
Definition: ap_pvr.c:2860
void APVR_PidsUpdated(U8BIT path)
This function should be called when there's an update to the PIDs for a service that's being recorded...
Definition: ap_pvr.c:3498
void APVR_FRPlay(void)
If paused, playback will go into the first available slow motion speed in a reverse direction...
Definition: ap_pvr.c:1369
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:1180
void APVR_StopPlay(BOOLEAN return_to_live)
Stops playback and optionally returns to live TV.
Definition: ap_pvr.c:1201
void APVR_Terminate(void)
Destroy all PVR resources: filters, recordings etc.
Definition: ap_pvr.c:698
void APVR_FFPlay(void)
If paused, playback will go into the first available slow motion speed in a forwards direction...
Definition: ap_pvr.c:1314
U8BIT APVR_StartPauseRecord(void)
Starts recording the live service ready for timeshift playback. The recording may not have started wh...
Definition: ap_pvr.c:2310
BOOLEAN APVR_IsEventInRecordList(U8BIT *prog_crid)
Determines whether the given programme CRID is already in the list of recorded events.
Definition: ap_pvr.c:2963
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:1712
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:2615
BOOLEAN APVR_IsPlaying(void)
Returns whether playback is in progress.
Definition: ap_pvr.c:1094
BOOLEAN APVR_AreSelectedRecordings(U32BIT *handles, U16BIT num_handles)
Checks if any recording in a list is selected.
Definition: ap_pvr.c:2264
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:2791
U8BIT APVR_GetTotalSpacePercentUsed(U16BIT disk_id)
get total percentage of recording space used
Definition: ap_pvr.c:2749
void APVR_SetTimeshiftBufferSize(U16BIT time_in_mins)
Sets the size of the timeshift buffer so that it's able to store a recording of the given length befo...
Definition: ap_pvr.c:2295
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:1124
U8BIT APVR_StartPausePlay(void)
Starts playback of a live timeshift recording started with APVR_StartPauseRecord. This function shoul...
Definition: ap_pvr.c:2426
void APVR_TrickModeMuteOff(void)
Unmute for trick mode.
Definition: ap_pvr.c:1637
U32BIT APVR_GetPlaybackHandle(void)
Returns the handle of the recording currently being played back.
Definition: ap_pvr.c:1041
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:1668
E_PVR_PLAY_STATUS APVR_GetPlayMode(void)
Returns the current play mode according to the current play speed.
Definition: ap_pvr.c:1511
BOOLEAN APVR_IsInitialised(void)
Use to query whether the PVR function is available and ready to be used.
Definition: ap_pvr.c:733
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:2831
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:2159
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:765
void APVR_ReleaseActiveRecordingList(U32BIT *handle_list)
Frees the arrays allocated by APVR_GetActiveRecordingList.
Definition: ap_pvr.c:2139
U8BIT APVR_GetPlaybackPath(void)
Returns the path currently acquired fro playback.
Definition: ap_pvr.c:2905
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:874
void APVR_StopPauseRecord(BOOLEAN return_to_live)
Stops timeshifted playback and recording and optionally restarts decoding of the live signal...
Definition: ap_pvr.c:2507
void APVR_RecordRecommendations(void *crid_ptr, BOOLEAN radio_service)
Searches the schedule for events that are part of the given recommendation and that haven't already b...
Definition: ap_pvr.c:3133
BOOLEAN APVR_IsRecordingInProgress(void)
Returns TRUE if there are any recordings currently in progress.
Definition: ap_pvr.c:2575
System Wide Global Technical Data Type Definitions.
void APVR_TrickModeMuteOn(void)
Mute for trick mode.
Definition: ap_pvr.c:1614
BOOLEAN APVR_StopRecording(U32BIT recording_handle)
Stops the given recording.
Definition: ap_pvr.c:2021
U8BIT APVR_GetActiveRecordingList(U32BIT **handle_list)
Returns an array of recordings currently in progress. Use APVR_ReleaseActiveRecordingList to free the...
Definition: ap_pvr.c:2077
void APVR_RecordSeries(void *crid_ptr, BOOLEAN radio_service)
Seaches the schedule for events that are part of the given series and that haven't already been recor...
Definition: ap_pvr.c:2984
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:2694
BOOLEAN APVR_IsDecodingFile(void)
Returns the PVR play status.
Definition: ap_pvr.c:1052
void APVR_SlowMoPlay(void)
Play in slow mothing mode.
Definition: ap_pvr.c:1422
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:1582
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:2212
BOOLEAN APVR_HandlePrivateTimer(U32BIT timer_handle)
Deals with any private timers started by the PVR module.
Definition: ap_pvr.c:3328
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:3292
void APVR_UnselectAllRecordings(U32BIT *handles, U16BIT num_handles)
Un-select all recordings.
Definition: ap_pvr.c:2241
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:3477
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:2184