DVBCore  1.0
Open source DVB engine
platform/inc/stbhwmediaplayer.h
Go to the documentation of this file.
00001 /*******************************************************************************
00002  * Copyright © 2014 The DTVKit Open Software Foundation Ltd (www.dtvkit.org)
00003  * Copyright © 2013 Ocean Blue Software Ltd
00004  *
00005  * This file is part of a DTVKit Software Component
00006  * You are permitted to copy, modify or distribute this file subject to the terms
00007  * of the DTVKit 1.0 Licence which can be found in licence.txt or at www.dtvkit.org
00008  * 
00009  * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
00010  * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES
00011  * OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
00012  * 
00013  * If you or your organisation is not a member of DTVKit then you have access
00014  * to this source code outside of the terms of the licence agreement
00015  * and you are expected to delete this and any associated files immediately.
00016  * Further information on DTVKit, membership and terms can be found at www.dtvkit.org
00017  *******************************************************************************/
00025 #ifndef _STBHWMEDIAPLAYER_H
00026 #define _STBHWMEDIAPLAYER_H
00027 
00028 /*---Constant and macro definitions for public use-----------------------------*/
00029 
00030 /*---Enumerations for public use-----------------------------------------------*/
00031 typedef enum
00032 {
00033    STB_MP_STATE_STOPPED = 0,
00034    STB_MP_STATE_PLAYING,
00035    STB_MP_STATE_PAUSED,
00036    STB_MP_STATE_CONNECTING,
00037    STB_MP_STATE_BUFFERING,
00038    STB_MP_STATE_FINISHED,
00039    STB_MP_STATE_ERROR
00040 } E_STB_MP_STATE;
00041 
00042 typedef enum
00043 {
00044    STB_MP_COMPONENT_VIDEO = 0,
00045    STB_MP_COMPONENT_AUDIO,
00046    STB_MP_COMPONENT_SUBTITLE,
00047    STB_MP_COMPONENT_ALL
00048 } E_STB_MP_COMPONENT_TYPE;
00049 
00050 typedef enum
00051 {
00052    STB_MP_NO_ERROR = -1,              /* no error */
00053    STB_MP_FORMAT_NOT_SUPPORTED = 0,   /* 0 - A/V format not supported */
00054    STB_MP_CONNECTION_ERROR,           /* 1 - cannot connect to server or connection lost.*/
00055    STB_MP_UNDEFINED,                  /* 2 - unidentified error */
00056    STB_MP_NO_RESOURCES,               /* 3 – insufficient resources */
00057    STB_MP_CORRUPT,                    /* 4 – content corrupt or invalid */
00058    STB_MP_NOT_AVAILABLE,              /* 5 – content not available */
00059    STB_MP_NOT_AVAILABLE_POSITION,     /* 6 – content not available at given position */
00060    STB_MP_BLOCKED                     /* 7 - content blocked due to parental control */
00061 } E_STB_MP_ERROR;
00062 
00063 /*---Global type defs for public use-------------------------------------------*/
00064 typedef struct
00065 {
00066    U8BIT component_tag;
00067    U16BIT pid;
00068    E_STB_MP_COMPONENT_TYPE type;
00069    union
00070    {
00071       struct
00072       {
00073          E_STB_AV_AUDIO_CODEC encoding;
00074          U32BIT lang_code;
00075          U8BIT num_channels;
00076          BOOLEAN audio_description;
00077       } audio;
00078       struct
00079       {
00080          E_STB_AV_VIDEO_CODEC encoding;
00081          BOOLEAN hd;
00082          U8BIT frame_rate;
00083          E_STB_AV_ASPECT_RATIO aspect_ratio;
00084       } video;
00085       struct
00086       {
00087          U32BIT lang_code;
00088          BOOLEAN hearing_impaired;
00089       } subtitle;
00090    } av;
00091    BOOLEAN encrypted;
00092    BOOLEAN active;
00093 } S_STB_MP_COMPONENT_DETAILS;
00094 
00095 typedef void (*STB_MP_CALLBACK)(void *handle, E_STB_MP_STATE state);
00096 
00097 typedef struct
00098 {
00099    BOOLEAN cache; /* If TRUE, the media player is supposed to load the file and play it from memory */
00100    S32BIT loops; /* Number of times the file has to be played, -1 means infinite */
00101 } S_STB_MP_START_PARAMS;
00102 
00103 /*---Global Function prototypes for public use---------------------------------*/
00109 void* STB_MPInit(U8BIT *source_url);
00110 
00117 E_HW_STATUS STB_MPStart(void *handle, S_STB_MP_START_PARAMS *params);
00118 
00124 E_HW_STATUS STB_MPPause(void *handle);
00125 
00131 E_HW_STATUS STB_MPResume(void *handle);
00132 
00139 E_HW_STATUS STB_MPResize(void *handle, S_RECTANGLE *rect);
00140 
00146 E_HW_STATUS STB_MPStop(void *handle);
00147 
00152 void STB_MPExit(void *handle);
00153 
00164 E_HW_STATUS STB_MPGetTimes(void *handle, U32BIT *begin, U32BIT *current, U32BIT *end);
00165 
00171 void STB_MPRegisterCallback(void *handle, STB_MP_CALLBACK callback);
00172 
00179 E_HW_STATUS STB_MPSeek(void *handle, U32BIT position);
00180 
00190 E_HW_STATUS STB_MPObtainComponentList(void *handle, E_STB_MP_COMPONENT_TYPE type,
00191    U32BIT *num_ptr, S_STB_MP_COMPONENT_DETAILS **list_ptr);
00192 
00198 void STB_MPReleaseComponentList(void *handle, S_STB_MP_COMPONENT_DETAILS *list_ptr);
00199 
00208 E_HW_STATUS STB_MPSelectComponent(void *handle, S_STB_MP_COMPONENT_DETAILS *component);
00209 
00217 E_HW_STATUS STB_MPUnselectComponent(void *handle, S_STB_MP_COMPONENT_DETAILS *component);
00218 
00224 E_STB_MP_ERROR STB_MPGetError(void *handle);
00225 
00226 #endif /*  _STBHWMEDIAPLAYER_H */
00227 
00228 /******************************************************************************
00229  * End of file
00230  ******************************************************************************/
 All Data Structures Files Functions Typedefs Defines