atmo.cpp File Reference

Include dependency graph for atmo.cpp:


Data Structures

struct  fadethread_t
struct  filter_sys_t
 filter_sys_t: chroma method descriptor More...

Defines

#define lvsGDI   0
#define lvsExternal   1
#define CLASSIC_ATMO_NUM_ZONES   5
#define MODULE_DESCRIPTION
#define DRIVER_TEXT   N_("Device type")
#define DRIVER_LONGTEXT
#define DMX_CHANNELS_TEXT   N_("Count of AtmoLight channels")
#define DMX_CHANNELS_LONGTEXT
#define DMX_CHBASE_TEXT   N_("DMX address for each channel")
#define DMX_CHBASE_LONGTEXT
#define MOMO_CHANNELS_TEXT   N_("Count of channels")
#define MOMO_CHANNELS_LONGTEXT
#define DEFAULT_DEVICE   1
#define WIDTH_TEXT   N_("Extracted Image Width")
#define WIDTH_LONGTEXT
#define HEIGHT_TEXT   N_("Extracted Image Height")
#define HEIGHT_LONGTEXT
#define SHOW_DOTS_TEXT   N_("Mark analyzed pixels")
#define SHOW_DOTS_LONGTEXT
#define PCOLOR_TEXT   N_("Color when paused")
#define PCOLOR_LONGTEXT
#define PCOLOR_RED_TEXT   N_("Pause-Red")
#define PCOLOR_RED_LONGTEXT   N_("Red component of the pause color")
#define PCOLOR_GREEN_TEXT   N_("Pause-Green")
#define PCOLOR_GREEN_LONGTEXT   N_("Green component of the pause color")
#define PCOLOR_BLUE_TEXT   N_("Pause-Blue")
#define PCOLOR_BLUE_LONGTEXT   N_("Blue component of the pause color")
#define FADESTEPS_TEXT   N_("Pause-Fadesteps")
#define FADESTEPS_LONGTEXT
#define ECOLOR_RED_TEXT   N_("End-Red")
#define ECOLOR_RED_LONGTEXT   N_("Red component of the shutdown color")
#define ECOLOR_GREEN_TEXT   N_("End-Green")
#define ECOLOR_GREEN_LONGTEXT   N_("Green component of the shutdown color")
#define ECOLOR_BLUE_TEXT   N_("End-Blue")
#define ECOLOR_BLUE_LONGTEXT   N_("Blue component of the shutdown color")
#define EFADESTEPS_TEXT   N_("End-Fadesteps")
#define EFADESTEPS_LONGTEXT
#define ZONE_TOP_TEXT   N_("Number of zones on top")
#define ZONE_TOP_LONGTEXT   N_("Number of zones on the top of the screen")
#define ZONE_BOTTOM_TEXT   N_("Number of zones on bottom")
#define ZONE_BOTTOM_LONGTEXT   N_("Number of zones on the bottom of the screen")
#define ZONE_LR_TEXT   N_("Zones on left / right side")
#define ZONE_LR_LONGTEXT
#define ZONE_SUMMARY_TEXT   N_("Calculate a average zone")
#define ZONE_SUMMARY_LONGTEXT
#define USEWHITEADJ_TEXT   N_("Use Software White adjust")
#define USEWHITEADJ_LONGTEXT
#define WHITE_RED_TEXT   N_("White Red")
#define WHITE_RED_LONGTEXT
#define WHITE_GREEN_TEXT   N_("White Green")
#define WHITE_GREEN_LONGTEXT
#define WHITE_BLUE_TEXT   N_("White Blue")
#define WHITE_BLUE_LONGTEXT
#define SERIALDEV_TEXT   N_("Serial Port/Device")
#define SERIALDEV_LONGTEXT
#define EDGE_TEXT   N_("Edge Weightning")
#define EDGE_LONGTEXT
#define BRIGHTNESS_TEXT   N_("Brightness")
#define BRIGHTNESS_LONGTEXT   N_("Overall brightness of your LED stripes")
#define DARKNESS_TEXT   N_("Darkness Limit")
#define DARKNESS_LONGTEXT
#define HUEWINSIZE_TEXT   N_("Hue windowing")
#define HUEWINSIZE_LONGTEXT   N_("Used for statistics.")
#define SATWINSIZE_TEXT   N_("Sat windowing")
#define SATWINSIZE_LONGTEXT   N_("Used for statistics.")
#define MEANLENGTH_TEXT   N_("Filter length (ms)")
#define MEANLENGTH_LONGTEXT
#define MEANTHRESHOLD_TEXT   N_("Filter threshold")
#define MEANTHRESHOLD_LONGTEXT
#define MEANPERCENTNEW_TEXT   N_("Filter Smoothness (in %)")
#define MEANPERCENTNEW_LONGTEXT   N_("Filter Smoothness")
#define FILTERMODE_TEXT   N_("Output Color filter mode")
#define FILTERMODE_LONGTEXT
#define FRAMEDELAY_TEXT   N_("Frame delay (ms)")
#define FRAMEDELAY_LONGTEXT
#define CHANNEL_0_ASSIGN_TEXT   N_("Channel 0: summary")
#define CHANNEL_1_ASSIGN_TEXT   N_("Channel 1: left")
#define CHANNEL_2_ASSIGN_TEXT   N_("Channel 2: right")
#define CHANNEL_3_ASSIGN_TEXT   N_("Channel 3: top")
#define CHANNEL_4_ASSIGN_TEXT   N_("Channel 4: bottom")
#define CHANNELASSIGN_LONGTEXT
#define CHANNELS_ASSIGN_TEXT   N_("Channel / Zone Assignment")
#define CHANNELS_ASSIGN_LONGTEXT
#define ZONE_0_GRADIENT_TEXT   N_("Zone 0: Top gradient")
#define ZONE_1_GRADIENT_TEXT   N_("Zone 1: Right gradient")
#define ZONE_2_GRADIENT_TEXT   N_("Zone 2: Bottom gradient")
#define ZONE_3_GRADIENT_TEXT   N_("Zone 3: Left gradient")
#define ZONE_4_GRADIENT_TEXT   N_("Zone 4: Summary gradient")
#define ZONE_X_GRADIENT_LONG_TEXT
#define GRADIENT_PATH_TEXT   N_("Gradient bitmap searchpath")
#define GRADIENT_PATH_LONGTEXT
#define CFG_PREFIX   "atmo-"
#define SCALEBITS   10
#define ONE_HALF   (1 << (SCALEBITS - 1))
#define FIX(x)   ((int) ((x) * (1<<SCALEBITS) + 0.5))
#define CLAMP(x)   (((x) > 255) ? 255 : ((x) < 0) ? 0 : (x));

