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

Media player API. More...

#include "techtype.h"

Go to the source code of this file.

Data Structures

struct  S_STB_MP_COMPONENT_DETAILS
 
struct  S_STB_MP_START_PARAMS
 

Typedefs

typedef void(* STB_MP_CALLBACK )(void *handle, E_STB_MP_STATE state)
 

Enumerations

enum  E_STB_MP_STATE {
  STB_MP_STATE_STOPPED = 0, STB_MP_STATE_PLAYING, STB_MP_STATE_PAUSED, STB_MP_STATE_CONNECTING,
  STB_MP_STATE_BUFFERING, STB_MP_STATE_FINISHED, STB_MP_STATE_ERROR
}
 
enum  E_STB_MP_COMPONENT_TYPE { STB_MP_COMPONENT_VIDEO = 0, STB_MP_COMPONENT_AUDIO, STB_MP_COMPONENT_SUBTITLE, STB_MP_COMPONENT_ALL }
 
enum  E_STB_MP_ERROR {
  STB_MP_NO_ERROR = -1, STB_MP_FORMAT_NOT_SUPPORTED = 0, STB_MP_CONNECTION_ERROR, STB_MP_UNDEFINED,
  STB_MP_NO_RESOURCES, STB_MP_CORRUPT, STB_MP_NOT_AVAILABLE, STB_MP_NOT_AVAILABLE_POSITION,
  STB_MP_BLOCKED
}
 

Functions

void * STB_MPInit (U8BIT *source_url)
 Initialises the media player module for the specified source. More...
 
E_HW_STATUS STB_MPStart (void *handle, S_STB_MP_START_PARAMS *params)
 Starts the presentation of content. More...
 
E_HW_STATUS STB_MPPause (void *handle)
 Pauses the presentation of content. More...
 
E_HW_STATUS STB_MPResume (void *handle)
 Resumes the presentation of content. More...
 
E_HW_STATUS STB_MPResize (void *handle, S_RECTANGLE *rect)
 Changes position of video on screen. More...
 
E_HW_STATUS STB_MPStop (void *handle)
 Stops the presentation of content. More...
 
void STB_MPExit (void *handle)
 Uninitialises the media player module and invalidate the handle. More...
 
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. More...
 
void STB_MPRegisterCallback (void *handle, STB_MP_CALLBACK callback)
 Registers a callback to receive notifications of media player change of state. More...
 
E_HW_STATUS STB_MPSeek (void *handle, U32BIT position)
 Seeks the currently presented content to the specified position. More...
 
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. More...
 
void STB_MPReleaseComponentList (void *handle, S_STB_MP_COMPONENT_DETAILS *list_ptr)
 Releases the list of components returned by STB_MPObtainComponentList. More...
 
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 presented, it will be removed. More...
 
E_HW_STATUS STB_MPUnselectComponent (void *handle, S_STB_MP_COMPONENT_DETAILS *component)
 Forces the specified component to be stopped. More...
 
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. More...
 

Detailed Description

Media player API.

Date
22/03/2013
Author
Sergio Panseri

Function Documentation

void STB_MPExit ( void *  handle)

Uninitialises the media player module and invalidate the handle.

Parameters
handlemedia player handle
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.

Returns
Error code when the media player is in STB_MP_STATE_ERROR status, STB_MP_NO_ERROR otherwise
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.

Parameters
handlemedia player handle
beginpointer to the variable where the begin time is stored. The value returned for the begin time depend on the platform implementation and might not be always 0.
currentpointer to the variable where the current time is stored.
endpointer to the variable where the end time is stored
Returns
HW_OK if successful, error code otherwise
void* STB_MPInit ( U8BIT *  source_url)

Initialises the media player module for the specified source.

Parameters
source_urlsource URL to be presented
Returns
media player handle
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.

Parameters
handlemedia player handle
typetype of component or STB_MP_COMPONENT_ALL to receive all of them
num_ptrpointer to the number of components found
list_ptrpointer to the list, must be freed using STB_MPReleaseComponentList
Returns
HW_OK if successful, error code otherwise
E_HW_STATUS STB_MPPause ( void *  handle)

Pauses the presentation of content.

Parameters
handlemedia player handle
Returns
HW_OK if successful, error code otherwise
void STB_MPRegisterCallback ( void *  handle,
STB_MP_CALLBACK  callback 
)

Registers a callback to receive notifications of media player change of state.

Parameters
handlemedia player handle
callbackpointer to the callback function
void STB_MPReleaseComponentList ( void *  handle,
S_STB_MP_COMPONENT_DETAILS list_ptr 
)

Releases the list of components returned by STB_MPObtainComponentList.

Parameters
handlemedia player handle
list_ptrlist to be freed
E_HW_STATUS STB_MPResize ( void *  handle,
S_RECTANGLE rect 
)

Changes position of video on screen.

Parameters
handlemedia player handle
rectrectangle structure representing the expected position of video
Returns
HW_OK if successful, error code otherwise
E_HW_STATUS STB_MPResume ( void *  handle)

Resumes the presentation of content.

Parameters
handlemedia player handle
Returns
HW_OK if successful, error code otherwise
E_HW_STATUS STB_MPSeek ( void *  handle,
U32BIT  position 
)

Seeks the currently presented content to the specified position.

Parameters
handlemedia player handle
positionposition in milliseconds
Returns
HW_OK if successful, error code otherwise
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 presented, it will be removed.

Parameters
handlemedia player handle
componentpointer to the componente to be presented, this must be one of the elements of the component list retured by STB_MPObtainComponentList.
Returns
HW_OK if successful, error code otherwise
E_HW_STATUS STB_MPStart ( void *  handle,
S_STB_MP_START_PARAMS params 
)

Starts the presentation of content.

Parameters
handlemedia player handle
paramsparameters to control the display
Returns
HW_OK if successful, error code otherwise
E_HW_STATUS STB_MPStop ( void *  handle)

Stops the presentation of content.

Parameters
handlemedia player handle
Returns
HW_OK if successful, error code otherwise
E_HW_STATUS STB_MPUnselectComponent ( void *  handle,
S_STB_MP_COMPONENT_DETAILS component 
)

Forces the specified component to be stopped.

Parameters
handlemedia player handle
componentpointer to the componente to be presented, this must be one of the elements of the component list retured by STB_MPObtainComponentList.
Returns
HW_OK if successful, error code otherwise