DVBCore  17.9.0
Open Source DVB Engine
 All Data Structures Files Functions Typedefs Macros Pages
Macros | Typedefs | Enumerations | Functions
stbpvr.c File Reference

PVR control functions. More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <techtype.h>
#include <dbgfuncs.h>
#include "stbhwos.h"
#include "stbhwav.h"
#include "stbpvrpr.h"
#include "stbhwdsk.h"
#include "stbhwmem.h"
#include "stbhwcrypt.h"
#include "stbpvr.h"
#include "stbheap.h"
#include "stbgc.h"
#include "stbuni.h"
#include "stbdpc.h"
#include "stbpvrmsg.h"
#include "stberc.h"
#include "stbllist.h"

Macros

#define DEBUG_CIPLUS
 
#define STB_PVR_PRINT(x)
 
#define DBG_CIP(x)   {U32DHMS gmt = STB_GCNowDHMSGmt(); printf("%02u:%02u:%02u: ", DHMS_HOUR(gmt), DHMS_MINS(gmt), DHMS_SECS(gmt)); STB_SPDebugWrite x; }
 
#define HANDLE_BASE   0x00000001
 
#define DB_FILENAME_LEN   32
 
#define BASENAME_LEN   16
 
#define DB_FILE_EXTENSION   ".odb"
 
#define DB_FILE_EXTENTION_LEN   4
 
#define ODB_MAGIC_1   'O'
 
#define ODB_MAGIC_2   'd'
 
#define ODB_MAGIC_3   'B'
 
#define ODB_CUR_VERSION   1
 
#define BOOKMARK_FILENAME_SIZE   10
 
#define BOOKMARK_TOLERANCE   30 /* +/- number of seconds allowed when finding an existing bookmark */
 
#define REC_AD_RECEIVER_MIX   0
 
#define REC_AD_BROADCAST_MIX   1
 
#define REC_INFO_BUFFER_SIZE   ((sizeof(S_REC_INFO) + (AES128_KEY_SIZE - 1)) & ~(AES128_KEY_SIZE - 1))
 
#define REC_LOCKED   0x0001
 
#define REC_ENCRYPTED   0x0002
 
#define REC_HAS_GUIDANCE   0x0004
 
#define REC_SERIES   0x0008
 
#define REC_RECOMMENDATION   0x0010
 
#define REC_HAS_VIDEO   0x0020
 
#define REC_PARENTAL_LOCK   0x0040
 

Typedefs

typedef struct s_recording S_RECORDING
 

Enumerations

enum  {
  EXT_INFO_SERVICE_NAME, EXT_INFO_SHORT_DESC, EXT_INFO_GUIDANCE, EXT_INFO_EXTENDED_DESC,
  EXT_INFO_CIPLUS_LICENCE, EXT_INFO_CIPLUS_URI, EXT_INFO_CIPLUS_CICAM_ID, EXT_INFO_CIPLUS_PIN
}
 
enum  E_BOOKMARK_TYPE { BOOKMARK_USER, BOOKMARK_PLAYBACK_POSITION }
 

Functions

BOOLEAN STB_PVRInitialise (void)
 Initialises PVR path control. More...
 
void STB_PVRSetStandbyState (BOOLEAN state)
 Sets the standby state of the PVR path control. More...
 
BOOLEAN STB_PVRIsInitialised (void)
 Returns Initialised status. More...
 
U16BIT STB_PVRGetDefaultDisk (void)
 Finds the first mounted (usable) disk. More...
 
BOOLEAN STB_PVRCanDiskBeUsed (U16BIT disk_id)
 Checks whether the given disk can be used for PVR functions. More...
 
BOOLEAN STB_PVRFormat (U16BIT disk_id, E_STB_PVR_FORMATMODE mode, U8BIT *prog)
 Formats disk for PVR. Call this for each mode. More...
 
BOOLEAN STB_PVRRepair (U16BIT disk_id, E_STB_PVR_REPAIRMODE mode, U8BIT *prog)
 Repairs disk for PVR. Call this for each mode. More...
 
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 available. More...
 
BOOLEAN STB_PVRIsValidHandle (U32BIT handle)
 Determines whether the given handle is in the recording database. More...
 
BOOLEAN STB_PVRCreateRecording (U16BIT disk_id, U8BIT *name, U32BIT *handle)
 Create a new recording and return the handle. More...
 
BOOLEAN STB_PVRDestroyRecording (U32BIT handle)
 Completely destroys a recording by deleting all files and removing it from the list of recordings. More...
 
void STB_PVRSaveRecording (U32BIT handle)
 Save all info on the given recording. The filename and disk should already have been setup, either when the recording is first created or when it's read from a disk. More...
 
U16BIT STB_PVRGetRecordingHandles (U32BIT **handle_array)
 Allocates and returns an array of all the recording handles. More...
 
void STB_PVRReleaseRecordingHandles (U32BIT *handle_array)
 Frees the given array of handles allocated by the preceding function. More...
 
BOOLEAN STB_PVRFindRecordingFromCrid (U8BIT *prog_crid, U32BIT *handle)
 Returns the handle of the recording with the given programme CRID. More...
 
BOOLEAN STB_PVRFindNextSplitRecording (U32BIT curr_handle, U32BIT *next_handle)
 Returns the handle of a split event recording that follows on from curr_handle. More...
 
U32BIT STB_PVRGetHandleForRecordingIndex (U8BIT rec_index)
 Returns the handle for the given recording index. More...
 
U8BIT STB_PVRGetPathForRecordingIndex (U8BIT rec_index)
 Returns the path for the given recording index. More...
 
void STB_PVRRecordingSetName (U32BIT handle, U8BIT *name)
 Sets the name for a recording. More...
 
U8BIT * STB_PVRRecordingGetName (U32BIT handle)
 Gets the name for a recording. More...
 
BOOLEAN STB_PVRRecordingGetDateTime (U32BIT handle, U16BIT *date, U8BIT *hours, U8BIT *mins, U8BIT *secs)
 Gets the date and time for a recording. More...
 