Functions

static int CreateFilter (vlc_object_t *)
static void DestroyFilter (vlc_object_t *)
static picture_tFilter (filter_t *, picture_t *)
static void AddStateVariableCallback (filter_t *)
static void DelStateVariableCallback (filter_t *)
static int StateCallback (vlc_object_t *, char const *, vlc_value_t, vlc_value_t, void *)
static void DelAtmoSettingsVariablesCallbacks (filter_t *)
static void AddAtmoSettingsVariablesCallbacks (filter_t *)
static int AtmoSettingsCallback (vlc_object_t *, char const *, vlc_value_t, vlc_value_t, void *)
static void CheckAndStopFadeThread (filter_t *)
static void ExtractMiniImage_YUV (filter_sys_t *, picture_t *, uint8_t *)
int vlc_entry__main (module_t *p_module)
const char * vlc_entry_license__main (void)
static void * FadeToColorThread (vlc_object_t *)
static int32_t AtmoInitialize (filter_t *p_filter, bool b_for_thread)
static void AtmoFinalize (filter_t *p_filter, int32_t what)
static int32_t AtmoSwitchEffect (filter_t *p_filter, int32_t newMode)
static int32_t AtmoSetLiveSource (filter_t *p_filter, int32_t newSource)
static void AtmoCreateTransferBuffers (filter_t *p_filter, int32_t FourCC, int32_t bytePerPixel, int32_t width, int32_t height)
static uint8_t * AtmoLockTransferBuffer (filter_t *p_filter)
static void AtmoSendPixelData (filter_t *p_filter)
static void Atmo_Shutdown (filter_t *p_filter)
static void Atmo_SetupImageSize (filter_t *p_filter)
static void Atmo_SetupBuildZones (filter_t *p_filter)
static void Atmo_SetupConfig (filter_t *p_filter, CAtmoConfig *p_atmo_config)
static void Atmo_SetupParameters (filter_t *p_filter)
static void yuv_to_rgb (uint8_t *r, uint8_t *g, uint8_t *b, uint8_t y1, uint8_t u1, uint8_t v1)
static void CreateMiniImage (filter_t *p_filter, picture_t *p_inpic)

