Exemplo n.º 1
0
int vid_get_viewport_display_xoffset()
{
    int m = mode_get();
    if ((m & MODE_MASK) == MODE_PLAY)
    {
        return 0;
    }
    else if ((m & MODE_SHOOTING_MASK) == MODE_STITCH)
    {
        if (shooting_get_prop(PROPCASE_STITCH_DIRECTION) == 0)      // Direction check
            if (shooting_get_prop(PROPCASE_STITCH_SEQUENCE) == 0)   // Shot already taken?
                return 40;
            else
                return 140;
        else
            if (shooting_get_prop(PROPCASE_STITCH_SEQUENCE) == 0)   // Shot already taken?
                return 140;
            else
                return 40;
    }
    else
    {
	    return vp_xo[shooting_get_prop(PROPCASE_ASPECT_RATIO)];
    }
}
Exemplo n.º 2
0
int vid_get_viewport_display_xoffset() {
    if (camera_info.state.mode_play)
    {
        return 0;
    }
    // video, ignore still res propcase
    if(camera_info.state.mode_video || is_video_recording()) {
        if(shooting_get_prop(PROPCASE_VIDEO_RESOLUTION) == 2) {
            return 40;// 4:3 video
        } else {
            return 0; // 16:9 video, no x offset
        }
    }
    return vp_xo[shooting_get_prop(PROPCASE_ASPECT_RATIO)];
}
Exemplo n.º 3
0
Arquivo: lib.c Projeto: c10ud/CHDK
int vid_get_viewport_width()
{
    if (shooting_get_prop(PROPCASE_RESOLUTION) == 8)	// widescreen (16:9) image size
		return 480;
    else
        return 360;
}
Exemplo n.º 4
0
Arquivo: lib.c Projeto: c10ud/CHDK
int vid_get_viewport_xoffset()
{
	if (shooting_get_prop(PROPCASE_RESOLUTION) == 8)	// widescreen (16:9) image size
	   return 0;
	else
       return 60;
}
Exemplo n.º 5
0
Arquivo: lib.c Projeto: c10ud/CHDK
//extern  char*   raw_buffers[];
char *hook_raw_image_addr()
{
    if (current_raw_addr) {
         return current_raw_addr;
    }
// fall back to old code which will be wrong in many cases.....
    // observed values 0-2, 3 would index something that doesn't look like a raw fb in the jpeg case
    int i=active_raw_buffer&3;
/*
    _LogCameraEvent(0x20,"lc: hria: %i %i %08x %i",i, camera_info.state.mode_shooting,
                                              camera_info.state.mode_shooting,
                                              shooting_get_prop(PROPCASE_IMAGE_FORMAT));
*/ 
    if(i>2) {
        i=0;
    }
    if( camera_info.state.mode_shooting == MODE_AUTO) {
        // AUTO mode (canon raw can't be enabled in AUTO)
        return (char *)0x435ee300; // TODO unclear if this is only buffer, or if used in all AUTO sub modes
    }else if(shooting_get_prop(PROPCASE_IMAGE_FORMAT) == 1) {
    // canon raw disabled - uses up to 3 raw buffers
        return raw_buffers_jpeg[i];
    } else {
        // canon raw enabled - different address, not clear if it ever uses multiple buffers
        return raw_buffers_canon_raw[i];
    }
    // TODO most scene modes seem to use different addresse(s)
}
Exemplo n.º 6
0
Arquivo: lib.c Projeto: c10ud/CHDK
int vid_get_viewport_width()
{
    if (get_movie_status() > 1){return 480;}
    if (shooting_get_prop(PROPCASE_ASPECT_RATIO) == 1 ) // on 16:9 shoot mode its 1.switch to video is 100
        return 480;
    else
       return 360;
}
Exemplo n.º 7
0
Arquivo: lib.c Projeto: c10ud/CHDK
int vid_get_viewport_display_xoffset()
{
    if (get_movie_status() > 1){return 0;}
    if (shooting_get_prop(PROPCASE_ASPECT_RATIO) == 1  || ((mode_get()&MODE_MASK)== 100 ))
       return 0;
    else
       return 60;
}
Exemplo n.º 8
0
int vid_get_viewport_width()
{
    extern int kbd_debug1;
    //kbd_debug1 = mode_get();
    if (movie_status > 1){return 480;}
    if (shooting_get_prop(PROPCASE_ASPECT_RATIO) == 1 )	// on 16:9 shoot mode its 1.switch to video is 100
		return 480; 
    else
       return 360; 
}
Exemplo n.º 9
0
Arquivo: lib.c Projeto: c10ud/CHDK
int vid_get_viewport_display_xoffset()
{
    int m = mode_get();
    int aspect_ratio=shooting_get_prop(PROPCASE_ASPECT_RATIO);

    if ((m & MODE_MASK) != MODE_PLAY) {
        return (vp_xo[aspect_ratio]);
    }
    else
        return 0;
}
Exemplo n.º 10
0
Arquivo: lib.c Projeto: c10ud/CHDK
int vid_get_viewport_display_xoffset() {

    if (camera_info.state.mode_play) {
        return 0;
    }
    // video, ignore still res propcase
    if(camera_info.state.mode_video || is_video_recording()) {
            return 0; //all video modes for now
    }
    return vp_xo[shooting_get_prop(PROPCASE_ASPECT_RATIO)];

}
Exemplo n.º 11
0
Arquivo: lib.c Projeto: c10ud/CHDK
int vid_get_viewport_display_yoffset() {
    if (camera_info.state.mode_play) {
        return 0;
    }
    else {
        if(camera_info.state.mode_video || is_video_recording()) {
                return 0; //all video modes
        }
    } 
    return (vp_yo[shooting_get_prop(PROPCASE_ASPECT_RATIO)]);

}
Exemplo n.º 12
0
Arquivo: lib.c Projeto: c10ud/CHDK
// only X offset appears to be required, for 1:1
// buffer and display
int vid_get_viewport_xoffset()
{
    if (camera_info.state.mode_play)
    {
        return 0;
    }
    if (camera_info.state.mode_video || is_video_recording()) {
        return 0;
    }
    if(shooting_get_prop(PROPCASE_ASPECT_RATIO) == 3) { // 1:1 appears to use X offset
        return 44;
    }
    return 0;
}
Exemplo n.º 13
0
Arquivo: lib.c Projeto: c10ud/CHDK
long vid_get_viewport_height()
{

    int m = mode_get();
    int aspect_ratio=shooting_get_prop(PROPCASE_ASPECT_RATIO);

    if (MODE_IS_VIDEO(m) || is_video_recording())
        return 240;

    if ((m & MODE_MASK) != MODE_PLAY) 
    {
        // 0 = 4:3, 1 = 16:9, 2 = 3:2, 3 = 1:1
        if (aspect_ratio==1 || aspect_ratio==2)
            return 240;
    }
    extern int _GetVRAMVPixelsSize();    
    return ((m & MODE_MASK) == MODE_PLAY)?240:_GetVRAMVPixelsSize()>>1;
}
Exemplo n.º 14
0
int vid_get_viewport_display_yoffset()
{
    int m = mode_get();
    if ((m & MODE_MASK) == MODE_PLAY)
    {
        return 0;
    }
    else if ((m & MODE_SHOOTING_MASK) == MODE_STITCH)
    {
        return 72;
    }
    else if (/*mode_is_video(m)*/ movie_status == VIDEO_RECORD_IN_PROGRESS)
    {
        return 30;
    }
    else
    {
	    return vp_yo[shooting_get_prop(PROPCASE_ASPECT_RATIO)];
    }
}
Exemplo n.º 15
0
static int luaCB_get_prop( lua_State* L )
{
    lua_pushnumber( L, shooting_get_prop( luaL_checknumber( L, 1 ) ) );
    return 1;
}
Exemplo n.º 16
0
Arquivo: lib.c Projeto: c10ud/CHDK
int vid_get_viewport_yoffset() {
    int aspect_ratio=shooting_get_prop(PROPCASE_ASPECT_RATIO);

        return 0;
}
Exemplo n.º 17
0
static int luaCB_get_ev( lua_State* L )
{
    lua_pushnumber( L, shooting_get_prop(PROPCASE_EV_CORRECTION_1) );
    return 1;
}
Exemplo n.º 18
0
static int luaCB_get_orientation_sensor( lua_State* L )
{
    lua_pushnumber( L, shooting_get_prop(PROPCASE_ORIENTATION_SENSOR) );
    return 1;
}
Exemplo n.º 19
0
static int luaCB_get_IS_mode( lua_State* L )
{
    lua_pushnumber( L, shooting_get_prop(PROPCASE_IS_MODE) );
    return 1;
}
Exemplo n.º 20
0
static int luaCB_get_flash_ready( lua_State* L )
{
    lua_pushboolean( L, shooting_get_prop(PROPCASE_IS_FLASH_READY) );
    return 1;
}
Exemplo n.º 21
0
static int luaCB_get_shooting( lua_State* L )
{
    lua_pushboolean( L, shooting_get_prop(PROPCASE_SHOOTING) );
    return 1;
}
Exemplo n.º 22
0
long kbd_use_up_down_left_right_as_fast_switch() {
    static long key_pressed = 0; // ??? static masking a global
    int m=mode_get(); 
    int mode_video = MODE_IS_VIDEO(m) || (movie_status > 1);
    int ev_video=0;
    int jogdial;

#if CAM_EV_IN_VIDEO
    ev_video=get_ev_video_avail(); 
#endif

    if (!(kbd_is_key_pressed(KEY_UP)) && !(kbd_is_key_pressed(KEY_DOWN))) key_pressed = 0;

    if (canon_shoot_menu_active!=0 || (m&MODE_MASK) != MODE_REC)
        return 0;

#if !CAM_HAS_JOGDIAL
    if (kbd_is_key_pressed(KEY_UP) && ((m&MODE_SHOOTING_MASK) != MODE_M) && !mode_video) {
        if (conf.fast_ev && key_pressed == 0) {
            shooting_set_prop(PROPCASE_EV_CORRECTION_1,shooting_get_prop(PROPCASE_EV_CORRECTION_1)+(conf.fast_ev_step+1)*16);
            shooting_set_prop(PROPCASE_EV_CORRECTION_2,shooting_get_prop(PROPCASE_EV_CORRECTION_2)+(conf.fast_ev_step+1)*16);
            EnterToCompensationEVF();
            key_pressed = KEY_UP;
                
            return 1;
        }

    } 

    if (kbd_is_key_pressed(KEY_DOWN) && ((m&MODE_SHOOTING_MASK) != MODE_M) && !mode_video) {
        if (conf.fast_ev && key_pressed == 0) {
            kbd_key_release_all();
            shooting_set_prop(PROPCASE_EV_CORRECTION_1,shooting_get_prop(PROPCASE_EV_CORRECTION_1)-(conf.fast_ev_step+1)*16);
            shooting_set_prop(PROPCASE_EV_CORRECTION_2,shooting_get_prop(PROPCASE_EV_CORRECTION_2)-(conf.fast_ev_step+1)*16);
            key_pressed = KEY_DOWN;
            EnterToCompensationEVF();
            return 1;
        }
    } 

#else
    jogdial=get_jogdial_direction();

    if (conf.fast_ev &&kbd_is_key_pressed(KEY_SHOOT_HALF) && (jogdial==JOGDIAL_RIGHT) && ((m&MODE_SHOOTING_MASK) != MODE_M) && !mode_video) {
            shooting_set_prop(PROPCASE_EV_CORRECTION_1,shooting_get_prop(PROPCASE_EV_CORRECTION_1)+(conf.fast_ev_step+1)*16);
            shooting_set_prop(PROPCASE_EV_CORRECTION_2,shooting_get_prop(PROPCASE_EV_CORRECTION_2)+(conf.fast_ev_step+1)*16);
            EnterToCompensationEVF();
        }

    if (conf.fast_ev &&kbd_is_key_pressed(KEY_SHOOT_HALF) && (jogdial==JOGDIAL_LEFT) && ((m&MODE_SHOOTING_MASK) != MODE_M) && !mode_video) {
            shooting_set_prop(PROPCASE_EV_CORRECTION_1,shooting_get_prop(PROPCASE_EV_CORRECTION_1)-(conf.fast_ev_step+1)*16);
            shooting_set_prop(PROPCASE_EV_CORRECTION_2,shooting_get_prop(PROPCASE_EV_CORRECTION_2)-(conf.fast_ev_step+1)*16);
            EnterToCompensationEVF();
        }
     

#endif

    if (kbd_is_key_pressed(KEY_UP) && mode_video && movie_status == 4 ) {
        if (conf.fast_movie_quality_control && key_pressed == 0) {
            if (conf.video_mode==0) {
#if !CAM_VIDEO_QUALITY_ONLY
                conf.video_bitrate+=1;
                if (conf.video_bitrate>=VIDEO_BITRATE_STEPS)
                    conf.video_bitrate=VIDEO_BITRATE_STEPS-1;
                shooting_video_bitrate_change(conf.video_bitrate);
                movie_reset = 1;
#endif
            }    
            else if (conf.video_mode==1) {
                conf.video_quality+=1;
                if (conf.video_quality>VIDEO_MAX_QUALITY)
                    conf.video_quality=VIDEO_MAX_QUALITY;
                movie_reset = 1;
            }              
            key_pressed = KEY_UP;
            return 1;
        }
    } 
    
    if (kbd_is_key_pressed(KEY_DOWN) && mode_video && movie_status == 4) {
        if (conf.fast_movie_quality_control && key_pressed == 0) {
            if (conf.video_mode==0) {                
#if !CAM_VIDEO_QUALITY_ONLY
                conf.video_bitrate-=1;
                if (conf.video_bitrate<0)
                    conf.video_bitrate=0;

                shooting_video_bitrate_change(conf.video_bitrate);
                movie_reset = 1;
#endif
            }
            else if (conf.video_mode==1) {
                conf.video_quality-=1;
                if (conf.video_quality<1)
                    conf.video_quality=1;
                movie_reset = 1;
            }          
            key_pressed = KEY_DOWN;
            return 1;
        }
    } 
    
    if (kbd_is_key_pressed(KEY_LEFT) && mode_video && (movie_status == 4) && !ev_video) {
        if (conf.fast_movie_control && key_pressed == 0) {
            movie_status = VIDEO_RECORD_STOPPED;
            key_pressed = KEY_LEFT;
            return 1;
        }
    } 
	// reyalp - HACK for cams that can do video in any mode
	// note that this means this will probably run whenever you press right
    if (kbd_is_key_pressed(KEY_RIGHT) &&
#ifndef CAM_HAS_VIDEO_BUTTON 
            mode_video &&
#endif
	        (movie_status == 1) && !ev_video) {
        // BUG this doesn't know whether recording was stopped or paused.
        if (conf.fast_movie_control && key_pressed == 0) {
            movie_status = VIDEO_RECORD_IN_PROGRESS;
            movie_reset = 1;
            key_pressed = KEY_RIGHT;
            return 1;
        }
    } 

    return 0;
}