BOOLEAN STB_PVRRecordingGetLength (U32BIT handle, U8BIT *length_hours, U8BIT *length_mins, U8BIT *length_secs, U32BIT *rec_size_kb)
 Returns the length in time and size in KB of the recording with the given handle. More...
 
U16BIT STB_PVRRecordingGetDiskId (U32BIT handle)
 Gets the disk id for a recording. More...
 
void STB_PVRRecordingSetOtherCrid (U32BIT handle, U8BIT *crid)
 Sets the series/recommendation CRID for a recording and saves the database file. More...
 
BOOLEAN STB_PVRRecordingGetOtherCrid (U32BIT handle, U8BIT *crid, U16BIT name_len)
 Gets the series/recommendation CRID for a given recording. More...
 
void STB_PVRRecordingSetAdditionalInfo (U32BIT handle, U8BIT *additional_info)
 Sets the additional info string for a recording. More...
 
U8BIT * STB_PVRRecordingGetAdditionalInfo (U32BIT handle)
 Gets the additional info string pointer for a recording. More...
 
void STB_PVRRecordingSetParentalRatingAge (U32BIT handle, U32BIT parental_rating)
 Sets the parental rating age for the specified recording. More...
 
U32BIT STB_PVRRecordingGetParentalRating (U32BIT handle)
 Returns the parental rating age for the specified recording as set by STB_PVRRecordingSetParentalRatingAge. More...
 
void STB_PVRRecordingSetStartPadding (U32BIT handle, S32BIT start_padding)
 Sets the start padding value for the specified recording. More...
 
S32BIT STB_PVRRecordingGetStartPadding (U32BIT handle)
 Gets the start padding value for the specified recording as set by STB_PVRRecordingSetStartPadding. More...
 
void STB_PVRRecordingSetEndPadding (U32BIT handle, S32BIT end_padding)
 Sets the end padding value for the specified recording. More...
 
S32BIT STB_PVRRecordingGetEndPadding (U32BIT handle)
 Gets the end padding value for the specified recording as set by STB_PVRRecordingSetEndPadding. More...
 
void STB_PVRRecordingSetServiceName (U32BIT handle, U8BIT *service_name)
 Sets the service name for a recording and saves the database file. More...
 
BOOLEAN STB_PVRRecordingGetServiceName (U32BIT handle, U8BIT *service_name, U16BIT name_len)
 Gets the service name for a given recording. More...
 
void STB_PVRRecordingSetDescription (U32BIT handle, U8BIT *description)
 Sets the short description for a recorded programme. More...
 
BOOLEAN STB_PVRRecordingGetDescription (U32BIT handle, U8BIT *description, U16BIT desc_len)
 Gets the short description for a given recording. More...
 
U16BIT STB_PVRRecordingGetDescriptionLen (U32BIT handle)
 Gets the length of the short description for a given recording. More...
 
void STB_PVRRecordingSetExtendedDescription (U32BIT handle, U8BIT *description)
 Sets the extended description for a recorded programme. More...
 
BOOLEAN STB_PVRRecordingGetExtendedDescription (U32BIT handle, U8BIT *description, U16BIT desc_len)
 Gets the extended description for a given recording. More...
 
U16BIT STB_PVRRecordingGetExtendedDescriptionLen (U32BIT handle)
 Gets the length of the extended description for a given recording. More...
 
void STB_PVRRecordingSetCrid (U32BIT handle, U8BIT *crid)
 Sets the programme CRID for a recording and saves the database file. More...
 
BOOLEAN STB_PVRRecordingGetCrid (U32BIT handle, U8BIT *crid, U16BIT name_len)
 Gets the programme CRID for a given recording. More...
 
BOOLEAN STB_PVRIsBeingRecorded (U32BIT handle)
 Returns whether the recording with the given handle is currently being recorded. More...
 
void STB_PVRRecordingSetSeries (U32BIT handle)
 Sets a recording to a series recording. More...
 
void STB_PVRRecordingSetRecommendation (U32BIT handle)
 Sets a recording to a recommendation recording. More...
 
BOOLEAN STB_PVRRecordingGetSeries (U32BIT handle)
 Returns whether the given recording is a series. More...
 
BOOLEAN STB_PVRRecordingGetRecommendation (U32BIT handle)
 Returns whether the given recording is a recommendation. More...
 
BOOLEAN STB_PVRRecordingSetLocked (U32BIT handle, BOOLEAN state)
 Sets the locked state of a recording. More...
 
BOOLEAN STB_PVRRecordingGetLocked (U32BIT handle)
 Returns whether the given recording is locked. More...
 
BOOLEAN STB_PVRRecordingSetSelected (U32BIT handle, BOOLEAN state)
 Sets the selected state of a recording. More...
 
BOOLEAN STB_PVRRecordingGetSelected (U32BIT handle)
 Returns whether the given recording is selected. More...
 
BOOLEAN STB_PVRRecordingIsEncrypted (U32BIT handle)
 Returns whether the given recording is encrypted. More...
 
BOOLEAN STB_PVRRecordingSetParentalLock (U32BIT handle, BOOLEAN state)
 Sets the parental lock state of a recording. More...
 
BOOLEAN STB_PVRRecordingGetParentalLock (U32BIT handle)
 Returns the parental lock state of the given recording. More...
 
BOOLEAN STB_PVRRecordingSetGuidance (U32BIT handle, U8BIT *text)
 Sets the guidance text of a recording. More...
 
BOOLEAN STB_PVRRecordingHasGuidance (U32BIT handle)
 Returns whether the given recording has guidance. More...
 
BOOLEAN STB_PVRRecordingGetGuidance (U32BIT handle, U8BIT *text, U16BIT text_len)
 Returns the whether a recording has guidance and the guidance text if available. More...
 
U16BIT STB_PVRRecordingGetGuidanceLen (U32BIT handle)
 Gets the length of the guidance text for a given recording. More...
 
U32BIT STB_PVRGetTimeOfAllRecordings (U16BIT disk_id)
 Calculates the total disk space used in minutes. More...
 
U32BIT STB_PVRGetSizeOfAllRecordings (U16BIT disk_id)
 Calculates the total disk space used in KB for all recordings. More...
 
