DVBCore  17.9.0
Open Source DVB Engine
 All Data Structures Files Functions Typedefs Macros Pages
Macros | Typedefs | Enumerations | Functions
vtc.c File Reference

Video Transformation Calculator. More...

#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include <assert.h>
#include "techtype.h"
#include "dbgfuncs.h"
#include "osdtype.h"
#include "vtc.h"

Macros

#define DBG(x)
 

Typedefs

typedef struct s_fraction S_VT_FRACTION
 
typedef struct s_matrix S_VT_MATRIX
 
typedef struct s_fract_rect S_VT_FRACT_RECT
 
typedef struct s_conversion_state S_VT_CONVERSION_STATE
 

Enumerations

enum  E_AFD_PREFERENCE { AFD_PREFERENCE_AUTO, AFD_PREFERENCE_16_9_LB, AFD_PREFERENCE_14_9_LB, AFD_PREFERENCE_CCO }
 
enum  E_MHEG_SCALING { MHEG_SCALING_NONE, MHEG_SCALING_QUARTER, MHEG_SCALING_OFFSET, MHEG_SCALING_OTHER }
 

Functions

void * VT_Open (S_VT_OPTIONS *options)
 Open video transformation manager. More...
 
void VT_Close (void *context)
 Close video transformation manager. More...
 
void VT_Enable (void *context, BOOLEAN enable)
 Enable or disable transformation calculations. More...
 
void VT_SetAfd (void *context, U8BIT afd_value)
 Set current AFD (active format descriptor value) More...
 
void VT_SetVideoAspectRatio (void *context, E_ASPECT_RATIO aspect_ratio)
 Set video aspect ratio. More...
 
E_ASPECT_RATIO VT_GetVideoAspectRatio (void *context)
 Get video aspect ratio. More...
 
void VT_SetMhegAspectRatio (void *context, E_ASPECT_RATIO aspect_ratio)
 Set MHEG-5 aspect ratio. More...
 
E_ASPECT_RATIO VT_GetDisplayAspectRatio (void *context)
 Get display aspect ratio. More...
 
void VT_SetDisplayAspectRatio (void *context, E_ASPECT_RATIO aspect_ratio)
 Set display aspect ratio. More...
 
void VT_SetVideoAlignmentPref (void *context, E_VIDEO_ASPECT_MODE alignment)
 Set user preference for video aspect ratio alignment. More...
 
void VT_SetCustomModeCallback (void *context, F_VT_CUSTOM_MODE_CALLBACK callback)
 Set customer mode callback. More...
 
void VT_SetMhegScalingResolution (void *context, U16BIT width, U16BIT height)
 Set MHEG5 scaling resolution. More...
 
void VT_SetMhegScaling (void *context, S_RECTANGLE *scaling)
 Set MHEG-5 scaling information. More...
 
void VT_SetAppScaling (void *context, S_RECTANGLE *window)
 Set application scaling information. More...
 
void VT_SetVideoResolution (void *context, U16BIT width, U16BIT height)
 Set video resolution. More...
 
void VT_SetScreenResolution (void *context, U16BIT width, U16BIT height)
 Set screen resolution. More...
 
void VT_SetMhegVideoAlignment (void *context, E_VIDEO_ASPECT_MODE mode)
 Set widescreeen alignment mode for MHEG-5. More...
 
void VT_SetProfileMheg5 (void *context, BOOLEAN enable)
 Set profile to apply MHEG5 option. More...
 
void VT_SetProfileHbbtv (void *context, BOOLEAN enable)
 Set profile to apply HBBTV option. More...
 
void VT_SetHbbtvWindow (void *context, S_RECTANGLE *output)
 Set HBBTV output window. More...
 
void VT_GetVideoTransformation (void *context, S_RECTANGLE *input_rect, S_RECTANGLE *output_rect)
 Get the current video transfromation rectangles. More...
 
void VT_GetWss (void *context, U8BIT *wss)
 Return WSS (wide-screen signalling) value. More...
 