Variables

static const int pi_device_type_values []
static const char *const ppsz_device_type_descriptions []
static const int pi_filtermode_values []
static const char *const ppsz_filtermode_descriptions []
static const int pi_zone_assignment_values []
static const char *const ppsz_zone_assignment_descriptions []
static const char *const ppsz_filter_options []

Define Documentation

#define BRIGHTNESS_LONGTEXT   N_("Overall brightness of your LED stripes")

#define BRIGHTNESS_TEXT   N_("Brightness")

#define CFG_PREFIX   "atmo-"

#define CHANNEL_0_ASSIGN_TEXT   N_("Channel 0: summary")

#define CHANNEL_1_ASSIGN_TEXT   N_("Channel 1: left")

#define CHANNEL_2_ASSIGN_TEXT   N_("Channel 2: right")

#define CHANNEL_3_ASSIGN_TEXT   N_("Channel 3: top")

#define CHANNEL_4_ASSIGN_TEXT   N_("Channel 4: bottom")

#define CHANNELASSIGN_LONGTEXT

Value:

N_("Maps the hardware channel X to logical "\
                                  "zone Y to fix wrong wiring :-)")

#define CHANNELS_ASSIGN_LONGTEXT

Value:

N_("for devices with more than five " \
                  "channels / zones write down here for each channel " \
                  "the zone number to show and seperate the values with " \
                  ", or ; and use -1 to not use some channels. For the " \
                  "classic AtmoLight the sequence 4,3,1,0,2 would set the " \
                  "default channel/zone mapping. " \
                  "Having only two zones on top, and one zone on left and " \
                  "right and no summary zone the mapping for classic " \
                  "AtmoLight would be -1,3,2,1,0")

#define CHANNELS_ASSIGN_TEXT   N_("Channel / Zone Assignment")

#define CLAMP (  )     (((x) > 255) ? 255 : ((x) < 0) ? 0 : (x));

#define CLASSIC_ATMO_NUM_ZONES   5

#define DARKNESS_LONGTEXT

Value:

N_("Pixels with a saturation lower than this will "\
                               "be ignored. Should be greater than one for "\
                               "letterboxed videos.")

#define DARKNESS_TEXT   N_("Darkness Limit")

#define DEFAULT_DEVICE   1

#define DMX_CHANNELS_LONGTEXT

Value:

N_("How many AtmoLight channels, should be " \
                                  "emulated with that DMX device")

#define DMX_CHANNELS_TEXT   N_("Count of AtmoLight channels")

#define DMX_CHBASE_LONGTEXT

Value:

N_("Define here the DMX base address for each " \
                                  "channel use , or ; to seperate the values")

#define DMX_CHBASE_TEXT   N_("DMX address for each channel")

#define DRIVER_LONGTEXT

Value:

N_("Choose your prefered hardware from " \
                                  "the list, or choose AtmoWin Software " \
                                  "to delegate processing to the external " \
                                  "process - with more options")

#define DRIVER_TEXT   N_("Device type")

#define ECOLOR_BLUE_LONGTEXT   N_("Blue component of the shutdown color")

#define ECOLOR_BLUE_TEXT   N_("End-Blue")

#define ECOLOR_GREEN_LONGTEXT   N_("Green component of the shutdown color")