BOOLEAN STB_PVRStartPlaying (U8BIT path, U32BIT handle, BOOLEAN resume)
 Start the PVR playing. More...
 
BOOLEAN STB_PVRIsPlaying (U8BIT path, U32BIT *handle)
 Reads the PVR play status. More...
 
void STB_PVRSavePlayPosition (U8BIT path)
 Saves the bookmark holding the playback position. This bookmark is used to resume a playback when STB_PVRStartPlaying is called with resume = TRUE. This function should be called while decoders are still running, to be sure the position in the playback is accurate. More...
 
void STB_PVRStopPlaying (U8BIT path)
 Stop the PVR play back. More...
 
BOOLEAN STB_PVRRecordingGetTriplet (U32BIT handle, U16BIT *serv_id, U16BIT *ts_id, U16BIT *orig_net_id)
 Read the DVB triplet (service id, transport id, orig net id) for a recording. More...
 
void STB_PVRStartPlayRunning (U8BIT path)
 Set to start playback in running mode. More...
 
void STB_PVRStartPlayPaused (U8BIT path)
 Set to start playback in paused mode. More...
 
void STB_PVRStartPlaySync (U8BIT path)
 Set to start playback synced to AV decoder. More...
 
BOOLEAN STB_PVRIsPlayVideo (U32BIT handle)
 Returns TRUE if play contains video data. More...
 
BOOLEAN STB_PVRIsPlayAudio (U8BIT path)
 Returns TRUE if play contains audio data. More...
 
BOOLEAN STB_PVRSetRecordingPids (U8BIT path, U16BIT num_pids, S_PVR_PID_INFO *pid_array)
 Saves (takes a copy of) the array of pids to be recorded. More...
 
BOOLEAN STB_PVRUpdateRecordingPids (U8BIT path, U16BIT num_pids, S_PVR_PID_INFO *pid_array)
 Saves (takes a copy of) the array of pids to be recorded and pass them to the platform. More...
 
BOOLEAN STB_PVRSetRecoringTriplet (U8BIT path, U16BIT serv_id, U16BIT ts_id, U16BIT orig_net_id)
 Saves the DVB triplet of the service to be recorded. More...
 
BOOLEAN STB_PVRToggleBookmark (U8BIT path)
 Creates or deletes a bookmark at the current position during playback. If there's a bookmark within a defined number of seconds of the current position then the bookmark is deleted, otherwise one is created. More...
 
BOOLEAN STB_PVRGotoNextBookmark (U8BIT path)
 Jumps playback to the position of the bookmark after the current play position. More...
 
U16BIT STB_PVRGetBookmarks (U8BIT path, void ***bookmarks)
 Allocates and returns an array containing the handles of the bookmarks for the recording currently being played. More...
 
U16BIT STB_PVRGetBookmarksForRecording (U32BIT handle, void ***bookmarks)
 Allocates and returns an array containing the handles of the bookmarks for the recording specified by the given handle. More...
 
void STB_PVRReleaseBookmarks (void **bookmarks, U16BIT num)
 Frees a previously allocated array of bookmark handles. More...
 
U32BIT STB_PVRGetBookmarkTime (void *bookmark_handle)
 Returns the time associated with a bookmark. More...
 
U8BIT * STB_PVRGetBookmarkName (void *bookmark_handle)
 Allocates and returns the name associated with a bookmark. More...
 
void STB_PVRPlaybackNotifyTime (U8BIT path)
 Handles the notification received from the platform code when playback reaches a set position. For CI+, this works out the next URI/licence/pin that needs to be applied, applies them and sets the next notification time. More...
 
BOOLEAN STB_PVRStartRecording (U8BIT path, U32BIT handle)
 Start the PVR record tasks. More...
 
BOOLEAN STB_PVRPauseRecording (U8BIT path)
 Pauses recording after it's been started. More...
 
BOOLEAN STB_PVRResumeRecording (U8BIT path)
 Resumes a recording after it's been paused. More...
 
void STB_PVRStopRecording (U8BIT path)
 Stop the PVR recording. More...
 
BOOLEAN STB_PVRIsRecording (U8BIT path, U32BIT *handle)
 Reads the PVR record status. More...
 
void STB_PVRStartRecordRunning (U8BIT path)
 Set to start recording in running mode. More...
 
void STB_PVRStartRecordPaused (U8BIT path, U32BIT timeshift_seconds)
 Set to start recording in paused mode for timeshift recording. More...
 
BOOLEAN STB_PVRIsRecordVideo (U8BIT path)
 Returns TRUE if record contains video data. More...
 
BOOLEAN STB_PVRIsRecordAudio (U8BIT path)
 Returns TRUE if record contains audio data. More...
 
void STB_PVREncryptRecording (U8BIT path, BOOLEAN state)
 Sets whether a recording should be encrypted. Must be set before the recording is started. More...
 
void STB_PVRPlayNormal (U8BIT path)
 Restarts playback (no trick mode) - has no effect when decoding from demux. More...
 
BOOLEAN STB_PVRIsPlayNormal (U8BIT path)
 Returns TRUE if play is not in trick mode. More...
 
void STB_PVRPlayPause (U8BIT path)
 Pauses play - has no effect when decoding from demux. More...
 
BOOLEAN STB_PVRIsPlayPause (U8BIT path)
 Returns TRUE if play is paused trick mode. More...
 
void STB_PVRPlayForward (U8BIT path)
 Set play forwards - has no effect when decoding from demux. More...
 
BOOLEAN STB_PVRIsPlayForward (U8BIT path)
 Returns TRUE if play is forwards trick mode. More...
 
void STB_PVRPlayReverse (U8BIT path)
 Set play backwards - has no effect when decoding from demux. More...
 
BOOLEAN STB_PVRIsPlayReverse (U8BIT path)
 Returns TRUE if play is backwards trick mode. More...
 
void STB_PVRPlayFrameInc (U8BIT path)
 Increments play by one frame - has no effect when decoding from demux. More...
 
void STB_PVRPlayFrameDec (U8BIT path)
 Decrements play by one frame - has no effect when decoding from demux. More...
 
