Check-in [d54e53b155]
Not logged in

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

Overview
Comment:adjust screen width in jsmpeg driver to next multiple of 16
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: d54e53b155bcf5fdb9d35aa6067c51487345d6de
User & Date: chw 2019-03-21 04:49:34
Context
2019-03-22
05:53
add selected tk upstream changes check-in: 955f7ffd47 user: chw tags: trunk
2019-03-21
04:50
merge with trunk check-in: 93cbe371fe user: chw tags: wtf-8-experiment
04:49
adjust screen width in jsmpeg driver to next multiple of 16 check-in: d54e53b155 user: chw tags: trunk
2019-03-20
17:48
add support for loop devices in v4l2 extension check-in: 901db50fcb user: chw tags: trunk
Changes

Changes to jni/SDL2/src/video/jsmpeg/SDL_jsmpeg.c.

1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071







1072
1073
1074
1075
1076
1077
1078
}

static int
JSMPEG_CreateWindowFramebuffer(_THIS, SDL_Window *window, Uint32 *format, void **pixels, int *pitch)
{
    SDL_WindowData *data;
    const Uint32 surface_format = SDL_PIXELFORMAT_BGR888;
    int w, h, bpp, frame_size;
    Uint32 Rmask, Gmask, Bmask, Amask;
    const char *env;
    struct lws_context_creation_info info;
    AVRational q;
    enum AVPixelFormat fmt_yuv, fmt_rgb;

    /* Free the old framebuffer surface and related data */
    data = (SDL_WindowData *) window->driverdata;
    JSMPEG_CleanupWindowData(data);

    /* Create a new one */
    SDL_PixelFormatEnumToMasks(surface_format, &bpp, &Rmask, &Gmask, &Bmask, &Amask);
    SDL_GetWindowSize(window, &w, &h);








    data->surface = SDL_CreateRGBSurface(0, w, h, bpp, Rmask, Gmask, Bmask, Amask);
    if (data->surface == NULL) {
        return -1;
    }

    data->codec = avcodec_find_encoder(AV_CODEC_ID_MPEG1VIDEO);







|













>
>
>
>
>
>
>







1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
}

static int
JSMPEG_CreateWindowFramebuffer(_THIS, SDL_Window *window, Uint32 *format, void **pixels, int *pitch)
{
    SDL_WindowData *data;
    const Uint32 surface_format = SDL_PIXELFORMAT_BGR888;
    int w0, w, h, bpp, frame_size;
    Uint32 Rmask, Gmask, Bmask, Amask;
    const char *env;
    struct lws_context_creation_info info;
    AVRational q;
    enum AVPixelFormat fmt_yuv, fmt_rgb;

    /* Free the old framebuffer surface and related data */
    data = (SDL_WindowData *) window->driverdata;
    JSMPEG_CleanupWindowData(data);

    /* Create a new one */
    SDL_PixelFormatEnumToMasks(surface_format, &bpp, &Rmask, &Gmask, &Bmask, &Amask);
    SDL_GetWindowSize(window, &w, &h);

    /* Adjust width to next multiple of 16 */
    w0 = (w + 15) & ~15;
    if (w0 != w) {
        w = w0;
        SDL_SetWindowSize(window, w, h);
    }

    data->surface = SDL_CreateRGBSurface(0, w, h, bpp, Rmask, Gmask, Bmask, Amask);
    if (data->surface == NULL) {
        return -1;
    }

    data->codec = avcodec_find_encoder(AV_CODEC_ID_MPEG1VIDEO);