void VT_SetVideoChangedCallback (void *context, F_VT_NOTIFICATION_CALLBACK callback, void *user_data)
 Set video change callback. More...
 
void VT_SetUserPreferenceChangedCallback (void *context, F_VT_NOTIFICATION_CALLBACK callback, void *user_data)
 Set user preference change callback. More...
 
E_FORMAT_CONVERSION VT_GetDecoderFormatConversion (void *context)
 Return the current decoder format conversion. More...
 
void VT_GetScreenResolution (void *context, U16BIT *width, U16BIT *height)
 Return the current screen resolution. More...
 
void VT_GetVideoResolution (void *context, U16BIT *width, U16BIT *height)
 Return the current video resolution. More...
 
BOOLEAN VT_IsOsdScaled (void *context)
 Check if osd must be scaled due to MHEG scene aspect ratio. More...
 
void VT_SetDecoderStatus (void *context, E_STB_AV_DECODER_STATUS status)
 Set the decoder status. More...
 
E_STB_AV_DECODER_STATUS VT_GetDecoderStatus (void *context)
 Get the decoder status. More...
 

Detailed Description

Video Transformation Calculator.

Date
15/03/12
Author
Peter Stanton

Function Documentation

void VT_Close ( void *  context)

Close video transformation manager.


Parameters
context- transformation calculator context
void VT_Enable ( void *  context,
BOOLEAN  enable 
)

Enable or disable transformation calculations.


Parameters
context- transformation calculator context
enable- TRUE if calculations are enabled, FALSE otherwise
E_FORMAT_CONVERSION VT_GetDecoderFormatConversion ( void *  context)

Return the current decoder format conversion.


Parameters
context- transformation calculator context
Returns
Decoder format conversion
E_STB_AV_DECODER_STATUS VT_GetDecoderStatus ( void *  context)

Get the decoder status.


Parameters
context- transformation calculator context
Returns
The decoder status
E_ASPECT_RATIO VT_GetDisplayAspectRatio ( void *  context)

Get display aspect ratio.


Parameters
context- transformation calculator context
Returns
E_ASPECT_RATIO of display
void VT_GetScreenResolution ( void *  context,
U16BIT *  width,
U16BIT *  height 
)

Return the current screen resolution.


Parameters
context- transformation calculator context
width- screen width
height- screen height
E_ASPECT_RATIO VT_GetVideoAspectRatio ( void *  context)

Get video aspect ratio.


Parameters
context- transformation calculator context
Returns
aspect_ratio - video aspect ratio
void VT_GetVideoResolution ( void *  context,
U16BIT *  width,
U16BIT *  height 
)

Return the current video resolution.


Parameters
context- transformation calculator context
width- video width
height- video height
void VT_GetVideoTransformation ( void *  context,
S_RECTANGLE input_rect,
S_RECTANGLE output_rect 
)

Get the current video transfromation rectangles.


Parameters
context- transformation calculator context
input_rect- input rectangle for transformation
output_rect- output rectangle for transformation
void VT_GetWss ( void *  context,
U8BIT *  wss 
)

Return WSS (wide-screen signalling) value.


Parameters
context- transformation calculator context
wss- WSS value
BOOLEAN VT_IsOsdScaled ( void *  context)

Check if osd must be scaled due to MHEG scene aspect ratio.


Parameters
context- transformation calculator context
Returns
TRUE if osd scaling is required, FALSE otherwise
void* VT_Open ( S_VT_OPTIONS options)

Open video transformation manager.


Parameters
options- transformation manager options
Returns
Pointer to manager context, NULL if cannot be created
void VT_SetAfd ( void *  context,
U8BIT  afd_value 
)

Set current AFD (active format descriptor value)


Parameters
context- transformation calculator context
afd_value- AFD value
void VT_SetAppScaling ( void *  context,
S_RECTANGLE window 
)

Set application scaling information.