void STB_PVRPlayMedium (U8BIT path)
 Sets play speed to medium (1x) - has no effect when decoding from demux. More...
 
BOOLEAN STB_PVRIsPlayMedium (U8BIT path)
 Returns TRUE if play speed is medium (1x). More...
 
void STB_PVRPlaySlower (U8BIT path, BOOLEAN include_slow_speeds)
 Decrease play speed - has no effect when decoding from demux. More...
 
BOOLEAN STB_PVRIsPlaySlowest (U8BIT path)
 Returns TRUE if play speed is slowest possible. More...
 
void STB_PVRPlayFaster (U8BIT path, BOOLEAN include_slow_speeds)
 Increase play speed - has no effect when decoding from demux. More...
 
BOOLEAN STB_PVRIsPlayFastest (U8BIT path)
 Returns TRUE if play speed is fastest possible. More...
 
S16BIT STB_PVRGetMinPlaySpeed (U8BIT path)
 Reads the PVR min play speed. More...
 
S16BIT STB_PVRGetMaxPlaySpeed (U8BIT path)
 Reads the PVR max play speed. More...
 
void STB_PVRDiskUsed (U16BIT disk_id, U8BIT *hours, U8BIT *mins)
 Returns disk space used in hours and minutes. More...
 
void STB_PVRDiskFree (U16BIT disk_id, U8BIT *hours, U8BIT *mins)
 Returns disk space free in hours and minutes. More...
 
U32BIT STB_PVRDiskSize (U16BIT disk_id)
 Returns disk size in MBytes. More...
 
BOOLEAN STB_PVRCreateBookmark (U32BIT handle, U32BIT time, U8BIT *name)
 Creates a bookmark associated with the a recording. More...
 
BOOLEAN STB_PVRDeleteBookmark (U32BIT handle, U32BIT time, U8BIT *name)
 Deletes a bookmark associated with the a recording. More...
 

Detailed Description

PVR control functions.

Date
07/02/2003

Function Documentation

BOOLEAN STB_PVRCanDiskBeUsed ( U16BIT  disk_id)

Checks whether the given disk can be used for PVR functions.

Parameters
U16BITdisk_id - disk to be checked
Returns
TRUE if the disk can be used, FALSE otherwise
BOOLEAN STB_PVRCreateBookmark ( U32BIT  handle,
U32BIT  time,
U8BIT *  name 
)

Creates a bookmark associated with the a recording.

Parameters
handleRecording handle
timeTime in seconds since the beginning of the recording
nameNULL terminated string representing the bookmark name, maximum length STB_PVR_NAME_LEN. If name is NULL, a string is formed to represent the bookmark time in the format hh:mm:ss
Returns
TRUE if the bookmark was successfully created, FALSE otherwise.
BOOLEAN STB_PVRCreateRecording ( U16BIT  disk_id,
U8BIT *  name,
U32BIT *  handle 
)

Create a new recording and return the handle.


Parameters
disk_id- ID of disk to be used for the recording
name- name of recording
handle- returned recording handle
Returns
TRUE if successful, FALSE otherwise
BOOLEAN STB_PVRDeleteBookmark ( U32BIT  handle,
U32BIT  time,
U8BIT *  name 
)

Deletes a bookmark associated with the a recording.

Parameters
handleRecording handle
timeTime in seconds since the beginning of the recording
nameNULL terminated string representing the bookmark name, maximum length STB_PVR_NAME_LEN. If name is NULL, a string is formed to represent the bookmark time in the format hh:mm:ss
Returns
TRUE if the bookmark was successfully deleted, FALSE otherwise.
BOOLEAN STB_PVRDestroyRecording ( U32BIT  handle)

Completely destroys a recording by deleting all files and removing it from the list of recordings.


Parameters
handle- handle of recording to be destroyed
Returns
TRUE if recording found and deleted, FALSE otherwise
void STB_PVRDiskFree ( U16BIT  disk_id,
U8BIT *  hours,
U8BIT *  mins 
)

Returns disk space free in hours and minutes.

Parameters
U16BITdisk_id - ID of the disk being queried
U8BIT*hours - returns num of hours
U8BIT*mins - returns num of mins
U32BIT STB_PVRDiskSize ( U16BIT  disk_id)

Returns disk size in MBytes.

Parameters
U16BITdisk_id - ID of the disk being queried
Returns
U32BIT - MB.
void STB_PVRDiskUsed ( U16BIT  disk_id,
U8BIT *  hours,
U8BIT *  mins 
)

Returns disk space used in hours and minutes.

Parameters
U8BIT*hours - returns num of hours
U8BIT*mins - returns num of mins
void STB_PVREncryptRecording ( U8BIT  path,
BOOLEAN  state 
)

Sets whether a recording should be encrypted. Must be set before the recording is started.


Parameters
path- decode path that will be used for the recording
state- TRUE if it's to be encrypted
BOOLEAN STB_PVRFindNextSplitRecording ( U32BIT  curr_handle,
U32BIT *  next_handle 
)

Returns the handle of a split event recording that follows on from curr_handle.


Parameters
curr_handle- handle of the recording
next_handle- handle of recording found, returned
Returns
TRUE if a recording is found, FALSE otherwise
BOOLEAN STB_PVRFindRecordingFromCrid ( U8BIT *  prog_crid,
U32BIT *  handle 
)

Returns the handle of the recording with the given programme CRID.


Parameters
prog_crid- CRID to be searched for
handle- handle of recording found, returned
Returns
TRUE if a recording is found, FALSE otherwise
BOOLEAN STB_PVRFormat ( U16BIT  disk_id,
E_STB_PVR_FORMATMODE  mode,
U8BIT *  prog 
)

Formats disk for PVR. Call this for each mode.

Parameters
U16BITdisk_id - ID of the disk to be, or being, formatted
E_STB_PVR_FORMATMODEmode - format mode
U8BIT*prog - returns progress (0-100%).
Returns
TRUE if successful, else FALSE
U8BIT* STB_PVRGetBookmarkName ( void *  bookmark_handle)

