DVBCore  17.9.0
Open Source DVB Engine
 All Data Structures Files Functions Typedefs Macros Pages
vtc.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 #ifndef VTC_H
25 #define VTC_H
26 
27 #include "techtype.h"
28 #include "stbhwav.h"
29 #include "vtctype.h"
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
35 typedef struct s_vt_options
36 {
37  BOOLEAN mheg_required;
38  BOOLEAN afd_required;
39  BOOLEAN hbbtv_required;
40 } S_VT_OPTIONS;
41 
42 typedef void (*F_VT_NOTIFICATION_CALLBACK)(void *userdata);
43 
44 /*!**************************************************************************
45  * @brief Open video transformation manager
46  * @param options - transformation manager options
47  * @return Pointer to manager context, NULL if cannot be created
48  ****************************************************************************/
49 void* VT_Open(S_VT_OPTIONS *options);
50 
51 /*!**************************************************************************
52  * @brief Close video transformation manager
53  * @param context - transformation calculator context
54  ****************************************************************************/
55 void VT_Close(void *context);
56 
57 /*!**************************************************************************
58  * @brief Enable or disable transformation calculations
59  * @param context - transformation calculator context
60  * @param enable - TRUE if calculations are enabled, FALSE otherwise
61  ****************************************************************************/
62 void VT_Enable(void *context, BOOLEAN enable);
63 
64 /*!**************************************************************************
65  * @brief Set current AFD (active format descriptor value)
66  * @param context - transformation calculator context
67  * @param afd_value - AFD value
68  ****************************************************************************/
69 void VT_SetAfd(void *context, U8BIT afd_value);
70 
71 /*!**************************************************************************
72  * @brief Set video aspect ratio
73  * @param context - transformation calculator context
74  * @param aspect_ratio - video aspect ratio
75  ****************************************************************************/
76 void VT_SetVideoAspectRatio(void *context, E_ASPECT_RATIO aspect_ratio);
77 
78 /*!**************************************************************************
79  * @brief Get video aspect ratio
80  * @param context - transformation calculator context
81  * @return aspect_ratio - video aspect ratio
82  ****************************************************************************/
83 E_ASPECT_RATIO VT_GetVideoAspectRatio(void *context);
84 
85 /*!**************************************************************************
86  * @brief Set MHEG5 scene aspect ratio
87  * @param context - transformation calculator context
88  * @param aspect_ratio - scene aspect ratio
89  ****************************************************************************/
90 void VT_SetMhegAspectRatio(void *context, E_ASPECT_RATIO aspect_ratio);
91 
92 /*!**************************************************************************
93  * @brief Get display aspect ratio
94  * @param context - transformation calculator context
95  * @return E_ASPECT_RATIO of display
96  ****************************************************************************/
97 E_ASPECT_RATIO VT_GetDisplayAspectRatio(void *context);
98 
99 /*!**************************************************************************
100  * @brief Set display aspect ratio
101  * @param context - transformation calculator context
102  * @param aspect_ratio - video aspect ratio
103  ****************************************************************************/
104 void VT_SetDisplayAspectRatio(void *context, E_ASPECT_RATIO aspect_ratio);
105 
106 /*!**************************************************************************
107  * @brief Set Voyager scaling resolution
108  * @param context - transformation calculator context
109  * @param width
110  * @param height
111  ****************************************************************************/
112 void VT_SetMhegScalingResolution(void *context, U16BIT width, U16BIT height);
113 
114 /*!**************************************************************************
115  * @brief Set MHEG-5 scaling information
116  * @param context - transformation calculator context
117  * @param scaling - scaling and positioning transformation
118  * @note When scaling is NULL, scaling is ignored and the behaviour will
119  * be as if full screen video is mapped to the full screen.
120  ****************************************************************************/
121 void VT_SetMhegScaling(void *context, S_RECTANGLE *scaling);
122 
123 /*!**************************************************************************
124  * @brief Set application scaling information
125  * @param context - transformation calculator context
126  * @param window - output window (screen CS)
127  * @note When window is NULL, application scaling is turned off
128  ****************************************************************************/
129 void VT_SetAppScaling(void *context, S_RECTANGLE *window);
130 
131 /*!**************************************************************************
132  * @brief Set video resolution
133  * @param context - transformation calculator context
134  * @param width - video width (in pixels)
135  * @param height - video height (in pixels)
136  ****************************************************************************/
137 void VT_SetVideoResolution(void *context, U16BIT width, U16BIT height);
138 
139 /*!**************************************************************************
140  * @brief Set screen resolution
141  * @param context - transformation calculator context
142  * @param width - screen width (in pixels)
143  * @param height - screen height (in pixels)
144  ****************************************************************************/
145 void VT_SetScreenResolution(void *context, U16BIT width, U16BIT height);
146 
147 /*!**************************************************************************
148  * @brief Set profile to apply MHEG5 option
149  * @param context - transformation calculator context
150  * @param enable - TRUE turns MHEG5 option on
151  ****************************************************************************/
152 void VT_SetProfileMheg5(void *context, BOOLEAN enable);
153 
154 /*!**************************************************************************
155  * @brief Set profile to apply HBBTV option
156  * @param context - transformation calculator context
157  * @param enable - TRUE turns MHEG5 option on
158  ****************************************************************************/
159 void VT_SetProfileHbbtv(void *context, BOOLEAN enable);
160 
161 /*!**************************************************************************
162  * @brief Set HBBTV output window
163  * @param context - transformation calculator context
164  * @param output - window
165  ****************************************************************************/
166 void VT_SetHbbtvWindow(void *context, S_RECTANGLE *output);
167 
168 /*!**************************************************************************
169  * @brief Set widescreeen alignment mode for MHEG-5
170  * @param context - transformation calculator context
171  * @param wam - widescreen alignment mode
172  ****************************************************************************/
173 void VT_SetMhegVideoAlignment(void *context, E_VIDEO_ASPECT_MODE wam);
174 
175 /*!**************************************************************************
176  * @brief Get the current video transfromation rectangles
177  * @param context - transformation calculator context
178  * @param input_rect - input rectangle for transformation
179  * @param output_rect - output rectangle for transformation
180  ****************************************************************************/
181 void VT_GetVideoTransformation(void *context, S_RECTANGLE *input_rect,
182  S_RECTANGLE *output_rect);
183 
184 /*!**************************************************************************
185  * @brief Return WSS (wide-screen signalling) value
186  * @param context - transformation calculator context
187  * @param wss - WSS value
188  ****************************************************************************/
189 void VT_GetWss(void *context, U8BIT *wss);
190 
191 /*!**************************************************************************
192  * @brief Set video change callback
193  *
194  * The callback is called whenever the video transformation is changed
195  * for any reason.
196  *
197  * @param context - transformation calculator context
198  * @param callback - the callback to call
199  * @param user_data - user data to pass to the callback
200  ****************************************************************************/
201 void VT_SetVideoChangedCallback(void *context,
202  F_VT_NOTIFICATION_CALLBACK callback,
203  void *user_data);
204 
205 /*!**************************************************************************
206  * @brief Set user preference change callback
207  *
208  * The callback is called whenever the video transformation changes as
209  * a result of a change in user preferences.
210  *
211  * @param context - transformation calculator context
212  * @param callback - the callback to call
213  * @param user_data - user data to pass to the callback
214  ****************************************************************************/
215 void VT_SetUserPreferenceChangedCallback(void *context,
216  F_VT_NOTIFICATION_CALLBACK callback,
217  void *user_data);
218 
219 /*!**************************************************************************
220  * @brief Return the current decoder format conversion
221  * @param context - transformation calculator context
222  * @return Decoder format conversion
223  ****************************************************************************/
224 E_FORMAT_CONVERSION VT_GetDecoderFormatConversion(void *context);
225 
226 /*!**************************************************************************
227  * @brief Return the current screen resolution
228  * @param context - transformation calculator context
229  * @param width - screen width
230  * @param height - screen height
231  ****************************************************************************/
232 void VT_GetScreenResolution(void *context, U16BIT *width, U16BIT *height);
233 
234 /*!**************************************************************************
235  * @brief Return the current video resolution
236  * @param context - transformation calculator context
237  * @param width - video width
238  * @param height - video height
239  ****************************************************************************/
240 void VT_GetVideoResolution(void *context, U16BIT *width, U16BIT *height);
241 
242 /*!**************************************************************************
243  * @brief Check if osd must be scaled due to MHEG scene aspect ratio
244  *
245  * @param context - transformation calculator context
246  * @return TRUE if osd scaling is required, FALSE otherwise
247  ****************************************************************************/
248 BOOLEAN VT_IsOsdScaled(void *context);
249 
250 /*!**************************************************************************
251  * @brief Set user preference for video aspect ratio
252  *
253  * @param context - transformation calculator context
254  * @param alignment - New video alignment preference:
255  ****************************************************************************/
256 void VT_SetVideoAlignmentPref(void *context, E_VIDEO_ASPECT_MODE alignment);
257 
258 /*!**************************************************************************
259  * @brief Set customer mode callback
260  *
261  * @param context - transformation calculator context
262  * @param callback - callback
263  ****************************************************************************/
264 void VT_SetCustomModeCallback(void *context, F_VT_CUSTOM_MODE_CALLBACK callback);
265 
266 /*!**************************************************************************
267  * @brief Set the decoder status
268  * @param context - transformation calculator context
269  * @param status - New decoder status
270  ****************************************************************************/
271 void VT_SetDecoderStatus(void *context, E_STB_AV_DECODER_STATUS status);
272 
273 /*!**************************************************************************
274  * @brief Get the decoder status
275  * @param context - transformation calculator context
276  * @return The decoder status
277  ****************************************************************************/
278 E_STB_AV_DECODER_STATUS VT_GetDecoderStatus(void *context);
279 
280 #ifdef __cplusplus
281 }
282 #endif
283 
284 #endif /*VTC_H*/
void VT_Enable(void *context, BOOLEAN enable)
Enable or disable transformation calculations.
Definition: vtc.c:422
E_FORMAT_CONVERSION(* F_VT_CUSTOM_MODE_CALLBACK)(E_ASPECT_RATIO video_aspect_ratio, E_ASPECT_RATIO display_aspect_ratio)
Callback used by the VTC module to determine what format conversion needs to be applied when the aspe...
Definition: vtctype.h:69
void * VT_Open(S_VT_OPTIONS *options)
Open video transformation manager.
Definition: vtc.c:346
void VT_SetVideoResolution(void *context, U16BIT width, U16BIT height)
Set video resolution.
Definition: vtc.c:715
BOOLEAN VT_IsOsdScaled(void *context)
Check if osd must be scaled due to MHEG scene aspect ratio.
Definition: vtc.c:1005
void VT_SetVideoAlignmentPref(void *context, E_VIDEO_ASPECT_MODE alignment)
Set user preference for video aspect ratio.
Definition: vtc.c:570
void VT_SetMhegScaling(void *context, S_RECTANGLE *scaling)
Set MHEG-5 scaling information.
Definition: vtc.c:655
E_ASPECT_RATIO VT_GetVideoAspectRatio(void *context)
Get video aspect ratio.
Definition: vtc.c:490
Definition: vtc.h:35
void VT_SetHbbtvWindow(void *context, S_RECTANGLE *output)
Set HBBTV output window.
Definition: vtc.c:830
Definition: osdtype.h:56
Header file - Function prototypes for A/V control.
Header file - Function prototypes for A/V control.
E_FORMAT_CONVERSION VT_GetDecoderFormatConversion(void *context)
Return the current decoder format conversion.
Definition: vtc.c:937
void VT_GetVideoResolution(void *context, U16BIT *width, U16BIT *height)
Return the current video resolution.
Definition: vtc.c:975
void VT_SetAppScaling(void *context, S_RECTANGLE *window)
Set application scaling information.
Definition: vtc.c:684
void VT_SetVideoChangedCallback(void *context, F_VT_NOTIFICATION_CALLBACK callback, void *user_data)
Set video change callback.
Definition: vtc.c:896
void VT_SetProfileMheg5(void *context, BOOLEAN enable)
Set profile to apply MHEG5 option.
Definition: vtc.c:788
void VT_SetAfd(void *context, U8BIT afd_value)
Set current AFD (active format descriptor value)
Definition: vtc.c:444
void VT_GetScreenResolution(void *context, U16BIT *width, U16BIT *height)
Return the current screen resolution.
Definition: vtc.c:958
void VT_SetMhegAspectRatio(void *context, E_ASPECT_RATIO aspect_ratio)
Set MHEG5 scene aspect ratio.
Definition: vtc.c:508
System Wide Global Technical Data Type Definitions.
void VT_SetMhegVideoAlignment(void *context, E_VIDEO_ASPECT_MODE wam)
Set widescreeen alignment mode for MHEG-5.
Definition: vtc.c:768
void VT_Close(void *context)
Close video transformation manager.
Definition: vtc.c:410
void VT_SetProfileHbbtv(void *context, BOOLEAN enable)
Set profile to apply HBBTV option.
Definition: vtc.c:809
void VT_SetScreenResolution(void *context, U16BIT width, U16BIT height)
Set screen resolution.
Definition: vtc.c:742
void VT_SetUserPreferenceChangedCallback(void *context, F_VT_NOTIFICATION_CALLBACK callback, void *user_data)
Set user preference change callback.
Definition: vtc.c:919
void VT_GetWss(void *context, U8BIT *wss)
Return WSS (wide-screen signalling) value.
Definition: vtc.c:877
void VT_SetCustomModeCallback(void *context, F_VT_CUSTOM_MODE_CALLBACK callback)
Set customer mode callback.
Definition: vtc.c:611
void VT_GetVideoTransformation(void *context, S_RECTANGLE *input_rect, S_RECTANGLE *output_rect)
Get the current video transfromation rectangles.
Definition: vtc.c:861
void VT_SetVideoAspectRatio(void *context, E_ASPECT_RATIO aspect_ratio)
Set video aspect ratio.
Definition: vtc.c:467
E_ASPECT_RATIO VT_GetDisplayAspectRatio(void *context)
Get display aspect ratio.
Definition: vtc.c:531
void VT_SetDecoderStatus(void *context, E_STB_AV_DECODER_STATUS status)
Set the decoder status.
Definition: vtc.c:1027
E_STB_AV_DECODER_STATUS VT_GetDecoderStatus(void *context)
Get the decoder status.
Definition: vtc.c:1047
void VT_SetDisplayAspectRatio(void *context, E_ASPECT_RATIO aspect_ratio)
Set display aspect ratio.
Definition: vtc.c:546
void VT_SetMhegScalingResolution(void *context, U16BIT width, U16BIT height)
Set Voyager scaling resolution.
Definition: vtc.c:631