#define ECOLOR_GREEN_TEXT   N_("End-Green")

#define ECOLOR_RED_LONGTEXT   N_("Red component of the shutdown color")

#define ECOLOR_RED_TEXT   N_("End-Red")

#define EDGE_LONGTEXT

Value:

N_("Increasing this value will result in color "\
                                "more depending on the border of the frame.")

#define EDGE_TEXT   N_("Edge Weightning")

#define EFADESTEPS_LONGTEXT

Value:

N_("Number of steps to change current color to " \
                             "end color for dimming up the light in cinema " \
                             "style... (each step takes 40ms)")

#define EFADESTEPS_TEXT   N_("End-Fadesteps")

#define FADESTEPS_LONGTEXT

Value:

N_("Number of steps to change current color " \
                                  "to pause color (each step takes 40ms)")

#define FADESTEPS_TEXT   N_("Pause-Fadesteps")

#define FILTERMODE_LONGTEXT

Value:

N_("defines the how the output color should " \
                                  "be calculated based on previous color")

#define FILTERMODE_TEXT   N_("Output Color filter mode")

#define FIX (  )     ((int) ((x) * (1<<SCALEBITS) + 0.5))

Referenced by Yuv2Rgb(), and yuv_to_rgb().

#define FRAMEDELAY_LONGTEXT

Value:

N_("Helps to get the video output and the light "\
                                 "effects in sync. Values around 20ms should " \
                                 "do the trick.")

#define FRAMEDELAY_TEXT   N_("Frame delay (ms)")

#define GRADIENT_PATH_LONGTEXT

Value:

N_("Now prefered option to assign gradient "\
    "bitmaps, put them as zone_0.bmp, zone_1.bmp etc. into one folder and "\
    "set the foldername here")

#define GRADIENT_PATH_TEXT   N_("Gradient bitmap searchpath")

#define HEIGHT_LONGTEXT

Value:

N_("The height of the mini image for " \
                                  "further processing (48 is default)")

#define HEIGHT_TEXT   N_("Extracted Image Height")

#define HUEWINSIZE_LONGTEXT   N_("Used for statistics.")

#define HUEWINSIZE_TEXT   N_("Hue windowing")

#define lvsExternal   1

#define lvsGDI   0

Referenced by Atmo_Shutdown().

#define MEANLENGTH_LONGTEXT

Value:

N_("Time it takes until a color is completely "\
                                "changed. This prevents flickering.")

#define MEANLENGTH_TEXT   N_("Filter length (ms)")

#define MEANPERCENTNEW_LONGTEXT   N_("Filter Smoothness")

#define MEANPERCENTNEW_TEXT   N_("Filter Smoothness (in %)")

#define MEANTHRESHOLD_LONGTEXT

Value:

N_("How much a color has to be changed for an "\
                                  "immediate color change.")

#define MEANTHRESHOLD_TEXT   N_("Filter threshold")

#define MODULE_DESCRIPTION

Value:

N_ ( \
 "This module allows to control an so called AtmoLight device "\
 "connected to your computer.\n"\
 "AtmoLight is the homegrown version of what Philips calls AmbiLight.\n"\
 "If you need further information feel free to visit us at\n\n"\
 "http://www.vdr-wiki.de/wiki/index.php/Atmo-plugin\n"\
 "http://www.vdr-wiki.de/wiki/index.php/AtmoWin\n\n"\
 "You can find there detailed descriptions on how to build it for yourself "\
 "and where to get the required parts.\n" \
 "You can also have a look at pictures and some movies showing such a device " \
 "in live action.")

#define MOMO_CHANNELS_LONGTEXT

Value:

N_("Depending on your MoMoLight hardware " \
                                   "choose 3 or 4 channels")

#define MOMO_CHANNELS_TEXT   N_("Count of channels")

#define ONE_HALF   (1 << (SCALEBITS - 1))

Referenced by Yuv2Rgb(), and yuv_to_rgb().

#define PCOLOR_BLUE_LONGTEXT   N_("Blue component of the pause color")