Allocates and returns the name associated with a bookmark.

Parameters
bookmark_handleBookmark handle
Returns
Pointer to the name string. This pointer must freed with STB_FreeMemory
U16BIT STB_PVRGetBookmarks ( U8BIT  path,
void ***  bookmarks 
)

Allocates and returns an array containing the handles of the bookmarks for the recording currently being played.

Parameters
pathPlayback decode path
bookmarksPointer to array of returned bookmark handles
Returns
The number of handles in the allocated array. If this is 0 then array will be NULL.
U16BIT STB_PVRGetBookmarksForRecording ( U32BIT  handle,
void ***  bookmarks 
)

Allocates and returns an array containing the handles of the bookmarks for the recording specified by the given handle.

Parameters
handleRecording handle
bookmarksPointer to array of returned bookmark handles
Returns
The number of handles in the allocated array. If this is 0 then array will be NULL.
U32BIT STB_PVRGetBookmarkTime ( void *  bookmark_handle)

Returns the time associated with a bookmark.

Parameters
bookmark_handleBookmark handle
Returns
Bookmark time
U16BIT STB_PVRGetDefaultDisk ( void  )

Finds the first mounted (usable) disk.

Returns
ID of the disk, or INVALID_DISK_ID if none found
U32BIT STB_PVRGetHandleForRecordingIndex ( U8BIT  rec_index)

Returns the handle for the given recording index.


Parameters
rec_index- recording index
Returns
handle, or 0 if recording isn't found
S16BIT STB_PVRGetMaxPlaySpeed ( U8BIT  path)

Reads the PVR max play speed.

Parameters
U8BITpath - player number
Returns
S8BIT - speed.
S16BIT STB_PVRGetMinPlaySpeed ( U8BIT  path)

Reads the PVR min play speed.

Parameters
U8BITpath - player number
Returns
S8BIT - speed.
U8BIT STB_PVRGetPathForRecordingIndex ( U8BIT  rec_index)

Returns the path for the given recording index.


Parameters
rec_index- recording index
Returns
path, or INVALID_RES_ID if recording isn't found
U16BIT STB_PVRGetRecordingHandles ( U32BIT **  handle_array)

Allocates and returns an array of all the recording handles.


Parameters
handle_array- pointer to array of handles, must be freed using STB_PVRReleaseRecordingHandles
Returns
Number of handles returned in the array
U32BIT STB_PVRGetSizeOfAllRecordings ( U16BIT  disk_id)

Calculates the total disk space used in KB for all recordings.


Parameters
disk_id- disk to be used
Returns
Total size of all recordings in KB
U32BIT STB_PVRGetTimeOfAllRecordings ( U16BIT  disk_id)

Calculates the total disk space used in minutes.


Parameters
disk_id- disk to be used
Returns
Total size of all recordings in minutes
BOOLEAN STB_PVRGotoNextBookmark ( U8BIT  path)

Jumps playback to the position of the bookmark after the current play position.


Parameters
path- playback decode path
Returns
TRUE if a bookmark exists and play position is changed, FALSE otherwise
BOOLEAN STB_PVRInitialise ( void  )

Initialises PVR path control.

Returns
TRUE if initialised, else FALSE
BOOLEAN STB_PVRIsBeingRecorded ( U32BIT  handle)

Returns whether the recording with the given handle is currently being recorded.


Parameters
handle- recording being queried
Returns
TRUE if recording, FALSE otherwise
BOOLEAN STB_PVRIsInitialised ( void  )

Returns Initialised status.

Returns
TRUE if initialised, else FALSE
BOOLEAN STB_PVRIsPlayAudio ( U8BIT  path)

Returns TRUE if play contains audio data.

Parameters
U8BITpath - the ID of the decode path to use
Returns
BOOLEAN.
BOOLEAN STB_PVRIsPlayFastest ( U8BIT  path)

Returns TRUE if play speed is fastest possible.

Parameters
U8BITpath - the ID of the decode path to use
Returns
BOOLEAN.
BOOLEAN STB_PVRIsPlayForward ( U8BIT  path)

Returns TRUE if play is forwards trick mode.

Parameters
U8BITpath - the ID of the decode path to use
Returns
BOOLEAN.
BOOLEAN STB_PVRIsPlaying ( U8BIT  path,
U32BIT *  handle 
)

Reads the PVR play status.

Parameters
U8BITpath - player number
U32BIT*handle - returns handle in use
Returns
BOOLEAN - TRUE if playing, else FALSE.
BOOLEAN STB_PVRIsPlayMedium ( U8BIT  path)

Returns TRUE if play speed is medium (1x).

Parameters
U8BITpath - the ID of the decode path to use
Returns
BOOLEAN.
BOOLEAN STB_PVRIsPlayNormal ( U8BIT  path)

Returns TRUE if play is not in trick mode.

Parameters
U8BITpath - the ID of the decode path to use
Returns
BOOLEAN.
BOOLEAN STB_PVRIsPlayPause ( U8BIT  path)

Returns TRUE if play is paused trick mode.

Parameters
U8BITpath - the ID of the decode path to use
Returns
BOOLEAN.
BOOLEAN STB_PVRIsPlayReverse ( U8BIT  path)

Returns TRUE if play is backwards trick mode.

Parameters
U8BITpath - the ID of the decode path to use
Returns
BOOLEAN.
BOOLEAN STB_PVRIsPlaySlowest ( U8BIT  path)

Returns TRUE if play speed is slowest possible.

Parameters
U8BITpath - the ID of the decode path to use
Returns
BOOLEAN.
BOOLEAN STB_PVRIsPlayVideo ( U32BIT  handle)

Returns TRUE if play contains video data.

Parameters
U32BIThandle - the ID of the decode path to use
Returns
BOOLEAN.
BOOLEAN STB_PVRIsRecordAudio ( U8BIT  path)

Returns TRUE if record contains audio data.

Parameters
U8BITpath - the ID of the decode path to use
Returns
BOOLEAN.
BOOLEAN STB_PVRIsRecording ( U8BIT  path,
U32BIT *  handle 
)

Reads the PVR record status.