Parameters
context- transformation calculator context
window- output window (screen CS)
Note
When window is NULL, application scaling is turned off
void VT_SetCustomModeCallback ( void *  context,
F_VT_CUSTOM_MODE_CALLBACK  callback 
)

Set customer mode callback.


Parameters
context- transformation calculator context
callback- callback
void VT_SetDecoderStatus ( void *  context,
E_STB_AV_DECODER_STATUS  status 
)

Set the decoder status.


Parameters
context- transformation calculator context
status- New decoder status
void VT_SetDisplayAspectRatio ( void *  context,
E_ASPECT_RATIO  aspect_ratio 
)

Set display aspect ratio.


Parameters
context- transformation calculator context
aspect_ratio- video aspect ratio
void VT_SetHbbtvWindow ( void *  context,
S_RECTANGLE output 
)

Set HBBTV output window.


Parameters
context- transformation calculator context
output- window
void VT_SetMhegAspectRatio ( void *  context,
E_ASPECT_RATIO  aspect_ratio 
)

Set MHEG-5 aspect ratio.

Set MHEG5 scene aspect ratio.


Parameters
context- transformation calculator context
aspect_ratio- MHEG5 scene aspect ratio
void VT_SetMhegScaling ( void *  context,
S_RECTANGLE scaling 
)

Set MHEG-5 scaling information.


Parameters
context- transformation calculator context
scaling- scaling and positioning transformation
Note
When scaling is NULL, scaling is ignored and the behaviour will be as if full screen video is mapped to the full screen.
void VT_SetMhegScalingResolution ( void *  context,
U16BIT  width,
U16BIT  height 
)

Set MHEG5 scaling resolution.

Set Voyager scaling resolution.


Parameters
context- transformation calculator context
width
height
void VT_SetMhegVideoAlignment ( void *  context,
E_VIDEO_ASPECT_MODE  mode 
)

Set widescreeen alignment mode for MHEG-5.


Parameters
context- transformation calculator context
wam- widescreen alignment mode
void VT_SetProfileHbbtv ( void *  context,
BOOLEAN  enable 
)

Set profile to apply HBBTV option.


Parameters
context- transformation calculator context
enable- TRUE turns HBBTV option on
void VT_SetProfileMheg5 ( void *  context,
BOOLEAN  enable 
)

Set profile to apply MHEG5 option.


Parameters
context- transformation calculator context
enable- TRUE turns MHEG5 option on
void VT_SetScreenResolution ( void *  context,
U16BIT  width,
U16BIT  height 
)

Set screen resolution.


Parameters
context- transformation calculator context
width- screen width (in pixels)
height- screen height (in pixels)
void VT_SetUserPreferenceChangedCallback ( void *  context,
F_VT_NOTIFICATION_CALLBACK  callback,
void *  user_data 
)

Set user preference change callback.


The callback is called whenever the video transformation changes as a result of a change in user preferences.

Parameters
context- transformation calculator context
callback- the callback to call
user_data- user data to pass to the callback
void VT_SetVideoAlignmentPref ( void *  context,
E_VIDEO_ASPECT_MODE  alignment 
)

Set user preference for video aspect ratio alignment.

Set user preference for video aspect ratio.


Parameters
context- transformation calculator context
alignment- New video alignment preference:
void VT_SetVideoAspectRatio ( void *  context,
E_ASPECT_RATIO  aspect_ratio 
)

Set video aspect ratio.


Parameters
context- transformation calculator context
aspect_ratio- video aspect ratio
void VT_SetVideoChangedCallback ( void *  context,
F_VT_NOTIFICATION_CALLBACK  callback,
void *  user_data 
)

Set video change callback.


The callback is called whenever the video transformation is changed for any reason.

Parameters
context- transformation calculator context
callback- the callback to call
user_data- user data to pass to the callback
void VT_SetVideoResolution ( void *  context,
U16BIT  width,
U16BIT  height 
)

Set video resolution.


Parameters
context- transformation calculator context
width- video width (in pixels)
height- video height (in pixels)