#define PCOLOR_BLUE_TEXT   N_("Pause-Blue")

#define PCOLOR_GREEN_LONGTEXT   N_("Green component of the pause color")

#define PCOLOR_GREEN_TEXT   N_("Pause-Green")

#define PCOLOR_LONGTEXT

Value:

N_("Set the color to show if the user " \
                                  "pauses the video. (Have light to get " \
                                  "another beer?)")

#define PCOLOR_RED_LONGTEXT   N_("Red component of the pause color")

#define PCOLOR_RED_TEXT   N_("Pause-Red")

#define PCOLOR_TEXT   N_("Color when paused")

#define SATWINSIZE_LONGTEXT   N_("Used for statistics.")

#define SATWINSIZE_TEXT   N_("Sat windowing")

#define SCALEBITS   10

Referenced by Yuv2Rgb(), and yuv_to_rgb().

#define SERIALDEV_LONGTEXT

Value:

N_("Name of the serial port where the AtmoLight "\
                                "controller is attached to.\n" \
                                "On Windows usually something like COM1 or " \
                                "COM2. On Linux /dev/ttyS01 f.e.")

#define SERIALDEV_TEXT   N_("Serial Port/Device")

#define SHOW_DOTS_LONGTEXT

Value:

N_("makes the sample grid visible on screen as "\
                                  "white pixels")

#define SHOW_DOTS_TEXT   N_("Mark analyzed pixels")

#define USEWHITEADJ_LONGTEXT

Value:

N_("Should the buildin driver do a white " \
                                  "adjust or your LED stripes? recommend.")

#define USEWHITEADJ_TEXT   N_("Use Software White adjust")

#define WHITE_BLUE_LONGTEXT

Value:

N_("Blue value of a pure white on your "\
                                  "LED stripes.")

#define WHITE_BLUE_TEXT   N_("White Blue")

#define WHITE_GREEN_LONGTEXT

Value:

N_("Green value of a pure white on your "\
                                  "LED stripes.")

#define WHITE_GREEN_TEXT   N_("White Green")

#define WHITE_RED_LONGTEXT

Value:

N_("Red value of a pure white on your "\
                                  "LED stripes.")

#define WHITE_RED_TEXT   N_("White Red")

#define WIDTH_LONGTEXT

Value:

N_("The width of the mini image for " \
                                  "further processing (64 is default)")

#define WIDTH_TEXT   N_("Extracted Image Width")

#define ZONE_0_GRADIENT_TEXT   N_("Zone 0: Top gradient")

#define ZONE_1_GRADIENT_TEXT   N_("Zone 1: Right gradient")

#define ZONE_2_GRADIENT_TEXT   N_("Zone 2: Bottom gradient")

#define ZONE_3_GRADIENT_TEXT   N_("Zone 3: Left gradient")

#define ZONE_4_GRADIENT_TEXT   N_("Zone 4: Summary gradient")

#define ZONE_BOTTOM_LONGTEXT   N_("Number of zones on the bottom of the screen")

#define ZONE_BOTTOM_TEXT   N_("Number of zones on bottom")

#define ZONE_LR_LONGTEXT

Value:

N_("left and right side having allways the " \
                                  "same number of zones")

#define ZONE_LR_TEXT   N_("Zones on left / right side")

#define ZONE_SUMMARY_LONGTEXT

Value:

N_("it contains the average of all pixels " \
                                  "in the sample image (only useful for " \
                                  "single channel AtmoLight)")

#define ZONE_SUMMARY_TEXT   N_("Calculate a average zone")

#define ZONE_TOP_LONGTEXT   N_("Number of zones on the top of the screen")

#define ZONE_TOP_TEXT   N_("Number of zones on top")

#define ZONE_X_GRADIENT_LONG_TEXT

Value:

N_("Defines a small bitmap with 64x48 "\
                                     "pixels, containing a grayscale gradient")


Function Documentation

static void AddAtmoSettingsVariablesCallbacks ( filter_t p_filter  )  [static]

static void AddStateVariableCallback ( filter_t p_filter  )  [static]

