source: svn/trunk/newcon3bcm2_21bu/dta/src/settop_api/bsettop_display.h

Last change on this file was 2, checked in by phkim, 11 years ago

1.phkim

  1. revision copy newcon3sk r27
  • Property svn:executable set to *
File size: 13.9 KB
Line 
1/***************************************************************************
2 *     Copyright (c) 2003-2006, Broadcom Corporation
3 *     All Rights Reserved
4 *     Confidential Property of Broadcom Corporation
5 *
6 *  THIS SOFTWARE MAY ONLY BE USED SUBJECT TO AN EXECUTED SOFTWARE LICENSE
7 *  AGREEMENT  BETWEEN THE USER AND BROADCOM.  YOU HAVE NO RIGHT TO USE OR
8 *  EXPLOIT THIS MATERIAL EXCEPT SUBJECT TO THE TERMS OF SUCH AN AGREEMENT.
9 *
10 * $brcm_Workfile:  $
11 * $brcm_Revision:  $
12 * $brcm_Date: $
13 *
14 * Module Description:
15 *
16 * Revision History:
17 *
18 * $brcm_Log:  $
19 *
20 ***************************************************************************/
21
22#ifndef BSETTOP_DISPLAY_H__
23#define BSETTOP_DISPLAY_H__
24
25#include "bsettop_types.h"
26
27#ifdef  HAS_VBI
28        #include "scte_127.h"
29#endif
30
31typedef enum bsettop_display_format_t
32{
33        bdisplay_format_auto,
34        bdisplay_format_1080i,
35        bdisplay_format_720p,
36        bdisplay_format_480i,
37        bdisplay_format_480p,
38        bdisplay_format_1080p60,
39        bdisplay_format_1080p24,
40        bdisplay_format_1080p30,
41        bdisplay_format_max,
42}bsettop_display_format_t;
43
44
45/*
46Summary:
47        SD output options
48Description:
49        This only applies to SD display for RF output.
50*/
51typedef enum bdisplay_sd_output_options
52{
53        bdisplay_sd_output_options_auto,
54        bdisplay_sd_output_options_widescreen,
55        bdisplay_sd_output_options_full,
56        bdisplay_sd_output_options_zoom,
57        /*bdisplay_sd_output_options_partial_zoom,*/
58        bdisplay_sd_output_options_max
59} bdisplay_sd_output_options;
60
61/*
62Summary:
63        HD output options
64Description:
65        This only applies to HD display for HDMI output.
66*/
67typedef enum bdisplay_hd_output_options
68{
69        bdisplay_hd_output_options_auto,
70        bdisplay_hd_output_options_stretch,
71        bdisplay_hd_output_options_pillarbox,
72        bdisplay_hd_output_options_zoom,
73} bdisplay_hd_output_options;
74
75#ifdef __cplusplus
76extern "C"
77{
78#endif
79
80/*=*******************************************
81A display is a coordinated set of video/audio outputs that are usually sent
82to one TV set.
83Each display may have multiple outputs (e.g. svideo, composite), but each
84output will carry the same content.
85
86Decode windows are boxes of video content on a display. You control decode
87windows and audio volume through the display API.
88
89Some chips support more than one display (7038, 7320 and Venom2).
90For these systems, you will open two bdisplay_t handles and have one bdecode_window_t handle
91created for each display.
92**********************************************/
93
94/* Defines */
95#define B_N_DISPLAYS 1
96
97/*
98Summary:
99Display settings for configuring outputs, video format and aspect ratio.
100*/
101        typedef enum bdisplay_rfm_t
102        {
103                eRFM_NONE,
104                eRFM_CH3,
105                eRFM_CH4
106        }bdisplay_rfm_t;
107
108/**
109Summary:
110Settings for RF output
111**/
112        typedef struct boutput_rf_settings
113        {
114                bool enable_output;                                     /* Enable RF Output or not */
115                bdisplay_rfm_t  channel;                        /* 1 - ch3 output, 2 ch4 output. */
116                char country[2];                                        /* 2 letter iso3166 country code */ 
117        } boutput_rf_settings;
118
119/*
120Summary:
121S/PDIF Output channel configuration.
122*/
123        typedef enum bdisplay_audio_out_ch_cfg
124        {
125                eAUDIO_OUT_CH_CFG_NORM,                                         /* Left  input -> Left output, Right input -> Right output */
126                eAUDIO_OUT_CH_CFG_BOTH_L,                                       /* Left  input -> both Left and Right outputs */
127                eAUDIO_OUT_CH_CFG_BOTH_R,                                       /* Right input -> both Left and Right outputs */
128                eAUDIO_OUT_CH_CFG_SWAP,                                         /* Left  input -> Right output, Right input -> Left output */
129        } bdisplay_audio_out_ch_cfg_t;
130
131        typedef struct boutput_spdif_settings
132        {
133                bool enable_output;                                                     /* Enable S/PDIF Output or not */
134                bool enable_cp;                                                         /* Enable Copy Protection Toggling */
135                bool enable_ch_stat;                                            /* Enable channel status and validity bit handling */
136                bdisplay_audio_out_ch_cfg_t out_ch_cfg;         /* Select what channels are output */
137                bool validity;                                                          /* V bit polarity */
138                uint32_t ch_stat_l_low;                                         /* Low channel status bits for left channel [0:31] */
139                uint32_t ch_stat_r_low;                                         /* Low channel status bits for right channel [0:31] */
140                uint32_t ch_stat_hi;                                            /* High channel status bits for both channels [41:32] */
141
142                bool        pcm;                                                        /* If true, always send PCM audio to SPDIF output. If the format
143                                                                                                           is not supported by the chip, you will get no audio output.
144                                                                                                           If false, the audio will be passed-through if supported
145                                                                                                           by SPDIF, otherwise it is decoded by the chip.
146       
147                                                                                                           Specifics:
148                                                                                                           MPEG audio (layer 1/2) will always be decoded and PCM
149                                                                                                           will be sent to SPDIF. */
150                baudio_format compressed_audio_format;          /* compressed output format.  If pcm = false and this format is
151                                                                                                           set to a valid format (e.g. baudio_format_dts), output will be
152                                                                                                           transcoded to that format.  By default this is baudio_format_unknown,
153                                                                                                           which will leave the compressed data in the original format. */
154        } boutput_spdif_settings;
155
156        typedef struct boutput_i2s_settings
157        {
158                bool enable_output;                                                     /* Enable I2S Output or not */
159                bdisplay_audio_out_ch_cfg_t out_ch_cfg;         /* Select what channels are output */
160                unsigned int bits_per_sample;                           /* 16 = 16 bits per sample, 24 = 24 bits per sample */
161                bool data_msb_first;                                            /* Set to true for MSB or false for LSB data */
162                bool data_delayed;                                                      /* Set to true to delay data by one SCLK period or false otherwise */
163                bool lr_clk_polarity;                                           /* Set to 1 for left/right clock to be high for left samples */
164        } boutput_i2s_settings;
165
166/*
167Summary:
168        RF modulator output handle returned by boutput_rf_open()
169*/
170        typedef struct boutput_rf *boutput_rf_t;
171
172/*
173Summary:
174        SPDIF audio handle returned by boutput_spdif_open()
175*/
176        typedef struct boutput_spdif *boutput_spdif_t;
177
178/*
179Summary:
180        I2S audio handle returned by boutput_i2s_open()
181*/
182        typedef struct boutput_i2s *boutput_i2s_t;
183
184
185/*
186Summary:
187        Video display rate change callback
188*/
189        typedef void (*bdisplay_rate_change_cb_t)(bdisplay_t display,   /* display contect handle */
190                                                                                          void *data_ptr,                 /* rate_change_data */
191                                                                                          void *cbData                    /* BAVC_VdcDisplay_Info* */
192                                                                                         );
193
194/*
195Summary:
196        Video display settings structure
197*/
198        typedef struct bdisplay_settings
199        {
200                bsettop_display_format_t format; /* hdmi video format */
201                bdisplay_rate_change_cb_t rate_change_cb; /* normaly used to notify HDMI of rate change */
202                void *rate_change_data; /* passed to rate_change_cb */
203                boutput_rf_t    rf;             /* attached RF output */
204                boutput_spdif_t spdif;  /* attached SPDIF audio output */
205                boutput_i2s_t i2s;              /* attached I2S audio output */
206
207                bdisplay_sd_output_options sd_options;
208                bdisplay_hd_output_options hd_options;
209                unsigned char sharpness;        /* 0-25 range, which will convert to 101-126 for coefficient index */
210                bool force_change_format;       /* force to change if RGB or audio passing mode is set */
211                bool deinterlace;                       /* Enable/Disable deinterlacer */
212                bool shrink_width;                      /* Enable/Disable shrink width deinterlacer option */
213                int deinterlacer_affinity;      /* 0 - HD 1 - SD */
214        } bdisplay_settings;
215
216
217/*
218Summary:
219        Open a display.
220Description:
221        The new display object will already have default outputs configured.
222        You can change the configuration by calling bdisplay_set, making changes,
223        then calling bdisplay_set.
224*/
225        bdisplay_t bdisplay_open(
226                                                        bobject_t display_id /* handle used to identify a particular display */
227                                                        );
228
229/*
230Summary:
231   Close a display.
232Description:
233   All decode windows opened or cloned for this display should have already been closed,
234   otherwise you get an inconsistent state.
235*/
236        void bdisplay_close(
237                                           bdisplay_t display /* handle returned by bdisplay_open */
238                                           );
239
240/*
241Summary:
242        Open a RF output.
243Description:
244        It must be assigned to a display.
245*/
246        boutput_rf_t
247        boutput_rf_open( bobject_t rfmod_id );
248
249/*
250Summary:
251        Open a SPDIF audio output.
252Description:
253        It must be assigned to a display.
254*/
255        boutput_spdif_t
256        boutput_spdif_open(bobject_t spdif_id);
257
258/*
259Summary:
260        Open a I2S audio output.
261Description:
262        It must be assigned to a display.
263*/
264        boutput_i2s_t
265        boutput_i2s_open(bobject_t i2s_id);
266
267/*
268Summary:
269   Configure the outputs, video format and aspect ratio of the display.
270*/
271        bresult
272        bdisplay_set(
273                                bdisplay_t display,     /* handle returned by bdisplay_open */
274                                bdisplay_settings *settings     /* desired display settings */
275                                );
276
277/*
278Summary:
279        Get the current outputs, video format and aspect ratio for a display.
280*/
281        void
282        bdisplay_get(
283                                bdisplay_t display,     /* handle returned by bdisplay_open */
284                                bdisplay_settings *settings     /* [out] current settings of display */
285                                );
286
287/**
288Summary:
289Set new RF settings.
290Description:
291These settings will not be applied until bdisplay_set is called with the
292RF handle assigned.
293**/
294        bresult boutput_rf_set(boutput_rf_t rf, 
295                                                   const boutput_rf_settings *settings
296                                                  );
297
298/**
299Summary:
300Get the current RF settings.
301**/
302        void boutput_rf_get(boutput_rf_t rf,
303                                                boutput_rf_settings *settings /* [out] */
304                                           );
305
306/**
307Summary:
308Set new SPDIF settings.
309Description:
310These settings will not be applied until bdisplay_set is called with the
311SPDIF handle assigned.
312**/
313        bresult boutput_spdif_set(boutput_spdif_t spdif, 
314                                                          const boutput_spdif_settings *settings
315                                                         );
316
317/**
318Summary:
319Get the current SPDIF settings.
320**/
321        void boutput_spdif_get(boutput_spdif_t spdif, 
322                                                   boutput_spdif_settings *settings     /* [out] */
323                                                  );
324
325/**
326Summary:
327Set new I2S settings.
328Description:
329These settings will not be applied until bdisplay_set is called with the
330I2S handle assigned.
331**/
332        bresult boutput_i2s_set(boutput_i2s_t i2s, 
333                                                        const boutput_i2s_settings *settings
334                                                   );
335
336/**
337Summary:
338Get the current I2S settings.
339**/
340        void boutput_i2s_get(boutput_i2s_t i2s, 
341                                                 boutput_i2s_settings *settings /* [out] */
342                                                );
343
344/*
345Summary:
346        Set the audio volume for the rf modulator.
347Description:
348        This function only sets the rfm audio volume.
349*/
350        bresult boutput_rf_set_audio_volume(
351                                                                           boutput_rf_t rf,
352                                                                           unsigned int volume /* desired volume */
353                                                                           );
354
355/*
356Summary:
357   Get the audio levels for the rf modulator.
358*/
359        bresult boutput_rf_get_audio_volume(
360                                                                           boutput_rf_t rf,
361                                                                           unsigned int *volume   /* [out] current volume of the rf modulater */
362                                                                           );
363
364/*
365Summary:
366        Open a new decode window.
367Description:
368   Creates a new decode window on the given display.
369   The window_id is a global id, not relative to the display.
370
371   On PIP systems, B_ID(1) always refers to PIP.
372*/
373        bdecode_window_t
374        bdecode_window_open(
375                                           bobject_t window_id, /* window's object id */
376                                           bdisplay_t display /* display on which the window appears */
377                                           );
378
379/*
380Summary:
381        Hide and close a decode window.
382Description:
383        Any decode which you started to this decode window should have already been
384        stopped.
385*/
386        void
387        bdecode_window_close(
388                                                bdecode_window_t window
389                                                );
390
391/*
392Summary:
393   Decode window settings returned by bdecode_window_get.
394*/
395        typedef struct bdecode_window_settings
396        {
397                bsettop_rect def_position;              /* default position and size on the display. Use display-relative coordinates. */
398                bsettop_rect position;          /* Position and size on the display. Use display-relative coordinates. */
399        } bdecode_window_settings;
400
401
402/*
403Summary:
404        Get the current settings of a decode window.
405*/
406        bresult
407        bdecode_window_get(
408                                          bdecode_window_t window,
409                                          bdecode_window_settings *settings       /* [out] */
410                                          );
411
412/*
413Summary:
414        Apply new settings to the decode window.
415Description:
416        Only those individual settings which have changed will be asserted.
417*/
418        bresult
419        bdecode_window_set(
420                                          bdecode_window_t window,
421                                          bdecode_window_settings *settings
422                                          );
423
424/*
425Summary:
426Pass new settings to the decode window without BVDC_ApplyChanges.
427Description:
428Only those individual settings which have changed will be asserted.
429 */
430bresult
431bdecode_window_preset(
432                                         bdecode_window_t window,
433                                         bdecode_window_settings *settings
434                                     );
435
436
437int b_lock_vdc(void);
438void b_unlock_vdc(void);
439
440#ifdef  HAS_VBI
441
442/*
443Summary:
444        enable amol and gs
445Description:
446        enable/disable amol and gs
447 */
448        bresult bdisplay_vbi_enable_amol_gs(bool enable);
449
450
451/*
452Summary:
453        enque gs data to vbvi encode engine
454Description:
455        enque gs data to vbvi encode engine
456 */
457        bresult vbi_gs_write_isr(pscte_127_handle pscte_127, int field_parity);
458
459/*
460Summary:
461        enque AMOL data to vbvi encode engine
462Description:
463        enque AMOL data to vbvi encode engine
464 */
465        bresult vbi_amol_write_isr(pscte_127_handle pscte_127, int field_parity);
466
467#endif  /* HAS_VBI */
468
469        bresult
470        bdisplay_set_vbi_rating_info(
471                                                                bdisplay_t display, unsigned int ratings_tv, unsigned int ratings_movie,
472                                                                unsigned int content_v, unsigned int content_s, unsigned int content_l, unsigned int content_d
473                                                                );
474
475        bresult bdisplay_output_rf_enable(
476                                                                         bdisplay_t display, /* handle returned by bdisplay_open */
477                                                                         bool enable
478                                                                         );
479
480/**
481Summary:
482enable deinterlacer on display (id), and disable deinterlacer on other display (!id)
483**/
484void bdisplay_set_deinterlacer(bdisplay_t display, int id, bool enable);
485
486/**
487Summary:
488set SCL coefficient for SD path
489coeff_idx (1-26, which is softness -> sharpness)
490**/
491void bdisplay_set_coefficient_index(bdisplay_t display,bool horiz, int output, int coeff_idx);
492
493/*
494Summary:
495    enable visibility of HDMI window
496Description:
497    enable/disable HDMI window in case HDCP authentication failed
498 */
499bresult bdisplay_output_hdmi_enable(bdisplay_t display, bool enable);
500
501/*
502Summary:
503        to set initial hdmi video format if not default 720p
504Description:
505        to set initial hdmi video format if not default 720p
506 */
507bresult bdisplay_set_init_format(bobject_t display_id, bsettop_display_format_t fmt);
508
509/*
510Summary:
511        return default display settings
512Description:
513        return default display settings
514*/
515void bdisplay_get_default_settings(bdisplay_settings *psettings);
516
517
518/*
519Summary:
520        record auto aspect ratio for ntsc and 480p video format on hdmi output
521Description:
522        record auto aspect ratio for ntsc and 480p video format on hdmi output that
523        is returned from edid message of the display TV
524*/
525void bdisplay_record_hdmi_auto_aspect_ratio(bdisplay_t display, 
526        uint32_t  auto_hdmi_480i_aspect_ratio, uint32_t  auto_hdmi_480p_aspect_ratio);
527
528
529#ifdef __cplusplus
530}
531#endif
532
533#endif /* BSETTOP_DISPLAY_H__ */
534
Note: See TracBrowser for help on using the repository browser.