DVBCore  17.9.0
Open Source DVB Engine
 All Data Structures Files Functions Typedefs Macros Pages
stbhwmediaplayer.h
Go to the documentation of this file.
1 /*******************************************************************************
2  * Copyright © 2014 The DTVKit Open Software Foundation Ltd (www.dtvkit.org)
3  * Copyright © 2013 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 #ifndef _STBHWMEDIAPLAYER_H
26 #define _STBHWMEDIAPLAYER_H
27 
28 #include "techtype.h"
29 
30 /*---Constant and macro definitions for public use-----------------------------*/
31 
32 /*---Enumerations for public use-----------------------------------------------*/
33 typedef enum
34 {
35  STB_MP_STATE_STOPPED = 0,
36  STB_MP_STATE_PLAYING,
37  STB_MP_STATE_PAUSED,
38  STB_MP_STATE_CONNECTING,
39  STB_MP_STATE_BUFFERING,
40  STB_MP_STATE_FINISHED,
41  STB_MP_STATE_ERROR
42 } E_STB_MP_STATE;
43 
44 typedef enum
45 {
46  STB_MP_COMPONENT_VIDEO = 0,
47  STB_MP_COMPONENT_AUDIO,
48  STB_MP_COMPONENT_SUBTITLE,
49  STB_MP_COMPONENT_ALL
50 } E_STB_MP_COMPONENT_TYPE;
51 
52 typedef enum
53 {
54  STB_MP_NO_ERROR = -1, /* no error */
55  STB_MP_FORMAT_NOT_SUPPORTED = 0, /* 0 - A/V format not supported */
56  STB_MP_CONNECTION_ERROR, /* 1 - cannot connect to server or connection lost.*/
57  STB_MP_UNDEFINED, /* 2 - unidentified error */
58  STB_MP_NO_RESOURCES, /* 3 – insufficient resources */
59  STB_MP_CORRUPT, /* 4 – content corrupt or invalid */
60  STB_MP_NOT_AVAILABLE, /* 5 – content not available */
61  STB_MP_NOT_AVAILABLE_POSITION, /* 6 – content not available at given position */
62  STB_MP_BLOCKED /* 7 - content blocked due to parental control */
63 } E_STB_MP_ERROR;
64 
65 /*---Global type defs for public use-------------------------------------------*/
66 typedef struct
67 {
68  U8BIT component_tag;
69  U16BIT pid;
70  E_STB_MP_COMPONENT_TYPE type;
71  union
72  {
73  struct
74  {
75  E_STB_AV_AUDIO_CODEC encoding;
76  U32BIT lang_code;
77  U8BIT num_channels;
78  BOOLEAN audio_description;
79  } audio;
80  struct
81  {
82  E_STB_AV_VIDEO_CODEC encoding;
83  BOOLEAN hd;
84  U8BIT frame_rate;
85  E_STB_AV_ASPECT_RATIO aspect_ratio;
86  } video;
87  struct
88  {
89  U32BIT lang_code;
90  BOOLEAN hearing_impaired;
91  } subtitle;
92  } av;
93  BOOLEAN encrypted;
94  BOOLEAN active;
96 
97 typedef void (*STB_MP_CALLBACK)(void *handle, E_STB_MP_STATE state);
98 
99 typedef struct
100 {
101  BOOLEAN cache; /* If TRUE, the media player is supposed to load the file and play it from memory */
102  S32BIT loops; /* Number of times the file has to be played, -1 means infinite */
104 
105 /*---Global Function prototypes for public use---------------------------------*/
111 void* STB_MPInit(U8BIT *source_url);
112 
119 E_HW_STATUS STB_MPStart(void *handle, S_STB_MP_START_PARAMS *params);
120 
126 E_HW_STATUS STB_MPPause(void *handle);
127 
133 E_HW_STATUS STB_MPResume(void *handle);
134 
141 E_HW_STATUS STB_MPResize(void *handle, S_RECTANGLE *rect);
142 
148 E_HW_STATUS STB_MPStop(void *handle);
149 
154 void STB_MPExit(void *handle);
155 
166 E_HW_STATUS STB_MPGetTimes(void *handle, U32BIT *begin, U32BIT *current, U32BIT *end);
167 
173 void STB_MPRegisterCallback(void *handle, STB_MP_CALLBACK callback);
174 
181 E_HW_STATUS STB_MPSeek(void *handle, U32BIT position);
182 
192 E_HW_STATUS STB_MPObtainComponentList(void *handle, E_STB_MP_COMPONENT_TYPE type,
193  U32BIT *num_ptr, S_STB_MP_COMPONENT_DETAILS **list_ptr);
194 
200 void STB_MPReleaseComponentList(void *handle, S_STB_MP_COMPONENT_DETAILS *list_ptr);
201 
210 E_HW_STATUS STB_MPSelectComponent(void *handle, S_STB_MP_COMPONENT_DETAILS *component);
211 
219 E_HW_STATUS STB_MPUnselectComponent(void *handle, S_STB_MP_COMPONENT_DETAILS *component);
220 
226 E_STB_MP_ERROR STB_MPGetError(void *handle);
227 
228 #endif /* _STBHWMEDIAPLAYER_H */
229 
230 /******************************************************************************
231  * End of file
232  ******************************************************************************/
E_HW_STATUS STB_MPGetTimes(void *handle, U32BIT *begin, U32BIT *current, U32BIT *end)
Returns start, current and end times in milliseconds for the content currently being presented...
void STB_MPRegisterCallback(void *handle, STB_MP_CALLBACK callback)
Registers a callback to receive notifications of media player change of state.
E_HW_STATUS STB_MPUnselectComponent(void *handle, S_STB_MP_COMPONENT_DETAILS *component)
Forces the specified component to be stopped.
E_HW_STATUS STB_MPResize(void *handle, S_RECTANGLE *rect)
Changes position of video on screen.
Definition: stbhwmediaplayer.h:99
Definition: osdtype.h:56
E_STB_MP_ERROR STB_MPGetError(void *handle)
Returns the actual value of the error when the media player status is STB_MP_STATE_ERROR.
E_HW_STATUS STB_MPSelectComponent(void *handle, S_STB_MP_COMPONENT_DETAILS *component)
Forces the specifed component to be presented, if another component of the same type is already prese...
E_HW_STATUS STB_MPObtainComponentList(void *handle, E_STB_MP_COMPONENT_TYPE type, U32BIT *num_ptr, S_STB_MP_COMPONENT_DETAILS **list_ptr)
Returns a list of components of the specified type available in the currently presented content...
E_HW_STATUS STB_MPSeek(void *handle, U32BIT position)
Seeks the currently presented content to the specified position.
E_HW_STATUS STB_MPPause(void *handle)
Pauses the presentation of content.
void STB_MPExit(void *handle)
Uninitialises the media player module and invalidate the handle.
Definition: stbhwmediaplayer.h:66
System Wide Global Technical Data Type Definitions.
E_HW_STATUS STB_MPStop(void *handle)
Stops the presentation of content.
E_HW_STATUS STB_MPStart(void *handle, S_STB_MP_START_PARAMS *params)
Starts the presentation of content.
E_HW_STATUS STB_MPResume(void *handle)
Resumes the presentation of content.
void STB_MPReleaseComponentList(void *handle, S_STB_MP_COMPONENT_DETAILS *list_ptr)
Releases the list of components returned by STB_MPObtainComponentList.
void * STB_MPInit(U8BIT *source_url)
Initialises the media player module for the specified source.