static void Atmo_SetupBuildZones ( filter_t p_filter  )  [static]

static void Atmo_SetupConfig ( filter_t p_filter,
CAtmoConfig p_atmo_config 
) [static]

References i.

static void Atmo_SetupImageSize ( filter_t p_filter  )  [static]

static void Atmo_SetupParameters ( filter_t p_filter  )  [static]

static void Atmo_Shutdown ( filter_t p_filter  )  [static]

static void AtmoCreateTransferBuffers ( filter_t p_filter,
int32_t  FourCC,
int32_t  bytePerPixel,
int32_t  width,
int32_t  height 
) [static]

static void AtmoFinalize ( filter_t p_filter,
int32_t  what 
) [static]

static int32_t AtmoInitialize ( filter_t p_filter,
bool  b_for_thread 
) [static]

static uint8_t* AtmoLockTransferBuffer ( filter_t p_filter  )  [static]

static void AtmoSendPixelData ( filter_t p_filter  )  [static]

static int32_t AtmoSetLiveSource ( filter_t p_filter,
int32_t  newSource 
) [static]

Referenced by Atmo_Shutdown().

static int AtmoSettingsCallback ( vlc_object_t p_this,
char const *  psz_var,
vlc_value_t  oldval,
vlc_value_t  newval,
void *  p_data 
) [static]

static int32_t AtmoSwitchEffect ( filter_t p_filter,
int32_t  newMode 
) [static]

Referenced by Atmo_Shutdown().

static void CheckAndStopFadeThread ( filter_t p_filter  )  [static]

static int CreateFilter ( vlc_object_t p_this  )  [static]

static void CreateMiniImage ( filter_t p_filter,
picture_t p_inpic 
) [static]

static void DelAtmoSettingsVariablesCallbacks ( filter_t p_filter  )  [static]

static void DelStateVariableCallback ( filter_t p_filter  )  [static]

static void DestroyFilter ( vlc_object_t p_this  )  [static]

static void ExtractMiniImage_YUV ( filter_sys_t p_sys,
picture_t p_inpic,
uint8_t *  p_transfer_dest 
) [static]

static void * FadeToColorThread ( vlc_object_t obj  )  [static]

Referenced by Atmo_Shutdown(), and StateCallback().

static picture_t * Filter ( filter_t p_filter,
picture_t p_pic 
) [static]

static int StateCallback ( vlc_object_t p_this,
char const *  psz_cmd,
vlc_value_t  oldval,
vlc_value_t  newval,
void *  p_data 
) [static]

int vlc_entry__main ( module_t p_module  ) 

const char* vlc_entry_license__main ( void   ) 

static void yuv_to_rgb ( uint8_t *  r,
uint8_t *  g,
uint8_t *  b,
uint8_t  y1,
uint8_t  u1,
uint8_t  v1 
) [inline, static]


Variable Documentation

const int pi_device_type_values[] [static]

Initial value:

 {



     1, 
     2, 
     3, 
     4  
}

const int pi_filtermode_values[] [static]

Initial value:

 {
       (int)afmNoFilter,
       (int)afmCombined,
       (int)afmPercent
}

const int pi_zone_assignment_values[] [static]

Initial value:

 {
    -1,
     4,
     3,
     1,
     0,
     2
}

const char* const ppsz_device_type_descriptions[] [static]

Initial value:

 {



        N_("Classic AtmoLight"),
        N_("Quattro AtmoLight"),
        N_("DMX"),
        N_("MoMoLight")
}

const char* const ppsz_filter_options[] [static]

const char* const ppsz_filtermode_descriptions[] [static]

Initial value:

 {
        N_("No Filtering"),
        N_("Combined"),
        N_("Percent")
}

const char* const ppsz_zone_assignment_descriptions[] [static]

Initial value:

 {
        N_("disabled"),
        N_("Zone 4:summary"),
        N_("Zone 3:left"),
        N_("Zone 1:right"),
        N_("Zone 0:top"),
        N_("Zone 2:bottom")
}


Generated on Tue May 25 08:05:28 2010 for VLC by  doxygen 1.5.6