root/platform/ixus1000_sd4500/sub/102c/lib.c

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. hook_raw_image_addr
  2. hook_alt_raw_image_addr
  3. camera_jpeg_count_str
  4. vid_get_viewport_fb
  5. vid_get_viewport_live_fb
  6. vid_get_viewport_fb_d
  7. vid_get_bitmap_fb
  8. vid_get_viewport_byte_width
  9. vid_get_viewport_width
  10. vid_get_viewport_display_xoffset
  11. vid_get_viewport_height

   1 #include "platform.h"
   2 
   3 extern  int     active_raw_buffer;
   4 extern  char*   raw_buffers[];
   5 
   6 char *hook_raw_image_addr()
   7 {
   8     return raw_buffers[active_raw_buffer*3];
   9 }
  10 
  11 char *hook_alt_raw_image_addr()
  12 {
  13     return raw_buffers[(active_raw_buffer^1)*3];
  14 }
  15 
  16 char *camera_jpeg_count_str()
  17 {
  18     extern char jpeg_count_str[];
  19     return jpeg_count_str;
  20 }
  21 
  22 // Viewport and Bitmap values that shouldn't change across firmware versions.
  23 // Values that may change are in lib.c for each firmware version.
  24 
  25 // Defined in stubs_min.S
  26 extern char active_viewport_buffer;
  27 extern void* viewport_buffers[];
  28 
  29 
  30 void *vid_get_viewport_fb()
  31 {
  32     // Return first viewport buffer - for case when vid_get_viewport_live_fb not defined
  33     return viewport_buffers[0];
  34 }
  35 
  36 // Live picture buffer (shoot not pressed) //ASM1989  keept like sx210
  37 void *vid_get_viewport_live_fb()
  38 {
  39     if (MODE_IS_VIDEO(mode_get()))
  40         return viewport_buffers[0];     // Video only seems to use the first viewport buffer.
  41 
  42     // Hopefully return the most recently used viewport buffer so that motion detect, histogram, zebra and edge overly are using current image data
  43     return viewport_buffers[(active_viewport_buffer-1)&3];
  44 }
  45 
  46 void *vid_get_viewport_fb_d()
  47 {
  48     extern char *viewport_fb_d;
  49     return viewport_fb_d;
  50 }
  51 
  52 
  53 // OSD buffer  //ASM1989 ixsu1000
  54 void *vid_get_bitmap_fb()
  55 {
  56         return (void*)0x40471000;                              // found at FFA97414
  57 }
  58 
  59 
  60 //TODO: Liveview is not working
  61 // begin 16:9 support
  62 
  63 // Physical width of viewport row in bytes
  64 int vid_get_viewport_byte_width() {
  65     return 960 * 6 / 4;     // IXUS 1000 - wide screen LCD is 960 pixels wide, each group of 4 pixels uses 6 bytes (UYVYYY)
  66 }
  67 
  68 int vid_get_viewport_width()
  69 {
  70     if (get_movie_status() > 1){return 480;}
  71     if (shooting_get_prop(PROPCASE_ASPECT_RATIO) == 1 ) // on 16:9 shoot mode its 1.switch to video is 100
  72         return 480;
  73     else
  74        return 360;
  75 }
  76 
  77 int vid_get_viewport_display_xoffset()
  78 {
  79     if (get_movie_status() > 1){return 0;}
  80     if (shooting_get_prop(PROPCASE_ASPECT_RATIO) == 1  || ((mode_get()&MODE_MASK)== 100 ))
  81        return 0;
  82     else
  83        return 60;
  84 }
  85 
  86 // end 16:9 support
  87 
  88 long vid_get_viewport_height()
  89 {
  90     return 240;
  91 }

/* [<][>][^][v][top][bottom][index][help] */