Parameters
U8BITpath - decoder number
U32BIT*handle - returns handle in use
Returns
BOOLEAN - TRUE if playing, else FALSE.
BOOLEAN STB_PVRIsRecordVideo ( U8BIT  path)

Returns TRUE if record contains video data.

Parameters
U8BITpath - the ID of the decode path to use
Returns
BOOLEAN.
BOOLEAN STB_PVRIsValidHandle ( U32BIT  handle)

Determines whether the given handle is in the recording database.


Parameters
handle- recording handle to be checked
Returns
TRUE if the handle is found, FALSE otherwise
BOOLEAN STB_PVRPauseRecording ( U8BIT  path)

Pauses recording after it's been started.


Parameters
path- decode path of the recording
Returns
TRUE if recording is paused or is already paused, FALSE otherwise
void STB_PVRPlaybackNotifyTime ( U8BIT  path)

Handles the notification received from the platform code when playback reaches a set position. For CI+, this works out the next URI/licence/pin that needs to be applied, applies them and sets the next notification time.


Parameters
path- decode path
void STB_PVRPlayFaster ( U8BIT  path,
BOOLEAN  include_slow_speeds 
)

Increase play speed - has no effect when decoding from demux.


Parameters
path- ID of the decode path to use
include_slow_speeds- selects whether slow motion speeds, >-100% and <100%, are included
void STB_PVRPlayForward ( U8BIT  path)

Set play forwards - has no effect when decoding from demux.

Parameters
U8BITpath - the ID of the decode path to use
void STB_PVRPlayFrameDec ( U8BIT  path)

Decrements play by one frame - has no effect when decoding from demux.

Parameters
U8BITpath - the ID of the decode path to use
void STB_PVRPlayFrameInc ( U8BIT  path)

Increments play by one frame - has no effect when decoding from demux.

Parameters
U8BITpath - the ID of the decode path to use
void STB_PVRPlayMedium ( U8BIT  path)

Sets play speed to medium (1x) - has no effect when decoding from demux.

Parameters
U8BITpath - the ID of the decode path to use
void STB_PVRPlayNormal ( U8BIT  path)

Restarts playback (no trick mode) - has no effect when decoding from demux.

Parameters
U8BITpath - the ID of the decode path to use
void STB_PVRPlayPause ( U8BIT  path)

Pauses play - has no effect when decoding from demux.

Parameters
U8BITpath - the ID of the decode path to use
void STB_PVRPlayReverse ( U8BIT  path)

Set play backwards - has no effect when decoding from demux.

Parameters
U8BITpath - the ID of the decode path to use
void STB_PVRPlaySlower ( U8BIT  path,
BOOLEAN  include_slow_speeds 
)

Decrease play speed - has no effect when decoding from demux.


Parameters
path- ID of the decode path to use
include_slow_speeds- selects whether slow motion speeds, >-100% and <100%, are included
U8BIT* STB_PVRRecordingGetAdditionalInfo ( U32BIT  handle)

Gets the additional info string pointer for a recording.

Parameters
handlerecording handle
Returns
Pointer to the additional info
BOOLEAN STB_PVRRecordingGetCrid ( U32BIT  handle,
U8BIT *  crid,
U16BIT  name_len 
)

Gets the programme CRID for a given recording.


Parameters
crid- array into which the crid will be copied
name_len- size of the crid array
Returns
TRUE if the recording is found and the crid copied
BOOLEAN STB_PVRRecordingGetDateTime ( U32BIT  handle,
U16BIT *  date,
U8BIT *  hours,
U8BIT *  mins,
U8BIT *  secs 
)

Gets the date and time for a recording.


Parameters
handle- recording handle
date- returned date value
hours- returned time in hours
mins- returned time in minutes
secs- returned time in seconds
Returns
TRUE if the recording is found
BOOLEAN STB_PVRRecordingGetDescription ( U32BIT  handle,
U8BIT *  description,
U16BIT  desc_len 
)

Gets the short description for a given recording.


Parameters
handle- recording handle
description- array into which the description is copied
desc_len- size of the description array
U16BIT STB_PVRRecordingGetDescriptionLen ( U32BIT  handle)

Gets the length of the short description for a given recording.


Parameters
handle- recording handle
Returns
length of the short description text, or 0 if none available
U16BIT STB_PVRRecordingGetDiskId ( U32BIT  handle)

Gets the disk id for a recording.


Parameters
handle- recording handle
Returns
Disk id
S32BIT STB_PVRRecordingGetEndPadding ( U32BIT  handle)

Gets the end padding value for the specified recording as set by STB_PVRRecordingSetEndPadding.

Parameters
handlerecording handle
Returns
End padding value
BOOLEAN STB_PVRRecordingGetExtendedDescription ( U32BIT  handle,
U8BIT *  description,
U16BIT  desc_len 
)

Gets the extended description for a given recording.


Parameters
handle- recording handle
description- array into which the description is copied
desc_len- size of the description array
U16BIT STB_PVRRecordingGetExtendedDescriptionLen ( U32BIT  handle)

Gets the length of the extended description for a given recording.


Parameters
handle- recording handle
Returns
length of the extended description text, or 0 if none available
BOOLEAN STB_PVRRecordingGetGuidance ( U32BIT  handle,
U8BIT *  text,
U16BIT  text_len 
)

Returns the whether a recording has guidance and the guidance text if available.


Parameters
handle- recording handle
text- array into which the guidance text is copied, can be NULL if text isn't required
text_len- size of the array passed in, ignored if text is NULL
Returns
TRUE if recording has guidance, FALSE otherwise
U16BIT STB_PVRRecordingGetGuidanceLen ( U32BIT  handle)

Gets the length of the guidance text for a given recording.


Parameters
handle- recording handle
Returns
length of the guidance text, or 0 if none available
BOOLEAN STB_PVRRecordingGetLength ( U32BIT  handle,
U8BIT *  length_hours,
U8BIT *  length_mins,
U8BIT *  length_secs,
U32BIT *  rec_size_kb 
)

Returns the length in time and size in KB of the recording with the given handle.


