Check-in [d58b116c55]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:merge with trunk
Timelines: family | ancestors | descendants | both | wtf-8-experiment
Files: files | file ages | folders
SHA1: d58b116c5562ec05b051a8570b95acd82be25a41
User & Date: chw 2019-06-18 09:08:53
Context
2019-06-18
18:28
merge with trunk check-in: 208b46aad8 user: chw tags: wtf-8-experiment
09:08
merge with trunk check-in: d58b116c55 user: chw tags: wtf-8-experiment
09:07
fixes in tclwmf check-in: c3eab332c4 user: chw tags: trunk
05:54
merge with trunk check-in: 959e085353 user: chw tags: wtf-8-experiment
Changes

Changes to undroid/tclwmf/tclwmf.c.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
....
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
....
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
....
3515
3516
3517
3518
3519
3520
3521
3522

3523
3524
3525
3526
3527
3528
3529
3530
....
3612
3613
3614
3615
3616
3617
3618

3619
3620
3621
3622
3623
3624
3625
....
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679

3680
3681
3682
3683
3684
3685
3686
/*
 * tclwmf.c --
 *
 *      This file contains the implementation of the "wmf" Tcl
 *      built-in command which allows to operate cameras using
 *      the Windows Media Foundation.
 *
 * Copyright (c) 2016-2018 Christian Werner <chw at ch minus werner dot de>
 *
 * See the file "license.terms" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 */

#ifndef _WIN32
#error "unsupported platform"
................................................................................
	    return TCL_ERROR;
	}
	hPtr = Tcl_FindHashEntry(&wmfi->wmfc, Tcl_GetString(objv[2]));
	if (hPtr == NULL) {
devNotFound:
	    Tcl_SetObjResult(interp, Tcl_ObjPrintf("device \"%s\" not found",
			Tcl_GetString(objv[2])));
	    ret = TCL_ERROR;
	}
	wmfc = (WMFC *) Tcl_GetHashValue(hPtr);
	Tcl_DeleteHashEntry(hPtr);
	StopCapture(wmfc, 1);
	FinishRecording(wmfc);
	InitControls(wmfc, 1);
	if (wmfc->srcReader != NULL) {
................................................................................
	    }
	} else {
	    Tcl_SetObjResult(interp, Tcl_NewIntObj(wmfc->rotate));
	}
	break;
    }

    case CMD_parameters:
	if ((objc < 3) || (objc % 2 == 0)) {
	    Tcl_WrongNumArgs(interp, 2, objv, "devid ?key value ...?");
	    return TCL_ERROR;
	}
	hPtr = Tcl_FindHashEntry(&wmfi->wmfc, Tcl_GetString(objv[2]));
	if (hPtr == NULL) {
	    goto devNotFound;
................................................................................
	    if (objc > 3) {
		SetControls(wmfc, objc - 3, objv + 3);
	    }
	    GetControls(wmfc, list);
	    Tcl_SetObjResult(interp, list);
	}
	break;


    case CMD_record:
	if (objc < 4) {
	    Tcl_WrongNumArgs(interp, 2, objv, "devid cmd ...");
	    return TCL_ERROR;
	}
	hPtr = Tcl_FindHashEntry(&wmfi->wmfc, Tcl_GetString(objv[2]));
	if (hPtr != NULL) {
	    wmfc = (WMFC *) Tcl_GetHashValue(hPtr);
................................................................................
	    if (wmfc->rstate > REC_STOP) {
		wmfc->rstate = REC_STOP;
	    }
	    FinishRecording(wmfc);
	    break;
	}
	break;


    case CMD_start: {
	if (objc != 3) {
	    Tcl_WrongNumArgs(interp, 2, objv, "devid");
	    return TCL_ERROR;
	}
	hPtr = Tcl_FindHashEntry(&wmfi->wmfc, Tcl_GetString(objv[2]));
................................................................................
	    goto devNotFound;
	}
	wmfc = (WMFC *) Tcl_GetHashValue(hPtr);
	StopCapture(wmfc, 0);
	break;
    }

    case CMD_tophoto:
	if (DataToPhoto(wmfi, interp, objc, objv) != TCL_OK) {
	    return TCL_ERROR;
	}
	break;


    }

    return ret;
}
 
/*







|







 







|







 







|







 







|
>
|







 







>







 







|




>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
....
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
....
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
....
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
....
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
....
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
/*
 * tclwmf.c --
 *
 *      This file contains the implementation of the "wmf" Tcl
 *      built-in command which allows to operate cameras using
 *      the Windows Media Foundation.
 *
 * Copyright (c) 2016-2019 Christian Werner <chw at ch minus werner dot de>
 *
 * See the file "license.terms" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 */

#ifndef _WIN32
#error "unsupported platform"
................................................................................
	    return TCL_ERROR;
	}
	hPtr = Tcl_FindHashEntry(&wmfi->wmfc, Tcl_GetString(objv[2]));
	if (hPtr == NULL) {
devNotFound:
	    Tcl_SetObjResult(interp, Tcl_ObjPrintf("device \"%s\" not found",
			Tcl_GetString(objv[2])));
	    return TCL_ERROR;
	}
	wmfc = (WMFC *) Tcl_GetHashValue(hPtr);
	Tcl_DeleteHashEntry(hPtr);
	StopCapture(wmfc, 1);
	FinishRecording(wmfc);
	InitControls(wmfc, 1);
	if (wmfc->srcReader != NULL) {
................................................................................
	    }
	} else {
	    Tcl_SetObjResult(interp, Tcl_NewIntObj(wmfc->rotate));
	}
	break;
    }

    case CMD_parameters: {
	if ((objc < 3) || (objc % 2 == 0)) {
	    Tcl_WrongNumArgs(interp, 2, objv, "devid ?key value ...?");
	    return TCL_ERROR;
	}
	hPtr = Tcl_FindHashEntry(&wmfi->wmfc, Tcl_GetString(objv[2]));
	if (hPtr == NULL) {
	    goto devNotFound;
................................................................................
	    if (objc > 3) {
		SetControls(wmfc, objc - 3, objv + 3);
	    }
	    GetControls(wmfc, list);
	    Tcl_SetObjResult(interp, list);
	}
	break;
    }

    case CMD_record: {
	if (objc < 4) {
	    Tcl_WrongNumArgs(interp, 2, objv, "devid cmd ...");
	    return TCL_ERROR;
	}
	hPtr = Tcl_FindHashEntry(&wmfi->wmfc, Tcl_GetString(objv[2]));
	if (hPtr != NULL) {
	    wmfc = (WMFC *) Tcl_GetHashValue(hPtr);
................................................................................
	    if (wmfc->rstate > REC_STOP) {
		wmfc->rstate = REC_STOP;
	    }
	    FinishRecording(wmfc);
	    break;
	}
	break;
    }

    case CMD_start: {
	if (objc != 3) {
	    Tcl_WrongNumArgs(interp, 2, objv, "devid");
	    return TCL_ERROR;
	}
	hPtr = Tcl_FindHashEntry(&wmfi->wmfc, Tcl_GetString(objv[2]));
................................................................................
	    goto devNotFound;
	}
	wmfc = (WMFC *) Tcl_GetHashValue(hPtr);
	StopCapture(wmfc, 0);
	break;
    }

    case CMD_tophoto: {
	if (DataToPhoto(wmfi, interp, objc, objv) != TCL_OK) {
	    return TCL_ERROR;
	}
	break;
    }

    }

    return ret;
}
 
/*