Check-in [b363d961f4]
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:b363d961f4377d8607f2fb968e2b64b85e07904a
User & Date: chw 2019-03-14 04:57:06
Context
2019-03-15
19:25
merge with trunk check-in: f85e9f06e9 user: chw tags: wtf-8-experiment
2019-03-14
04:57
merge with trunk check-in: b363d961f4 user: chw tags: wtf-8-experiment
04:55
more tear down tweaks for [64ef0979ba] and [f27d22789e] check-in: 222bf6cb1c user: chw tags: trunk
2019-03-13
09:27
merge with trunk check-in: 844ae85b75 user: chw tags: wtf-8-experiment
Changes

Changes to jni/SDL2/src/video/kmsdrm/SDL_kmsdrmvideo.c.

172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
...
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460


static void
KMSDRM_FBDestroyCallback(struct gbm_bo *bo, void *data)
{
    KMSDRM_FBInfo *fb_info = (KMSDRM_FBInfo *)data;

    if (fb_info && fb_info->drm_fd > 0 && fb_info->fb_id != 0) {
        KMSDRM_drmModeRmFB(fb_info->drm_fd, fb_info->fb_id);
        SDL_LogDebug(SDL_LOG_CATEGORY_VIDEO, "Delete DRM FB %u", fb_info->fb_id);
    }

    SDL_free(fb_info);
}