Parameters
handle- handle of recording being queried
length_hours- length of the recording in hours, returned
length_mins- length of the recording in minutes, returned
length_secs- length of the recording in seconds, returned
rec_size_kb- size of the recording in KB, returned
Returns
TRUE if the length and size are being returned, FALSE otherwise
BOOLEAN STB_PVRRecordingGetLocked ( U32BIT  handle)

Returns whether the given recording is locked.


Parameters
handle- recording handle
Returns
TRUE if recording is locked, FALSE otherwise
U8BIT* STB_PVRRecordingGetName ( U32BIT  handle)

Gets the name for a recording.


Parameters
handle- recording handle
Returns
Pointer to the name
BOOLEAN STB_PVRRecordingGetOtherCrid ( U32BIT  handle,
U8BIT *  crid,
U16BIT  name_len 
)

Gets the series/recommendation CRID for a given recording.


Parameters
crid- array into which the crid will be copied
name_len- size of the crid array
Returns
TRUE if the recording is found and the crid copied
BOOLEAN STB_PVRRecordingGetParentalLock ( U32BIT  handle)

Returns the parental lock state of the given recording.


Parameters
handle- recording handle
Returns
TRUE if recording is locked, FALSE otherwise
U32BIT STB_PVRRecordingGetParentalRating ( U32BIT  handle)

Returns the parental rating age for the specified recording as set by STB_PVRRecordingSetParentalRatingAge.

Parameters
handlerecording handle
Returns
Parental rating age
BOOLEAN STB_PVRRecordingGetRecommendation ( U32BIT  handle)

Returns whether the given recording is a recommendation.


Parameters
handle- recording handle
Returns
TRUE if recording is a recommendation, FALSE otherwise
BOOLEAN STB_PVRRecordingGetSelected ( U32BIT  handle)

Returns whether the given recording is selected.


Parameters
handle- recording handle
Returns
TRUE if recording is selected, FALSE otherwise
BOOLEAN STB_PVRRecordingGetSeries ( U32BIT  handle)

Returns whether the given recording is a series.


Parameters
handle- recording handle
Returns
TRUE if recording is part of a series, FALSE otherwise
BOOLEAN STB_PVRRecordingGetServiceName ( U32BIT  handle,
U8BIT *  service_name,
U16BIT  name_len 
)

Gets the service name for a given recording.


Parameters
service_name- array into which the name will be copied
name_len- size of the name array
Returns
TRUE if the recording is found and it's database file is successfully opened
S32BIT STB_PVRRecordingGetStartPadding ( U32BIT  handle)

Gets the start padding value for the specified recording as set by STB_PVRRecordingSetStartPadding.

Parameters
handlerecording handle
Returns
Start padding value
BOOLEAN STB_PVRRecordingGetTriplet ( U32BIT  handle,
U16BIT *  serv_id,
U16BIT *  ts_id,
U16BIT *  orig_net_id 
)

Read the DVB triplet (service id, transport id, orig net id) for a recording.


Parameters
handle- handle of recording
serv_id- pointer to return service id
ts_id- pointer to return transport id
orig_net_id- pointer to return original network id
Returns
TRUE if values are returned
BOOLEAN STB_PVRRecordingHasGuidance ( U32BIT  handle)

Returns whether the given recording has guidance.


Parameters
handle- recording handle
Returns
TRUE if recording has guidance, FALSE otherwise
BOOLEAN STB_PVRRecordingIsEncrypted ( U32BIT  handle)

Returns whether the given recording is encrypted.


Parameters
handle- recording handle
Returns
TRUE if recording is encrypted, FALSE otherwise
void STB_PVRRecordingSetAdditionalInfo ( U32BIT  handle,
U8BIT *  additional_info 
)

Sets the additional info string for a recording.

Parameters
handlerecording handle
additional_infoadditional info to be set
void STB_PVRRecordingSetCrid ( U32BIT  handle,
U8BIT *  crid 
)

Sets the programme CRID for a recording and saves the database file.


Parameters
handle- recording handle
crid- programme crid string
void STB_PVRRecordingSetDescription ( U32BIT  handle,
U8BIT *  description 
)

Sets the short description for a recorded programme.


Parameters
handle- recording handle
description- text string
void STB_PVRRecordingSetEndPadding ( U32BIT  handle,
S32BIT  end_padding 
)

Sets the end padding value for the specified recording.

Parameters
handlerecording handle
start_paddingend padding value
void STB_PVRRecordingSetExtendedDescription ( U32BIT  handle,
U8BIT *  description 
)

Sets the extended description for a recorded programme.


Parameters
handle- recording handle
description- text string
BOOLEAN STB_PVRRecordingSetGuidance ( U32BIT  handle,
U8BIT *  text 
)

Sets the guidance text of a recording.


Parameters
handle- recording handle
text- guidance text
Returns
TRUE if recording is valid, FALSE otherwise
BOOLEAN STB_PVRRecordingSetLocked ( U32BIT  handle,
BOOLEAN  state 
)

Sets the locked state of a recording.


Parameters
handle- recording handle
state- TRUE for locked, FALSE for unlocked
Returns
TRUE if recording is valid, FALSE otherwise
void STB_PVRRecordingSetName ( U32BIT  handle,
U8BIT *  name 
)

Sets the name for a recording.


Parameters
handle- recording handle
name- name to be set
void STB_PVRRecordingSetOtherCrid ( U32BIT  handle,
U8BIT *  crid 
)

Sets the series/recommendation CRID for a recording and saves the database file.


Parameters
handle- recording handle
crid- crid string
BOOLEAN STB_PVRRecordingSetParentalLock ( U32BIT  handle,
BOOLEAN  state 
)

Sets the parental lock state of a recording.


Parameters
handle- recording handle
state- TRUE for locked, FALSE for unlocked
Returns
TRUE if recording is valid, FALSE otherwise
void STB_PVRRecordingSetParentalRatingAge ( U32BIT  handle,
U32BIT  parental_rating 
)

Sets the parental rating age for the specified recording.

Parameters
handlerecording handle
parental_ratingparental rating age
void STB_PVRRecordingSetRecommendation ( U32BIT  handle)

