DVBCore  17.9.0
Open Source DVB Engine
 All Data Structures Files Functions Typedefs Macros Pages
stbhwav.h
Go to the documentation of this file.
1 /*******************************************************************************
2  * Copyright © 2014 The DTVKit Open Software Foundation Ltd (www.dtvkit.org)
3  * Copyright © 2004 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  *******************************************************************************/
24 // pre-processor mechanism so multiple inclusions don't cause compilation error
25 
26 #ifndef _STBHWAV_H
27 #define _STBHWAV_H
28 
29 #include "techtype.h"
30 #include "stbhwc.h"
31 #include "osdtype.h"
32 
33 //---Constant and macro definitions for public use-----------------------------
34 
35 //---Enumerations for public use-----------------------------------------------
36 
37 typedef enum e_stb_av_audio_mode
38 {
39  AV_AUDIO_STEREO = 0,
40  AV_AUDIO_LEFT = 1,
41  AV_AUDIO_RIGHT = 2,
42  AV_AUDIO_MONO = 3,
43  AV_AUDIO_MULTICHANNEL = 4
44 } E_STB_AV_AUDIO_MODE;
45 
46 typedef enum e_stb_av_decode_source
47 {
48  AV_DEMUX = 0,
49  AV_MEMORY = 1
50 } E_STB_AV_DECODE_SOURCE;
51 
52 typedef enum e_stb_av_video_codec
53 {
54  AV_VIDEO_CODEC_AUTO = 0,
55  AV_VIDEO_CODEC_MPEG1 = 1,
56  AV_VIDEO_CODEC_MPEG2 = 2,
57  AV_VIDEO_CODEC_H264 = 3,
58  AV_VIDEO_CODEC_H265 = 4,
59 } E_STB_AV_VIDEO_CODEC;
60 
61 typedef enum e_stb_av_audio_codec
62 {
63  AV_AUDIO_CODEC_AUTO = 0,
64  AV_AUDIO_CODEC_MP2 = 1,
65  AV_AUDIO_CODEC_MP3 = 2,
66  AV_AUDIO_CODEC_AC3 = 3,
67  AV_AUDIO_CODEC_EAC3 = 4,
68  AV_AUDIO_CODEC_AAC = 5,
69  AV_AUDIO_CODEC_HEAAC = 6,
70  AV_AUDIO_CODEC_AAC_ADTS = 7
71 } E_STB_AV_AUDIO_CODEC;
72 
73 typedef E_ASPECT_RATIO E_STB_AV_ASPECT_RATIO;
74 
75 typedef enum e_stb_av_video_format
76 {
77  VIDEO_FORMAT_UNDEFINED = 255,
78  VIDEO_FORMAT_AUTO = 0,
79  VIDEO_FORMAT_ORIGINAL,
80  VIDEO_FORMAT_PALBGH,
81  VIDEO_FORMAT_PALDKL,
82  VIDEO_FORMAT_PALI,
83  VIDEO_FORMAT_PALM,
84  VIDEO_FORMAT_PALN,
85  VIDEO_FORMAT_NTSC,
86  VIDEO_FORMAT_SECAMBGH,
87  VIDEO_FORMAT_SECAMDKL,
88  VIDEO_FORMAT_576IHD,
89  VIDEO_FORMAT_576PHD,
90  VIDEO_FORMAT_720HD, /* HD Format, 1280x720 progressive, 50 fps */
91  VIDEO_FORMAT_720P50HD = VIDEO_FORMAT_720HD,
92  VIDEO_FORMAT_720P60HD,
93  VIDEO_FORMAT_1080IHD, /* HD Format, 1920x1080 interlaced, 25 fps */
94  VIDEO_FORMAT_1080P25HD, /* HD Format, 1920x1080 progressive, 25 fps */
95  VIDEO_FORMAT_1080P30HD, /* HD Format, 1920x1080 progressive, 30 fps */
96  VIDEO_FORMAT_1080I50HD, /* HD Format, 1920x1080 interlaced, 50 fps */
97  VIDEO_FORMAT_1080P50HD, /* HD Format, 1920x1080 progressive, 50 fps */
98  VIDEO_FORMAT_1080P60HD, /* HD Format, 1920x1080 progressive, 60 fps */
99  VIDEO_FORMAT_2160P24UHD,
100  VIDEO_FORMAT_2160P25UHD,
101  VIDEO_FORMAT_2160P30UHD,
102  VIDEO_FORMAT_2160P50UHD,
103  VIDEO_FORMAT_2160P60UHD,
104 } E_STB_AV_VIDEO_FORMAT;
105 
106 typedef enum e_stb_av_outputs
107 {
108  AV_OUTPUT_TV_SCART = 0,
109  AV_OUTPUT_VCR_SCART = 1,
110  AV_OUTPUT_AUX_SCART = 2,
111  AV_OUTPUT_HDMI = 3
112 } E_STB_AV_OUTPUTS;
113 
114 typedef enum e_stb_av_sources
115 {
116  AV_SOURCE_ENCODER_SVIDEO = 0,
117  AV_SOURCE_ENCODER_RGB = 1,
118  AV_SOURCE_ENCODER_COMPOSITE = 2,
119  AV_SOURCE_VCR_SVIDEO = 3,
120  AV_SOURCE_VCR_RGB = 4,
121  AV_SOURCE_VCR_COMPOSITE = 5,
122  AV_SOURCE_AUX_SVIDEO = 6,
123  AV_SOURCE_AUX_RGB = 7,
124  AV_SOURCE_AUX_COMPOSITE = 8,
125  AV_SOURCE_DVD_SVIDEO = 9,
126  AV_SOURCE_DVD_RGB = 10,
127  AV_SOURCE_DVD_COMPOSITE = 11,
128  AV_SOURCE_ANALOG_TUNER = 12,
129  AV_SOURCE_ANALOG_TUNER_WITH_OSD = 13,
130  AV_SOURCE_HDMI = 14,
131  AV_SOURCE_CVBS = 15,
132  AV_SOURCE_TUNER = 16,
133  AV_SOURCE_NONE = 255
134 } E_STB_AV_SOURCES;
135 
136 typedef enum e_stb_av_srm_reply
137 {
138  SRM_OK = 0,
139  SRM_BUSY = 1,
140  SRM_NOT_REQUIRED = 2
141 } E_STB_AV_SRM_REPLY;
142 
143 typedef enum
144 {
145  VIDEO_INFO_VIDEO_RESOLUTION = 0x01,
146  VIDEO_INFO_SCREEN_RESOLUTION = 0x02,
147  VIDEO_INFO_VIDEO_ASPECT_RATIO = 0x04,
148  VIDEO_INFO_DISPLAY_ASPECT_RATIO = 0x08,
149  VIDEO_INFO_ASPECT_MODE = 0x10,
150  VIDEO_INFO_AFD = 0x20,
151  VIDEO_INFO_DECODER_STATUS = 0x40
152 } E_STB_AV_VIDEO_INFO_TYPE;
153 
154 typedef enum
155 {
156  DECODER_STATUS_NONE,
157  DECODER_STATUS_VIDEO,
158  DECODER_STATUS_IFRAME
159 } E_STB_AV_DECODER_STATUS;
160 
161 typedef enum
162 {
163  DIGITAL_AUDIO_PCM,
164  DIGITAL_AUDIO_COMPRESSED,
165  DIGITAL_AUDIO_AUTO
166 } E_STB_DIGITAL_AUDIO_TYPE;
167 
168 typedef enum e_stb_av_audio_route
169 {
170  SPEAKER_TV_N_AD_HEADPHONE_TV_N_AD,
171  SPEAKER_TV_ONLY_HEADPHONE_AD_ONLY,
172  SPEAKER_TV_N_AD_HEADPHONE_AD_ONLY,
173  SPEAKER_TV_ONLY_HEADPHONE_TV_N_AD,
174  AUTO_ROUTE_UNKNOWN,
175 } E_STB_AV_AUDIO_ROUTE;
176 
177 
178 //---Global type defs for public use-------------------------------------------
179 
180 typedef struct
181 {
182  BOOLEAN macrovision_set;
183  U8BIT macrovision;
184 
185  BOOLEAN aps_set;
186  U8BIT aps;
187 
188  BOOLEAN cgms_a_set;
189  U8BIT cgms_a;
190 
191  BOOLEAN ict_set;
192  U8BIT ict;
193 
194  BOOLEAN hdcp_set;
195  BOOLEAN hdcp;
196 
197  BOOLEAN scms_set;
198  U8BIT scms;
199 
200  BOOLEAN dot_set;
201  U8BIT dot;
203 
204 typedef struct
205 {
206  E_STB_AV_VIDEO_INFO_TYPE flags;
207  U16BIT video_width;
208  U16BIT video_height;
209  U16BIT screen_width;
210  U16BIT screen_height;
211  E_STB_AV_ASPECT_RATIO video_aspect_ratio;
212  E_STB_AV_ASPECT_RATIO display_aspect_ratio;
213  U8BIT afd;
214  E_STB_AV_DECODER_STATUS status;
216 
217 
218 //---Global Function prototypes for public use---------------------------------
219 
225 void STB_AVInitialise(U8BIT audio_paths, U8BIT video_paths);
226 
232 void STB_AVBlankVideo(U8BIT path, BOOLEAN blank);
233 
240 void STB_AVSetVideoSource(U8BIT path, E_STB_AV_DECODE_SOURCE source, U32BIT param);
241 
248 BOOLEAN STB_AVSetVideoCodec(U8BIT path, E_STB_AV_VIDEO_CODEC codec);
249 
256 E_STB_AV_VIDEO_CODEC STB_AVGetVideoCodec(U8BIT path);
257 
262 void STB_AVStartVideoDecoding(U8BIT path);
263 
269 void STB_AVPauseVideoDecoding(U8BIT path);
270 
276 void STB_AVResumeVideoDecoding(U8BIT path);
277 
283 void STB_AVStopVideoDecoding(U8BIT decoder);
284 
291 void STB_AVSetAudioSource(U8BIT path, E_STB_AV_DECODE_SOURCE source, U32BIT param);
292 
299 BOOLEAN STB_AVSetAudioCodec(U8BIT path, E_STB_AV_AUDIO_CODEC codec);
300 
307 E_STB_AV_AUDIO_CODEC STB_AVGetAudioCodec(U8BIT path);
308 
315 void STB_AVChangeAudioMode(U8BIT path, E_STB_AV_AUDIO_MODE mode);
316 
321 void STB_AVStartAudioDecoding(U8BIT decoder);
322 
327 void STB_AVStopAudioDecoding(U8BIT decoder);
328 
334 void STB_AVSetAudioVolume(U8BIT path, U8BIT vol);
335 
341 U8BIT STB_AVGetAudioVolume(U8BIT path);
342 
348 void STB_AVSetAudioMute(U8BIT path, BOOLEAN mute);
349 
355 BOOLEAN STB_AVGetAudioMute(U8BIT path);
356 
364 void STB_AVSetADSource(U8BIT path, E_STB_AV_DECODE_SOURCE source, U32BIT param);
365 
373 BOOLEAN STB_AVSetADCodec(U8BIT path, E_STB_AV_AUDIO_CODEC codec);
374 
381 E_STB_AV_AUDIO_CODEC STB_AVGetADCodec(U8BIT path);
382 
389 void STB_AVChangeADMode(U8BIT path, E_STB_AV_AUDIO_MODE mode);
390 
395 void STB_AVStartADDecoding(U8BIT decoder);
396 
401 void STB_AVStopADDecoding(U8BIT decoder);
402 
408 void STB_AVSetADVolume(U8BIT path, U8BIT vol);
409 
415 U8BIT STB_AVGetADVolume(U8BIT path);
416 
426 void STB_AVGetSTC(U8BIT path, U8BIT stc[5]);
427 
434 void STB_AVSetTVType(U8BIT path, E_STB_AV_ASPECT_RATIO ratio, E_STB_AV_VIDEO_FORMAT format);
435 
442 void STB_AVGetScreenSize(U8BIT path, U16BIT *width, U16BIT *height);
443 
450 void STB_AVSetAVOutputSource(E_STB_AV_OUTPUTS output, E_STB_AV_SOURCES source, U32BIT param);
451 
456 void STB_AVSetAVOutput(BOOLEAN av_on);
457 
462 void STB_AVSetHDMIStandby(BOOLEAN standby);
463 
469 U8BIT STB_AVGetHDMISupportedModes(E_STB_AV_VIDEO_FORMAT **modes);
470 
477 void STB_AVGetHDMINativeResolution(U16BIT *width, U16BIT *height);
478 
482 void STB_AVEnableHDMIDecoding(void);
483 
487 void STB_AVDisableHDMIDecoding(void);
488 
493 BOOLEAN STB_AVIsHDCPAuthenticated(void);
494 
501 BOOLEAN STB_AVSetIFrameCodec(U8BIT path, E_STB_AV_VIDEO_CODEC codec);
502 
509 void STB_AVLoadIFrame(U8BIT path, U8BIT *data, U32BIT size);
510 
515 void STB_AVShowIFrame(U8BIT path);
516 
521 void STB_AVHideIFrame(U8BIT path);
522 
529 E_HW_STATUS STB_AVPlayAudioSample(U8BIT path, U32BIT loop_count);
530 
538 E_HW_STATUS STB_AVLoadAudioSample(U8BIT path, U8BIT *data, U32BIT size);
539 
545 E_HW_STATUS STB_AVPauseAudioSample(U8BIT path);
546 
552 E_HW_STATUS STB_AVResumeAudioSample(U8BIT path);
553 
558 void STB_AVStopAudioSample(U8BIT path);
559 
565 void STB_AVSetSpdifMode(U8BIT path, E_STB_DIGITAL_AUDIO_TYPE audio_type);
566 
572 void STB_AVSetHDMIAudioMode(U8BIT path, E_STB_DIGITAL_AUDIO_TYPE audio_type);
573 
579 void STB_AVSetAudioDelay(U8BIT path, U16BIT millisecond);
580 
587 void STB_AVSetVideoCallback(U8BIT path, void (*callback)(S_STB_AV_VIDEO_INFO *, void *), void *user_data);
588 
595 void STB_AVApplyVideoTransformation(U8BIT path, S_RECTANGLE *input, S_RECTANGLE *output);
596 
602 S16BIT STB_AVGetMinPlaySpeed(U8BIT video_decoder);
603 
609 S16BIT STB_AVGetMaxPlaySpeed(U8BIT video_decoder);
610 
620 S16BIT STB_AVGetNextPlaySpeed(U8BIT video_decoder, S16BIT speed, S16BIT inc,
621  BOOLEAN include_slow_speeds);
622 
628 
633 void STB_AVSetUhfModulatorChannel(U8BIT chan);
634 
639 U8BIT STB_AVGetUhfModulatorChannel(void);
640 
646 U8BIT STB_AVGetVideoFrameRate(U8BIT path);
647 
655 E_STB_AV_SRM_REPLY STB_AVApplySRM(U8BIT path, U8BIT *data, U32BIT len);
656 
657 void STB_AVCECOneTouchPlay(void);
658 E_STB_AV_VIDEO_FORMAT STB_AVGetHDMINativeFormat(void);
659 void STB_AVPlayMp3(U8BIT path, U8BIT *buffer, U32BIT buffer_size);
660 void STB_AVStopMp3(U8BIT path);
661 #endif // _STBHWAV_H
U8BIT STB_AVGetVideoFrameRate(U8BIT path)
Returns the frame rate of the video being decoded.
Header file - Function prototypes for A/V control.
void STB_AVGetScreenSize(U8BIT path, U16BIT *width, U16BIT *height)
Returns the current size of the screen in pixels.
U8BIT STB_AVGetUhfModulatorChannel(void)
Gets the current RF modulator channel.
void STB_AVChangeADMode(U8BIT path, E_STB_AV_AUDIO_MODE mode)
Configures the audio description channel mode (stereo/left/right) in the case where dual-mono audio i...
void STB_AVEnableHDMIDecoding(void)
Enables AV output to HDMI.
BOOLEAN STB_AVIsHDCPAuthenticated(void)
Returns whether HDCP has authenticated.
Function prototypes for HW control.
S16BIT STB_AVGetMaxPlaySpeed(U8BIT video_decoder)
Returns maximum video play speed as a percentage.
E_STB_AV_AUDIO_CODEC STB_AVGetADCodec(U8BIT path)
Returns the codec previously set for audio description on the given audio path. This function is curr...
void STB_AVSetSpdifMode(U8BIT path, E_STB_DIGITAL_AUDIO_TYPE audio_type)
Sets the SPDIF output mode, PCM or compressed audio.
S16BIT STB_AVGetMinPlaySpeed(U8BIT video_decoder)
Returns minimum video play speed as a percentage.
void STB_AVHideIFrame(U8BIT path)
Hides the i-frame currently being displayed.
E_HW_STATUS STB_AVPlayAudioSample(U8BIT path, U32BIT loop_count)
Plays back a previously loaded audio sample.
void STB_AVLoadIFrame(U8BIT path, U8BIT *data, U32BIT size)
Provides the video data for an i-frame for subsequent decode and display.
void STB_AVGetHDMINativeResolution(U16BIT *width, U16BIT *height)
Returns the native resolution, i.e. the resolution that is set with a call to STB_AVSetTVType(path, ratio, VIDEO_FORMAT_AUTO);.
void STB_AVStopAudioDecoding(U8BIT decoder)
Stops audio decoding on the given audio path.
BOOLEAN STB_AVSetIFrameCodec(U8BIT path, E_STB_AV_VIDEO_CODEC codec)
Sets the codec to be used when decoding the next i-frame from memory.
void STB_AVSetHDMIAudioMode(U8BIT path, E_STB_DIGITAL_AUDIO_TYPE audio_type)
Sets the HDMI audio output mode, PCM or compressed.
void STB_AVStopADDecoding(U8BIT decoder)
Stops decoding audio description on the given audio path.
void STB_AVGetSTC(U8BIT path, U8BIT stc[5])
Returns the current 33-bit System Time Clock from the PCR PES. On some systems, this information may ...
Definition: osdtype.h:56
void STB_AVSetHDMIStandby(BOOLEAN standby)
Sets the standby state of the HDMI output.
void STB_AVSetAudioSource(U8BIT path, E_STB_AV_DECODE_SOURCE source, U32BIT param)
Sets the source of the input for the main audio on the given audio decoder path.
U8BIT STB_AVGetAudioVolume(U8BIT path)
Returns the current volume of the main audio output.
E_HW_STATUS STB_AVLoadAudioSample(U8BIT path, U8BIT *data, U32BIT size)
Loads an audio sample for subsequent playback.
void STB_AVSetVideoCallback(U8BIT path, void(*callback)(S_STB_AV_VIDEO_INFO *, void *), void *user_data)
Register callback for updated video information.
E_STB_AV_SRM_REPLY STB_AVApplySRM(U8BIT path, U8BIT *data, U32BIT len)
Apply System Renewability Message (SRM) to HDCP function.
U8BIT STB_AVGetADVolume(U8BIT path)
Returns the current volume of the audio description output.
void STB_AVShowIFrame(U8BIT path)
Decodes and displays the previously loaded i-frame data.
BOOLEAN STB_AVSetAudioCodec(U8BIT path, E_STB_AV_AUDIO_CODEC codec)
Sets the audio codec to be used when decoding audio with the given audio decoder path.
E_HW_STATUS STB_AVPauseAudioSample(U8BIT path)
Pauses playback of an audio sample.
S16BIT STB_AVGetNextPlaySpeed(U8BIT video_decoder, S16BIT speed, S16BIT inc, BOOLEAN include_slow_speeds)
Returns the next valid speed that is +/- inc above or below the given speed. Slow motion speeds (>-10...
BOOLEAN STB_AVSetVideoCodec(U8BIT path, E_STB_AV_VIDEO_CODEC codec)
Sets the video codec to be used when decoding video with the given video decoder path.
void STB_AVSetUhfModulatorChannel(U8BIT chan)
Sets the output channel of the RF Modulator.
void STB_AVSetVideoSource(U8BIT path, E_STB_AV_DECODE_SOURCE source, U32BIT param)
Sets the source of the input to the given video decoder path.
void STB_AVPauseVideoDecoding(U8BIT path)
Pauses video decoding on the given video path. The video should not be blanked.
void STB_AVSetAudioVolume(U8BIT path, U8BIT vol)
Sets the volume of the main audio output.
void STB_AVStartVideoDecoding(U8BIT path)
Starts video decoding on the given video path.
void STB_AVStopVideoDecoding(U8BIT decoder)
Stops video decoding on the given video path. The video is not expected to be blanked.
Definition: stbhwav.h:180
void STB_AVSetAudioMute(U8BIT path, BOOLEAN mute)
Mute or unmute the audio output on the given audio decoder path.
void STB_AVSetAVOutput(BOOLEAN av_on)
Turns on/off all AV outputs (e.g. for standby mode)
E_HW_STATUS STB_AVResumeAudioSample(U8BIT path)
Resumes playback of an audio sample.
void STB_AVStartADDecoding(U8BIT decoder)
Starts decoding audio description on the given audio path.
System Wide Global Technical Data Type Definitions.
BOOLEAN STB_AVSetADCodec(U8BIT path, E_STB_AV_AUDIO_CODEC codec)
Sets the codec to be used for audio description when decoding audio with the given audio decoder path...
void STB_AVApplyVideoTransformation(U8BIT path, S_RECTANGLE *input, S_RECTANGLE *output)
Apply video transformation.
void STB_AVInitialise(U8BIT audio_paths, U8BIT video_paths)
Initialises the AV components.
void STB_AVStartAudioDecoding(U8BIT decoder)
Starts audio decoding on the given audio path.
void STB_AVDisableHDMIDecoding(void)
Disables AV output to HDMI.
void STB_AVChangeAudioMode(U8BIT path, E_STB_AV_AUDIO_MODE mode)
Configures the main audio channel mode (stereo/left/right) in the case where dual-mono audio is used...
void STB_AVSetAVOutputSource(E_STB_AV_OUTPUTS output, E_STB_AV_SOURCES source, U32BIT param)
Routes a specified AV source to a specified AV output.
U8BIT STB_AVGetHDMISupportedModes(E_STB_AV_VIDEO_FORMAT **modes)
Returns the resolutions supported by the HDMI.
void STB_AVSetADVolume(U8BIT path, U8BIT vol)
Sets the volume of the audio description output.
BOOLEAN STB_AVGetAudioMute(U8BIT path)
Returns the current mute setting of the audio output on the given path.
void STB_AVSetADSource(U8BIT path, E_STB_AV_DECODE_SOURCE source, U32BIT param)
Sets the source of the input for the audio description audio on the given audio decoder path...
E_STB_AV_AUDIO_CODEC STB_AVGetAudioCodec(U8BIT path)
Returns the audio codec previously set for the given audio path. This function is currently unused wi...
void STB_AVStopAudioSample(U8BIT path)
Stops playback of an audio sample.
void STB_AVSetTVType(U8BIT path, E_STB_AV_ASPECT_RATIO ratio, E_STB_AV_VIDEO_FORMAT format)
Sets the aspect ratio and signal format for the connected television.
void STB_AVBlankVideo(U8BIT path, BOOLEAN blank)
Blanks or unblanks the video display.
void STB_AVResumeVideoDecoding(U8BIT path)
Resumes video decoding on the given video path that has previously been paused The video should not b...
E_STB_AV_VIDEO_CODEC STB_AVGetVideoCodec(U8BIT path)
Returns the video codec previously set for the given video path. This function is currently unused wi...
Definition: stbhwav.h:204
void STB_AVSetAudioDelay(U8BIT path, U16BIT millisecond)
Sets the audio delay on the given path.
void STB_AVSetCopyProtection(S_STB_AV_COPY_PROTECTION *copy_protection)
Apply the specified copy protection. This function is used for CI+.