................................................................................
    SDL_LogDebug(SDL_LOG_CATEGORY_VIDEO, "KMSDRM_VideoQuit()");

    if (_this->gl_config.driver_loaded) {
        SDL_GL_UnloadLibrary();
    }

    if (vdata->saved_crtc != NULL) {
        if (vdata->drm_fd > 0 && vdata->saved_conn_id > 0) {
            /* Restore saved CRTC settings */
            drmModeCrtc *crtc = vdata->saved_crtc;
            if (KMSDRM_drmModeSetCrtc(vdata->drm_fd, crtc->crtc_id,
                                      crtc->buffer_id, crtc->x, crtc->y,
                                      &vdata->saved_conn_id, 1,
                                      &crtc->mode) != 0) {
                SDL_LogWarn(SDL_LOG_CATEGORY_VIDEO, "Could not restore original CRTC mode");







|







 







|







172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
...
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460


static void
KMSDRM_FBDestroyCallback(struct gbm_bo *bo, void *data)
{
    KMSDRM_FBInfo *fb_info = (KMSDRM_FBInfo *)data;

    if (fb_info && fb_info->drm_fd >= 0 && fb_info->fb_id != 0) {
        KMSDRM_drmModeRmFB(fb_info->drm_fd, fb_info->fb_id);
        SDL_LogDebug(SDL_LOG_CATEGORY_VIDEO, "Delete DRM FB %u", fb_info->fb_id);
    }

    SDL_free(fb_info);
}

................................................................................
    SDL_LogDebug(SDL_LOG_CATEGORY_VIDEO, "KMSDRM_VideoQuit()");

    if (_this->gl_config.driver_loaded) {
        SDL_GL_UnloadLibrary();
    }

    if (vdata->saved_crtc != NULL) {
        if (vdata->drm_fd >= 0 && vdata->saved_conn_id > 0) {
            /* Restore saved CRTC settings */
            drmModeCrtc *crtc = vdata->saved_crtc;
            if (KMSDRM_drmModeSetCrtc(vdata->drm_fd, crtc->crtc_id,
                                      crtc->buffer_id, crtc->x, crtc->y,
                                      &vdata->saved_conn_id, 1,
                                      &crtc->mode) != 0) {
                SDL_LogWarn(SDL_LOG_CATEGORY_VIDEO, "Could not restore original CRTC mode");

Changes to undroid/tkvlc/example/3ddemo.tcl.

28
29
30
31
32
33
34
35








36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56

    set openfile [tk_getOpenFile -filetypes $types -multiple 0]
    
    if {$openfile != ""} {
        tkvlc0 open $openfile
    }
}









.menubar.file add separator
.menubar.file add command -label "Exit" -command exit

if {[info command "sdltk"] eq "sdltk"} {
    wm attributes . -fullscreen 1
}

canvas3d .w1
pack .w1 -expand yes -fill both -side top
.w1 configure -width 300 -height 300 -background black

bind all <Break> exit
bind all <Key-q> exit
bind all <Escape> exit

# Mouse control
bind .w1 <B1-Motion> {
    set ry [expr 360.0 * (%y  - $::Y) / [%W cget -height]]
    set rx [expr 360.0 * (%x  - $::X) / [%W cget -width]]
    %W transform -camera type(light) [list orbitup $ry orbitleft $rx]
    set ::X %x








>
>
>
>
>
>
>
>

|









|
|
|







28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64

    set openfile [tk_getOpenFile -filetypes $types -multiple 0]
    
    if {$openfile != ""} {
        tkvlc0 open $openfile
    }
}

proc doexit {} {
    if {[tkvlc0 isplaying]} {
        tkvlc0 stop
    }
    tkvlc0 destroy
    exit
}

.menubar.file add separator
.menubar.file add command -label "Exit" -command doexit

if {[info command "sdltk"] eq "sdltk"} {
    wm attributes . -fullscreen 1
}

canvas3d .w1
pack .w1 -expand yes -fill both -side top
.w1 configure -width 300 -height 300 -background black

bind all <Break> doexit
bind all <Key-q> doexit
bind all <Escape> doexit

# Mouse control
bind .w1 <B1-Motion> {
    set ry [expr 360.0 * (%y  - $::Y) / [%W cget -height]]
    set rx [expr 360.0 * (%x  - $::X) / [%W cget -width]]
    %W transform -camera type(light) [list orbitup $ry orbitleft $rx]
    set ::X %x

Changes to undroid/tkvlc/generic/tkvlc.c.

345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
...
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
...
570
571
572
573
574
575
576



577
578
579
580
581
582
583
{
  libVLCEvent *e = (libVLCEvent *) ev;

  if (e->p != NULL) {
    libVLCData *p = e->p;
    libVLCEvent *this, *prev;

    /* remove event from event */
    this = p->ev_queue;
    prev = NULL;
    while (this != NULL) {
      if (this == e) {
	if (prev != NULL) {
	  prev->next = this->next;
	} else {
................................................................................
 */

static void *libVLClock(void *clientData, void **planes)
{
  libVLCData *p = (libVLCData *) clientData;
  int index = 0;

  if (!p->frames[index].busy) {
    ++index;
  }
  p->frames[index].busy = 1;
  planes[0] = p->frames[index].pixels;
  return &p->frames[index];
}

................................................................................

  if (p->exit_called) {
    return;
  }
  if ((f == &p->frames[0] && p->frames[1].busy) ||
      (f == &p->frames[1] && p->frames[0].busy)) {
    /* other frame buffer still in use, drop frame */



    return;
  }
  e = (libVLCEvent *) ckalloc(sizeof(*e));
  e->header.proc = libVLCready;
  e->header.nextPtr = NULL;
  e->type = EV_NEW_FRAME;
  e->f = f;







|







 







|







 







>
>
>







345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
...
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
...
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
{
  libVLCEvent *e = (libVLCEvent *) ev;

  if (e->p != NULL) {
    libVLCData *p = e->p;
    libVLCEvent *this, *prev;

    /* remove event from queue */
    this = p->ev_queue;
    prev = NULL;
    while (this != NULL) {
      if (this == e) {
	if (prev != NULL) {
	  prev->next = this->next;
	} else {
................................................................................
 */

static void *libVLClock(void *clientData, void **planes)
{
  libVLCData *p = (libVLCData *) clientData;
  int index = 0;

  if (p->frames[index].busy) {
    ++index;
  }
  p->frames[index].busy = 1;
  planes[0] = p->frames[index].pixels;
  return &p->frames[index];
}

................................................................................

  if (p->exit_called) {
    return;
  }
  if ((f == &p->frames[0] && p->frames[1].busy) ||
      (f == &p->frames[1] && p->frames[0].busy)) {
    /* other frame buffer still in use, drop frame */
    if (f->e == NULL) {
      f->busy = 0;
    }
    return;
  }
  e = (libVLCEvent *) ckalloc(sizeof(*e));
  e->header.proc = libVLCready;
  e->header.nextPtr = NULL;
  e->type = EV_NEW_FRAME;
  e->f = f;