Sets a recording to a recommendation recording.


Parameters
handle- recording handle
crid- crid string
BOOLEAN STB_PVRRecordingSetSelected ( U32BIT  handle,
BOOLEAN  state 
)

Sets the selected state of a recording.


Parameters
handle- recording handle
state- TRUE for selected, FALSE for unselected
Returns
TRUE if recording is valid, FALSE otherwise
void STB_PVRRecordingSetSeries ( U32BIT  handle)

Sets a recording to a series recording.


Parameters
handle- recording handle
crid- crid string
void STB_PVRRecordingSetServiceName ( U32BIT  handle,
U8BIT *  service_name 
)

Sets the service name for a recording and saves the database file.


Parameters
handle- recording handle
service_name- service name to be set
void STB_PVRRecordingSetStartPadding ( U32BIT  handle,
S32BIT  start_padding 
)

Sets the start padding value for the specified recording.

Parameters
handlerecording handle
start_paddingstart padding value
void STB_PVRReleaseBookmarks ( void **  bookmarks,
U16BIT  num 
)

Frees a previously allocated array of bookmark handles.

Parameters
bookmarksArray of bookmark handles to be freed
numNumber of handles in the array.
void STB_PVRReleaseRecordingHandles ( U32BIT *  handle_array)

Frees the given array of handles allocated by the preceding function.


Parameters
handle_array- array to be freed
BOOLEAN STB_PVRRepair ( U16BIT  disk_id,
E_STB_PVR_REPAIRMODE  mode,
U8BIT *  prog 
)

Repairs disk for PVR. Call this for each mode.

Parameters
U16BITdisk_id - ID of the disk to be, or being, repaired
E_STB_PVR_REPAIRMODEmode - repair mode
U8BIT*prog - returns progress (0-100%).
Returns
TRUE if successful, else FALSE
BOOLEAN STB_PVRResumeRecording ( U8BIT  path)

Resumes a recording after it's been paused.


Parameters
path- decode path of the recording
Returns
TRUE if the recording is resumed or isn't currently paused, FALSE otherwise
void STB_PVRSavePlayPosition ( U8BIT  path)

Saves the bookmark holding the playback position. This bookmark is used to resume a playback when STB_PVRStartPlaying is called with resume = TRUE. This function should be called while decoders are still running, to be sure the position in the playback is accurate.

Parameters
U8BITpath Playback path
void STB_PVRSaveRecording ( U32BIT  handle)

Save all info on the given recording. The filename and disk should already have been setup, either when the recording is first created or when it's read from a disk.


Parameters
handle- recording handle
BOOLEAN STB_PVRSetRecordingPids ( U8BIT  path,
U16BIT  num_pids,
S_PVR_PID_INFO pid_array 
)

Saves (takes a copy of) the array of pids to be recorded.


Parameters
path- decode path that will be used for the recording
num_pids- number of pids in the array
pid_array- array of structures describing PIDs
Returns
TRUE if the PIDs are saved successfully, FALSE otherwise
BOOLEAN STB_PVRSetRecoringTriplet ( U8BIT  path,
U16BIT  serv_id,
U16BIT  ts_id,
U16BIT  orig_net_id 
)

Saves the DVB triplet of the service to be recorded.


Parameters
path- decode path that will be used for the recording
serv_id- service id
ts_id- transport stream
orig_net_id- original network id
Returns
TRUE if the triplet is saved successfully, FALSE otherwise
void STB_PVRSetStandbyState ( BOOLEAN  state)

Sets the standby state of the PVR path control.

Parameters
state- TRUE if PVR is being put into standby, FALSE otherwise
BOOLEAN STB_PVRStartPlaying ( U8BIT  path,
U32BIT  handle,
BOOLEAN  resume 
)

Start the PVR playing.

Parameters
U8BITpath - player number
U32BIThandle - handle to use for play file
Returns
TRUE is playback starts, FALSE otherwise
void STB_PVRStartPlayPaused ( U8BIT  path)

Set to start playback in paused mode.

Parameters
U8BITpath - the ID of the decode path to use
void STB_PVRStartPlayRunning ( U8BIT  path)

Set to start playback in running mode.

Parameters
U8BITpath - the ID of the decode path to use
void STB_PVRStartPlaySync ( U8BIT  path)

Set to start playback synced to AV decoder.

Parameters
U8BITpath - the ID of the decode path to use
BOOLEAN STB_PVRStartRecording ( U8BIT  path,
U32BIT  handle 
)

Start the PVR record tasks.

Parameters
U8BITpath - recorder number
U32BIThandle - handle to use for play file
void STB_PVRStartRecordPaused ( U8BIT  path,
U32BIT  timeshift_seconds 
)

Set to start recording in paused mode for timeshift recording.

Parameters
U8BITpath - the ID of the decode path to use
U32BITtimeshift_seconds - the size of the timeshift buffer in seconds
void STB_PVRStartRecordRunning ( U8BIT  path)

Set to start recording in running mode.

Parameters
U8BITpath - the ID of the decode path to use
void STB_PVRStopPlaying ( U8BIT  path)

Stop the PVR play back.

Parameters
U8BITpath - player number
void STB_PVRStopRecording ( U8BIT  path)

Stop the PVR recording.

Parameters
U8BITpath - recorder number
BOOLEAN STB_PVRToggleBookmark ( U8BIT  path)

Creates or deletes a bookmark at the current position during playback. If there's a bookmark within a defined number of seconds of the current position then the bookmark is deleted, otherwise one is created.


Parameters
path- playback decode path
Returns
TRUE if a bookmark is created or deleted, FALSE otherwise
BOOLEAN STB_PVRUpdateRecordingPids ( U8BIT  path,
U16BIT  num_pids,
S_PVR_PID_INFO pid_array 
)

Saves (takes a copy of) the array of pids to be recorded and pass them to the platform.


Parameters
path- decode path that used for the recording
num_pids- number of pids in the array
pid_array- array of structures describing PIDs
Returns
TRUE if the PIDs are updated successfully, FALSE otherwise
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 available.


Parameters
force_load- forces the recordings database to be updated