DVBCore  1.0
Open source DVB engine
platform/inc/stbhwav.h
Go to the documentation of this file.
00001 /*******************************************************************************
00002  * Copyright © 2014 The DTVKit Open Software Foundation Ltd (www.dtvkit.org)
00003  * Copyright © 2004 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  *******************************************************************************/
00024 // pre-processor mechanism so multiple inclusions don't cause compilation error
00025 
00026 #ifndef _STBHWAV_H
00027 #define _STBHWAV_H
00028 
00029 #include "stbhwc.h"
00030 #include "osdtype.h"
00031 
00032 //---Constant and macro definitions for public use-----------------------------
00033 
00034 //---Enumerations for public use-----------------------------------------------
00035 
00036 typedef enum e_stb_av_audio_mode
00037 {
00038    AV_AUDIO_STEREO = 0,
00039    AV_AUDIO_LEFT = 1,
00040    AV_AUDIO_RIGHT = 2,
00041    AV_AUDIO_MONO = 3,
00042    AV_AUDIO_MULTICHANNEL = 4
00043 } E_STB_AV_AUDIO_MODE;
00044 
00045 typedef enum e_stb_av_decode_source
00046 {
00047    AV_DEMUX = 0,
00048    AV_MEMORY = 1
00049 } E_STB_AV_DECODE_SOURCE;
00050 
00051 typedef enum e_stb_av_video_codec
00052 {
00053    AV_VIDEO_CODEC_AUTO = 0,
00054    AV_VIDEO_CODEC_MPEG1 = 1,
00055    AV_VIDEO_CODEC_MPEG2 = 2,
00056    AV_VIDEO_CODEC_H264 = 3
00057 } E_STB_AV_VIDEO_CODEC;
00058 
00059 typedef enum e_stb_av_audio_codec
00060 {
00061    AV_AUDIO_CODEC_AUTO = 0,
00062    AV_AUDIO_CODEC_MP2 = 1,
00063    AV_AUDIO_CODEC_MP3 = 2,
00064    AV_AUDIO_CODEC_AC3 = 3,
00065    AV_AUDIO_CODEC_EAC3 = 4,
00066    AV_AUDIO_CODEC_AAC = 5,
00067    AV_AUDIO_CODEC_HEAAC = 6
00068 } E_STB_AV_AUDIO_CODEC;
00069 
00070 typedef E_ASPECT_RATIO E_STB_AV_ASPECT_RATIO;
00071 
00072 typedef enum e_stb_av_video_format
00073 {
00074    VIDEO_FORMAT_UNDEFINED = 255,
00075    VIDEO_FORMAT_AUTO = 0,
00076    VIDEO_FORMAT_ORIGINAL,
00077    VIDEO_FORMAT_PALBGH,
00078    VIDEO_FORMAT_PALDKL,
00079    VIDEO_FORMAT_PALI,
00080    VIDEO_FORMAT_PALM,
00081    VIDEO_FORMAT_PALN,
00082    VIDEO_FORMAT_NTSC,
00083    VIDEO_FORMAT_SECAMBGH,
00084    VIDEO_FORMAT_SECAMDKL,
00085    VIDEO_FORMAT_576IHD,
00086    VIDEO_FORMAT_576PHD,
00087    VIDEO_FORMAT_720HD,     /* HD Format, 1280x720  progressive, 50 fps */
00088    VIDEO_FORMAT_720P50HD,
00089    VIDEO_FORMAT_720P60HD,
00090    VIDEO_FORMAT_1080IHD,   /* HD Format, 1920x1080 interlaced, 25 fps */
00091    VIDEO_FORMAT_1080P25HD, /* HD Format, 1920x1080 progressive, 25 fps */
00092    VIDEO_FORMAT_1080P30HD, /* HD Format, 1920x1080 progressive, 30 fps */
00093    VIDEO_FORMAT_1080I50HD, /* HD Format, 1920x1080 interlaced,  50 fps */
00094    VIDEO_FORMAT_1080P50HD, /* HD Format, 1920x1080 progressive, 50 fps */
00095    VIDEO_FORMAT_1080P60HD, /* HD Format, 1920x1080 progressive, 60 fps */
00096 } E_STB_AV_VIDEO_FORMAT;
00097 
00098 typedef enum e_stb_av_outputs
00099 {
00100    AV_OUTPUT_TV_SCART = 0,
00101    AV_OUTPUT_VCR_SCART = 1,
00102    AV_OUTPUT_AUX_SCART = 2,
00103    AV_OUTPUT_HDMI = 3
00104 } E_STB_AV_OUTPUTS;
00105 
00106 typedef enum e_stb_av_sources
00107 {
00108    AV_SOURCE_ENCODER_SVIDEO = 0,
00109    AV_SOURCE_ENCODER_RGB = 1,
00110    AV_SOURCE_ENCODER_COMPOSITE = 2,
00111    AV_SOURCE_VCR_SVIDEO = 3,
00112    AV_SOURCE_VCR_RGB = 4,
00113    AV_SOURCE_VCR_COMPOSITE = 5,
00114    AV_SOURCE_AUX_SVIDEO = 6,
00115    AV_SOURCE_AUX_RGB = 7,
00116    AV_SOURCE_AUX_COMPOSITE = 8,
00117    AV_SOURCE_DVD_SVIDEO = 9,
00118    AV_SOURCE_DVD_RGB = 10,
00119    AV_SOURCE_DVD_COMPOSITE = 11,
00120    AV_SOURCE_ANALOG_TUNER = 12,
00121    AV_SOURCE_ANALOG_TUNER_WITH_OSD = 13,
00122    AV_SOURCE_HDMI = 14,
00123    AV_SOURCE_CVBS = 15,
00124    AV_SOURCE_TUNER = 16,
00125    AV_SOURCE_NONE = 255
00126 } E_STB_AV_SOURCES;
00127 
00128 typedef enum e_stb_av_srm_reply
00129 {
00130    SRM_OK = 0,
00131    SRM_BUSY = 1,
00132    SRM_NOT_REQUIRED = 2
00133 } E_STB_AV_SRM_REPLY;
00134 
00135 typedef enum
00136 {
00137    VIDEO_INFO_VIDEO_RESOLUTION = 0x01,
00138    VIDEO_INFO_SCREEN_RESOLUTION = 0x02,
00139    VIDEO_INFO_VIDEO_ASPECT_RATIO = 0x04,
00140    VIDEO_INFO_DISPLAY_ASPECT_RATIO = 0x08,
00141    VIDEO_INFO_ASPECT_MODE = 0x10,
00142    VIDEO_INFO_AFD = 0x20,
00143    VIDEO_INFO_DECODER_STATUS = 0x40
00144 } E_STB_AV_VIDEO_INFO_TYPE;
00145 
00146 typedef enum
00147 {
00148    DECODER_STATUS_NONE,
00149    DECODER_STATUS_VIDEO,
00150    DECODER_STATUS_IFRAME
00151 } E_STB_AV_DECODER_STATUS;
00152 
00153 typedef enum
00154 {
00155    DIGITAL_AUDIO_PCM,
00156    DIGITAL_AUDIO_COMPRESSED
00157 } E_STB_DIGITAL_AUDIO_TYPE;
00158 
00159 typedef enum e_stb_av_audio_route
00160 {
00161    SPEAKER_TV_N_AD_HEADPHONE_TV_N_AD,
00162    SPEAKER_TV_ONLY_HEADPHONE_AD_ONLY,
00163    SPEAKER_TV_N_AD_HEADPHONE_AD_ONLY,
00164    SPEAKER_TV_ONLY_HEADPHONE_TV_N_AD,
00165    AUTO_ROUTE_UNKNOWN,
00166 } E_STB_AV_AUDIO_ROUTE;
00167 
00168 
00169 //---Global type defs for public use-------------------------------------------
00170 
00171 typedef struct
00172 {
00173    BOOLEAN macrovision_set;
00174    U8BIT macrovision;
00175 
00176    BOOLEAN aps_set;
00177    U8BIT aps;
00178 
00179    BOOLEAN cgms_a_set;
00180    U8BIT cgms_a;
00181 
00182    BOOLEAN ict_set;
00183    U8BIT ict;
00184 
00185    BOOLEAN hdcp_set;
00186    BOOLEAN hdcp;
00187 
00188    BOOLEAN scms_set;
00189    U8BIT scms;
00190 
00191    BOOLEAN dot_set;
00192    U8BIT dot;
00193 } S_STB_AV_COPY_PROTECTION;
00194 
00195 typedef struct
00196 {
00197    E_STB_AV_VIDEO_INFO_TYPE flags;
00198    U16BIT video_width;
00199    U16BIT video_height;
00200    U16BIT screen_width;
00201    U16BIT screen_height;
00202    E_STB_AV_ASPECT_RATIO video_aspect_ratio;
00203    E_STB_AV_ASPECT_RATIO display_aspect_ratio;
00204    U8BIT afd;
00205    E_STB_AV_DECODER_STATUS status;
00206 } S_STB_AV_VIDEO_INFO;
00207 
00208 
00209 //---Global Function prototypes for public use---------------------------------
00210 
00216 void STB_AVInitialise(U8BIT audio_paths, U8BIT video_paths);
00217 
00223 void STB_AVBlankVideo(U8BIT path, BOOLEAN blank);
00224 
00231 void STB_AVSetVideoSource(U8BIT path, E_STB_AV_DECODE_SOURCE source, U32BIT param);
00232 
00239 BOOLEAN STB_AVSetVideoCodec(U8BIT path, E_STB_AV_VIDEO_CODEC codec);
00240 
00247 E_STB_AV_VIDEO_CODEC STB_AVGetVideoCodec(U8BIT path);
00248 
00253 void STB_AVStartVideoDecoding(U8BIT path);
00254 
00260 void STB_AVPauseVideoDecoding(U8BIT path);
00261 
00267 void STB_AVResumeVideoDecoding(U8BIT path);
00268 
00274 void STB_AVStopVideoDecoding(U8BIT decoder);
00275 
00282 void STB_AVSetAudioSource(U8BIT path, E_STB_AV_DECODE_SOURCE source, U32BIT param);
00283 
00290 BOOLEAN STB_AVSetAudioCodec(U8BIT path, E_STB_AV_AUDIO_CODEC codec);
00291 
00298 E_STB_AV_AUDIO_CODEC STB_AVGetAudioCodec(U8BIT path);
00299 
00306 void STB_AVChangeAudioMode(U8BIT path, E_STB_AV_AUDIO_MODE mode);
00307 
00312 void STB_AVStartAudioDecoding(U8BIT decoder);
00313 
00318 void STB_AVStopAudioDecoding(U8BIT decoder);
00319 
00325 void STB_AVSetAudioVolume(U8BIT path, U8BIT vol);
00326 
00332 U8BIT STB_AVGetAudioVolume(U8BIT path);
00333 
00339 void STB_AVSetAudioMute(U8BIT path, BOOLEAN mute);
00340 
00346 BOOLEAN STB_AVGetAudioMute(U8BIT path);
00347 
00355 void STB_AVSetADSource(U8BIT path, E_STB_AV_DECODE_SOURCE source, U32BIT param);
00356 
00364 BOOLEAN STB_AVSetADCodec(U8BIT path, E_STB_AV_AUDIO_CODEC codec);
00365 
00372 E_STB_AV_AUDIO_CODEC STB_AVGetADCodec(U8BIT path);
00373 
00380 void STB_AVChangeADMode(U8BIT path, E_STB_AV_AUDIO_MODE mode);
00381 
00386 void STB_AVStartADDecoding(U8BIT decoder);
00387 
00392 void STB_AVStopADDecoding(U8BIT decoder);
00393 
00399 void STB_AVSetADVolume(U8BIT path, U8BIT vol);
00400 
00406 U8BIT STB_AVGetADVolume(U8BIT path);
00407 
00417 void STB_AVGetSTC(U8BIT path, U8BIT stc[5]);
00418 
00425 void STB_AVSetTVType(U8BIT path, E_STB_AV_ASPECT_RATIO ratio, E_STB_AV_VIDEO_FORMAT format);
00426 
00433 void STB_AVGetScreenSize(U8BIT path, U16BIT *width, U16BIT *height);
00434 
00441 void STB_AVSetAVOutputSource(E_STB_AV_OUTPUTS output, E_STB_AV_SOURCES source, U32BIT param);
00442 
00447 void STB_AVSetAVOutput(BOOLEAN av_on);
00448 
00453 void STB_AVSetHDMIStandby(BOOLEAN standby);
00454 
00460 U8BIT STB_AVGetHDMISupportedModes(E_STB_AV_VIDEO_FORMAT **modes);
00461 
00468 void STB_AVGetHDMINativeResolution(U16BIT *width, U16BIT *height);
00469 
00473 void STB_AVEnableHDMIDecoding(void);
00474 
00478 void STB_AVDisableHDMIDecoding(void);
00479 
00484 BOOLEAN STB_AVIsHDCPAuthenticated(void);
00485 
00492 BOOLEAN STB_AVSetIFrameCodec(U8BIT path, E_STB_AV_VIDEO_CODEC codec);
00493 
00500 void STB_AVLoadIFrame(U8BIT path, U8BIT *data, U32BIT size);
00501 
00506 void STB_AVShowIFrame(U8BIT path);
00507 
00512 void STB_AVHideIFrame(U8BIT path);
00513 
00520 E_HW_STATUS STB_AVPlayAudioSample(U8BIT path, U32BIT loop_count);
00521 
00529 E_HW_STATUS STB_AVLoadAudioSample(U8BIT path, U8BIT *data, U32BIT size);
00530 
00536 E_HW_STATUS STB_AVPauseAudioSample(U8BIT path);
00537 
00543 E_HW_STATUS STB_AVResumeAudioSample(U8BIT path);
00544 
00549 void STB_AVStopAudioSample(U8BIT path);
00550 
00556 void STB_AVSetSpdifMode(U8BIT path, E_STB_DIGITAL_AUDIO_TYPE audio_type);
00557 
00563 void STB_AVSetHDMIAudioMode(U8BIT path, E_STB_DIGITAL_AUDIO_TYPE audio_type);
00564 
00570 void STB_AVSetAudioDelay(U8BIT path, U16BIT millisecond);
00571 
00578 void STB_AVSetVideoCallback(U8BIT path, void (*callback)(S_STB_AV_VIDEO_INFO *, void *), void *user_data);
00579 
00586 void STB_AVApplyVideoTransformation(U8BIT path, S_RECTANGLE *input, S_RECTANGLE *output);
00587 
00593 S16BIT STB_AVGetMinPlaySpeed(U8BIT video_decoder);
00594 
00600 S16BIT STB_AVGetMaxPlaySpeed(U8BIT video_decoder);
00601 
00611 S16BIT STB_AVGetNextPlaySpeed(U8BIT video_decoder, S16BIT speed, S16BIT inc,
00612    BOOLEAN include_slow_speeds);
00613 
00618 void STB_AVSetCopyProtection(S_STB_AV_COPY_PROTECTION *copy_protection);
00619 
00624 void STB_AVSetUhfModulatorChannel(U8BIT chan);
00625 
00630 U8BIT STB_AVGetUhfModulatorChannel(void);
00631 
00637 U8BIT STB_AVGetVideoFrameRate(U8BIT path);
00638 
00646 E_STB_AV_SRM_REPLY STB_AVApplySRM(U8BIT path, U8BIT *data, U32BIT len);
00647 
00648 void STB_AVCECOneTouchPlay(void);
00649 E_STB_AV_VIDEO_FORMAT STB_AVGetHDMINativeFormat(void);
00650 void STB_AVPlayMp3(U8BIT path, U8BIT *buffer, U32BIT buffer_size);
00651 void STB_AVStopMp3(U8BIT path);
00652 #endif //  _STBHWAV_H
 All Data Structures Files Functions Typedefs Defines