1
0
mirror of https://github.com/mpv-player/mpv synced 2025-03-24 12:22:25 +00:00

rpi: Update for modern systems

This commit is contained in:
Cameron Cawley 2019-07-14 14:56:10 +01:00 committed by wm4
parent a46f83e982
commit db09d77e46
5 changed files with 14 additions and 25 deletions

View File

@ -72,7 +72,7 @@ const struct ra_hwdec_driver *const ra_hwdec_drivers[] = {
#if HAVE_VDPAU_GL_X11 #if HAVE_VDPAU_GL_X11
&ra_hwdec_vdpau, &ra_hwdec_vdpau,
#endif #endif
#if HAVE_RPI #if HAVE_RPI_MMAL
&ra_hwdec_rpi_overlay, &ra_hwdec_rpi_overlay,
#endif #endif
#if HAVE_DRMPRIME && HAVE_DRM #if HAVE_DRMPRIME && HAVE_DRM

View File

@ -139,7 +139,7 @@ static bool recreate_dispmanx(struct ra_ctx *ctx)
VC_RECT_T dst = {.x = p->x, .y = p->y, .width = p->w, .height = p->h}; VC_RECT_T dst = {.x = p->x, .y = p->y, .width = p->w, .height = p->h};
VC_RECT_T src = {.width = p->w << 16, .height = p->h << 16}; VC_RECT_T src = {.width = p->w << 16, .height = p->h << 16};
VC_DISPMANX_ALPHA_T alpha = { VC_DISPMANX_ALPHA_T alpha = {
.flags = DISPMANX_FLAGS_ALPHA_FROM_SOURCE, .flags = DISPMANX_FLAGS_ALPHA_FIXED_ALL_PIXELS,
.opacity = 0xFF, .opacity = 0xFF,
}; };
p->window = vc_dispmanx_element_add(p->update, p->display, layer, &dst, 0, p->window = vc_dispmanx_element_add(p->update, p->display, layer, &dst, 0,
@ -234,7 +234,7 @@ static bool rpi_init(struct ra_ctx *ctx)
if (!mpegl_create_context(ctx, p->egl_display, &p->egl_context, &p->egl_config)) if (!mpegl_create_context(ctx, p->egl_display, &p->egl_context, &p->egl_config))
goto fail; goto fail;
if (recreate_dispmanx(ctx) < 0) if (!recreate_dispmanx(ctx))
goto fail; goto fail;
mpegl_load_functions(&p->gl, ctx->log); mpegl_load_functions(&p->gl, ctx->log);

View File

@ -68,9 +68,6 @@ const struct vo_driver *const video_out_drivers[] =
&video_out_libmpv, &video_out_libmpv,
#if HAVE_ANDROID #if HAVE_ANDROID
&video_out_mediacodec_embed, &video_out_mediacodec_embed,
#endif
#if HAVE_RPI
&video_out_rpi,
#endif #endif
&video_out_gpu, &video_out_gpu,
#if HAVE_VDPAU #if HAVE_VDPAU
@ -100,6 +97,9 @@ const struct vo_driver *const video_out_drivers[] =
#endif #endif
#if HAVE_DRM #if HAVE_DRM
&video_out_drm, &video_out_drm,
#endif
#if HAVE_RPI_MMAL
&video_out_rpi,
#endif #endif
&video_out_lavc, &video_out_lavc,
NULL NULL

23
wscript
View File

@ -763,25 +763,9 @@ video_output_features = [
'deps': 'win32-desktop && shaderc && spirv-cross', 'deps': 'win32-desktop && shaderc && spirv-cross',
'func': check_cc(header_name=['d3d11_1.h', 'dxgi1_2.h']), 'func': check_cc(header_name=['d3d11_1.h', 'dxgi1_2.h']),
}, { }, {
# We need MMAL/bcm_host/dispmanx APIs. Also, most RPI distros require
# every project to hardcode the paths to the include directories. Also,
# these headers are so broken that they spam tons of warnings by merely
# including them (compensate with -isystem and -fgnu89-inline).
'name': '--rpi', 'name': '--rpi',
'desc': 'Raspberry Pi support', 'desc': 'Raspberry Pi support',
'func': compose_checks( 'func': check_pkg_config('brcmegl'),
check_cc(cflags=["-isystem/opt/vc/include",
"-isystem/opt/vc/include/interface/vcos/pthreads",
"-isystem/opt/vc/include/interface/vmcs_host/linux",
"-fgnu89-inline"],
linkflags="-L/opt/vc/lib",
header_name="bcm_host.h",
lib=['mmal_core', 'mmal_util', 'mmal_vc_client', 'bcm_host']),
# We still need all OpenGL symbols, because the vo_gpu code is
# generic and supports anything from GLES2/OpenGL 2.1 to OpenGL 4 core.
check_cc(lib="EGL", linkflags="-lGLESv2"),
check_cc(lib="GLESv2"),
),
} , { } , {
'name': '--ios-gl', 'name': '--ios-gl',
'desc': 'iOS OpenGL ES hardware decoding interop support', 'desc': 'iOS OpenGL ES hardware decoding interop support',
@ -861,6 +845,11 @@ hwaccel_features = [
'desc': 'CUDA hwaccel', 'desc': 'CUDA hwaccel',
'deps': '(gl || vulkan) && ffnvcodec', 'deps': '(gl || vulkan) && ffnvcodec',
'func': check_true, 'func': check_true,
}, {
'name': '--rpi-mmal',
'desc': 'Raspberry Pi MMAL hwaccel',
'deps': 'rpi',
'func': check_pkg_config('mmal'),
} }
] ]

View File

@ -463,7 +463,7 @@ def build(ctx):
( "video/out/opengl/hwdec_dxva2gldx.c", "gl-dxinterop-d3d9" ), ( "video/out/opengl/hwdec_dxva2gldx.c", "gl-dxinterop-d3d9" ),
( "video/out/opengl/hwdec_ios.m", "ios-gl" ), ( "video/out/opengl/hwdec_ios.m", "ios-gl" ),
( "video/out/opengl/hwdec_osx.c", "videotoolbox-gl" ), ( "video/out/opengl/hwdec_osx.c", "videotoolbox-gl" ),
( "video/out/opengl/hwdec_rpi.c", "rpi" ), ( "video/out/opengl/hwdec_rpi.c", "rpi-mmal" ),
( "video/out/opengl/hwdec_vdpau.c", "vdpau-gl-x11" ), ( "video/out/opengl/hwdec_vdpau.c", "vdpau-gl-x11" ),
( "video/out/opengl/libmpv_gl.c", "gl" ), ( "video/out/opengl/libmpv_gl.c", "gl" ),
( "video/out/opengl/oml_sync.c", "egl-x11 || gl-x11" ), ( "video/out/opengl/oml_sync.c", "egl-x11 || gl-x11" ),
@ -479,7 +479,7 @@ def build(ctx):
( "video/out/vo_libmpv.c" ), ( "video/out/vo_libmpv.c" ),
( "video/out/vo_mediacodec_embed.c", "android" ), ( "video/out/vo_mediacodec_embed.c", "android" ),
( "video/out/vo_null.c" ), ( "video/out/vo_null.c" ),
( "video/out/vo_rpi.c", "rpi" ), ( "video/out/vo_rpi.c", "rpi-mmal" ),
( "video/out/vo_sdl.c", "sdl2" ), ( "video/out/vo_sdl.c", "sdl2" ),
( "video/out/vo_tct.c" ), ( "video/out/vo_tct.c" ),
( "video/out/vo_vaapi.c", "vaapi-x11 && gpl" ), ( "video/out/vo_vaapi.c", "vaapi-x11 && gpl" ),