HbbTv  17.9.0
Open source HBBTV engine
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
hbbtv_sif_mediaplayer.h
Go to the documentation of this file.
1 /*******************************************************************************
2  * Copyright © 2014 The DTVKit Open Software Foundation Ltd (www.dtvkit.org)
3  * Copyright © 2014 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  *******************************************************************************/
26 /* pre-processor mechanism so multiple inclusions don't cause compilation error*/
27 
28 #ifndef _HBBTV_SIF_MEDIAPLAYER_H
29 
30 #define _HBBTV_SIF_MEDIAPLAYER_H
31 
32 #include "techtype.h"
33 #include "hbbtv_types.h"
34 
35 
36 /*---Constant and macro definitions for public use-----------------------------*/
37 
38 /*---Enumerations for public use-----------------------------------------------*/
39 
40 typedef enum
41 {
42  HBBTV_MP_NO_ERROR = -1, /* no error */
43  HBBTV_MP_FORMAT_NOT_SUPPORTED = 0, /* 0 - A/V format not supported */
44  HBBTV_MP_CONNECTION_ERROR, /* 1 - cannot connect to server or connection lost.*/
45  HBBTV_MP_UNDEFINED, /* 2 - unidentified error */
46  HBBTV_MP_NO_RESOURCES, /* 3 – insufficient resources */
47  HBBTV_MP_CORRUPT, /* 4 – content corrupt or invalid */
48  HBBTV_MP_NOT_AVAILABLE, /* 5 – content not available */
49  HBBTV_MP_NOT_AVAILABLE_POSITION, /* 6 – content not available at given position */
50  HBBTV_MP_BLOCKED /* 7 - content blocked due to parental control */
51 } E_HBBTV_MP_ERROR;
52 
53 
54 /*---Global type defs for public use-------------------------------------------*/
55 
56 typedef struct
57 {
58  /* If TRUE, the media player is supposed to load the file and play it from memory */
59  BOOLEAN cache;
60  /* Number of times the file has to be played, -1 means infinite */
61  S32BIT loops;
63 
64 
65 /*---Global Function prototypes for public use---------------------------------*/
66 
67 #if defined(__cplusplus)
68 extern "C" {
69 #endif
70 
71 
77 void* HBBTV_MPInit(U8BIT *source_url);
78 
83 void HBBTV_MPExit(void *ihdl);
84 
93 E_HBBTV_ERR HBBTV_MPStart(void *ihdl, S_HBBTV_MP_START_PARAMS *params);
94 
102 E_HBBTV_ERR HBBTV_MPStop(void *ihdl);
103 
111 E_HBBTV_ERR HBBTV_MPPause(void *ihdl);
112 
120 E_HBBTV_ERR HBBTV_MPResume(void *ihdl);
121 
131 E_HBBTV_ERR HBBTV_MPResize(void *ihdl, S_HBBTV_RECT *rect);
132 
143 E_HBBTV_ERR HBBTV_MPGetTimes(void *ihdl, U32BIT *begin, U32BIT *current, U32BIT *end);
144 
153 E_HBBTV_ERR HBBTV_MPSeek(void *ihdl, U32BIT position);
154 
167 E_HBBTV_ERR HBBTV_MPObtainComponentList(void *ihdl, E_HBBTV_COMPONENT_TYPE type, U32BIT *num_ptr,
168  S_HBBTV_COMPONENT_DETAILS **list_ptr);
169 
176 void HBBTV_MPReleaseComponentList(void *ihdl, S_HBBTV_COMPONENT_DETAILS *list_ptr);
177 
188 E_HBBTV_ERR HBBTV_MPSelectComponent(void *ihdl, S_HBBTV_COMPONENT_DETAILS *component);
189 
199 E_HBBTV_ERR HBBTV_MPUnselectComponent(void *ihdl, S_HBBTV_COMPONENT_DETAILS *component);
200 
209 E_HBBTV_MP_ERROR HBBTV_MPGetError(void *ihdl);
210 
211 #if defined(__cplusplus)
212 }
213 #endif
214 
215 #endif /* _HBBTV_SIF_MEDIAPLAYER_H */
E_HBBTV_ERR HBBTV_MPResize(void *ihdl, S_HBBTV_RECT *rect)
Changes position and size of the video presentation window.
E_HBBTV_ERR HBBTV_MPSelectComponent(void *ihdl, S_HBBTV_COMPONENT_DETAILS *component)
Replaces any component of the same type with the specified one. If the component_tag field is set to ...
void HBBTV_MPReleaseComponentList(void *ihdl, S_HBBTV_COMPONENT_DETAILS *list_ptr)
Release data allocated by HBBTV_MPObtainComponentList. Always called immediately after the HbbTV engi...
Definition of general purpose types.
E_HBBTV_ERR HBBTV_MPResume(void *ihdl)
Resumes playing of file.
E_HBBTV_ERR HBBTV_MPGetTimes(void *ihdl, U32BIT *begin, U32BIT *current, U32BIT *end)
Gets the current play position.
E_HBBTV_ERR HBBTV_MPSeek(void *ihdl, U32BIT position)
Sets the play position.
Definition: hbbtv_types.h:173
E_HBBTV_MP_ERROR HBBTV_MPGetError(void *ihdl)
Retrieves the error code from the media player. The HbbTV engine uses this function to retrieve the e...
Definition: hbbtv_sif_types.h:64
Definition: hbbtv_sif_mediaplayer.h:56
E_HBBTV_ERR HBBTV_MPStop(void *ihdl)
Stops playing file.
E_HBBTV_ERR HBBTV_MPPause(void *ihdl)
Pauses playing of file.
void * HBBTV_MPInit(U8BIT *source_url)
Initialises Media Player with the source URL.
E_HBBTV_ERR HBBTV_MPStart(void *ihdl, S_HBBTV_MP_START_PARAMS *params)
Starts playing file given by HBBTV_MPInit.
E_HBBTV_ERR HBBTV_MPObtainComponentList(void *ihdl, E_HBBTV_COMPONENT_TYPE type, U32BIT *num_ptr, S_HBBTV_COMPONENT_DETAILS **list_ptr)
Retrieves the list of available components. Provided HBBTV_OK is returned, the HbbTV engine will call...
System Wide Global Technical Data Type Definitions.
E_HBBTV_ERR HBBTV_MPUnselectComponent(void *ihdl, S_HBBTV_COMPONENT_DETAILS *component)
Stops rendering the specified component. If the component_tag field is set to -1, any component with ...
void HBBTV_MPExit(void *ihdl)
Releases the Media Player and the associated resources.