summaryrefslogtreecommitdiffstats
path: root/video/out/vo_rpi.c
Commit message (Collapse)AuthorAgeFilesLines
* player: remove all rpi-specific codeDudemanguy2024-02-051-938/+0
| | | | | | | | | | | | | | | | | | | | | | vo_rpi and its related code has pretty much historically been a disaster in mpv. The build regularly gets broken and since nobody uses it, it takes months for anyone to notice. There was also that time where fullscreen was broken for about a year and a half. Also building in waf was entirely broken for about a couple of years or so due to mysterious reasons no one ever figured out (meson magically fixed it). Anyways, once again the build is broken due to rpi being forgotten about again, but instead of pretending to support this crap. Just drop it all. Nowadays, mmal hwdec is a relic since these devices are better off using the v4l2m2m ffmpeg fork instead which actually uses KMS properly. RPI 1 and 2 probably can't do this and will remain broken but oh well blame Broadcom for being special snowflakes and not using standard APIs (my rockpro worked out of the box; just saying). RPI 2 is nearly 10 years old anyways, so I think you can afford a new SBC by now. If we were nicer, there would be a deprecation period, but this is broken in the last major release anyway so too late. Closes #13402.
* csputils: replace mp_colorspace with pl_color_spaceKacper Michajłow2024-01-221-5/+5
|
* vo_gpu: don't pass ra_fbo by valueKacper Michajłow2023-11-281-1/+1
| | | | Make it easier on compiler, no need to alloca and copy things around.
* timer: remove unnecesary time conversionsKacper Michajłow2023-11-051-1/+1
|
* ALL: use new mp_thread abstractionKacper Michajłow2023-11-051-18/+18
|
* options: transition options from OPT_FLAG to OPT_BOOLChristoph Heinrich2023-02-211-4/+4
| | | | | | c78482045444c488bb7948305d583a55d17cd236 introduced a bool option type as a replacement for the flag type, but didn't actually transition and remove the flag type because it would have been too much mundane work.
* vo_rpi: fix DISPMANX_UPDATE_HANDLE_T leakHo Ming Shun2021-09-281-3/+4
| | | | | | | | | | | | | | | Fixes handle leak that happened whenever tvservice callback was invoked. Powering on the TV causes HDMI unplug and attached events to be sent to the tvservice callback. This meant you could only power on/off your TV a finite number of times before you were unable to allocate additional resources from VideoCore (usually resulting in a "Could not get DISPMANX objects." error). Furthermore because the VideoCore kernel driver does not cleanup handles when a process dies, the only way to recover from the leak was to reboot the RPI.
* vo_rpi: restore fullscreen handlingHo Ming Shun2021-08-131-0/+20
| | | | | | | Previous fullscreen handling code was removed in 59cdfe50b2 during deprecation of VOCTRL_FULLSCREEN. Lack of this code caused the OSD layer to be to be not resized along with the video layer when fullscreen is toggled.
* vo_rpi: fix argument nameDudemanguy2021-06-081-2/+2
| | | | This is data not arg.
* command: add display-width/display-height propertyDudemanguy2021-05-061-0/+4
| | | | | | | | | For some reason, this never existed before. Add VOCTRL_GET_DISPLAY_RES and use it to obtain the current display's resolution from each vo/windowing backend if applicable. Users can then access the current display resolution as display-width and display-height as per the client api. Note that macOS/cocoa was not attempted in this commit since the author has no clue how to write swift.
* rpi: use "brcm" variant of libGLESv2Jan Palus2020-04-231-1/+1
|
* options: change option macros and all option declarationswm42020-03-181-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change all OPT_* macros such that they don't define the entire m_option initializer, and instead expand only to a part of it, which sets certain fields. This requires changing almost every option declaration, because they all use these macros. A declaration now always starts with {"name", ... followed by designated initializers only (possibly wrapped in macros). The OPT_* macros now initialize the .offset and .type fields only, sometimes also .priv and others. I think this change makes the option macros less tricky. The old code had to stuff everything into macro arguments (and attempted to allow setting arbitrary fields by letting the user pass designated initializers in the vararg parts). Some of this was made messy due to C99 and C11 not allowing 0-sized varargs with ',' removal. It's also possible that this change is pointless, other than cosmetic preferences. Not too happy about some things. For example, the OPT_CHOICE() indentation I applied looks a bit ugly. Much of this change was done with regex search&replace, but some places required manual editing. In particular, code in "obscure" areas (which I didn't include in compilation) might be broken now. In wayland_common.c the author of some option declarations confused the flags parameter with the default value (though the default value was also properly set below). I fixed this with this change.
* rpi: destroy fullscreen change handlingwm42019-12-111-5/+0
| | | | | | | | | Get rid of the legacy VOCTRL (which will be removed later). I'm not sure what exactly fullscreen was supposed to do (toggling between using the entire display, and what --geometry forced?), but I don't care, just get rid of the VOCTRL. PRs to fix regressions caused by this will be accepted, but personally I don't care since this is excessively fringe and obscure.
* vo_gpu: add internal ability to skip osd/subs for renderingwm42018-02-111-1/+1
| | | | Needed for the following commit.
* vo_rpi: fix build (probably)wm42017-10-171-1/+1
| | | | Untested. If it works, fixes #4919.
* vo_opengl: refactor into vo_gpuNiklas Haas2017-09-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is done in several steps: 1. refactor MPGLContext -> struct ra_ctx 2. move GL-specific stuff in vo_opengl into opengl/context.c 3. generalize context creation to support other APIs, and add --gpu-api 4. rename all of the --opengl- options that are no longer opengl-specific 5. move all of the stuff from opengl/* that isn't GL-specific into gpu/ (note: opengl/gl_utils.h became opengl/utils.h) 6. rename vo_opengl to vo_gpu 7. to handle window screenshots, the short-term approach was to just add it to ra_swchain_fns. Long term (and for vulkan) this has to be moved to ra itself (and vo_gpu altered to compensate), but this was a stop-gap measure to prevent this commit from getting too big 8. move ra->fns->flush to ra_gl_ctx instead 9. some other minor changes that I've probably already forgotten Note: This is one half of a major refactor, the other half of which is provided by rossy's following commit. This commit enables support for all linux platforms, while his version enables support for all non-linux platforms. Note 2: vo_opengl_cb.c also re-uses ra_gl_ctx so it benefits from the --opengl- options like --opengl-early-flush, --opengl-finish etc. Should be a strict superset of the old functionality. Disclaimer: Since I have no way of compiling mpv on all platforms, some of these ports were done blindly. Specifically, the blind ports included context_mali_fbdev.c and context_rpi.c. Since they're both based on egl_helpers, the port should have gone smoothly without any major changes required. But if somebody complains about a compile error on those platforms (assuming anybody actually uses them), you know where to complain.
* vo_rpi: fix operationwm42017-08-151-3/+10
| | | | Commit 697c4389a9e6 worked "almost". I couldn't test it at the time.
* rpi: fix buildwm42017-08-111-47/+24
| | | | | | | | | | | Runtime untested, because I get this: [vo/rpi] Could not get DISPMANX objects. This happened even when building older git versions, and on a RPI image that hasn't changed in the recent years. I don't know how to make this POS work again, so I guess if there's a bug in the new code, it will remain broken.
* vo_rpi: partially undeprecatewm42016-12-081-3/+0
| | | | Using vo_opengl + MMAL overlay didn't quite work out.
* options: remove deprecated sub-option handling for --vo and --aowm42016-11-251-1/+1
| | | | | | | | Long planned. Leads to some sanity. There still are some rather gross things. Especially g_groups is ugly, and a hack that can hopefully be removed. (There is a plan for it, but whether it's implemented depends on how much energy is left.)
* vo_opengl: require explicit reset on shader cache after renderingwm42016-09-141-1/+2
| | | | | | | | | The caller now has to call gl_sc_reset(), and _after_ rendering. This way we can unset OpenGL state that was setup for rendering. This affects the shader program, for example. The next commit uses this to automatically manage texture units via the shader cache. vo_rpi.c changes untested.
* vo_rpi, vo_opengl: separate RPI/EGL-specific code for both VOswm42016-09-131-1/+129
| | | | | | | | | This used to be shared, but since vo_rpi is going to be removed, untangle them. There was barely any actual code shared since the recent changes anyway. As a subtle change, we also stop opening libGLESv2.so explicitly in the vo_opengl backend, and use RTLD_DEFAULT instead.
* vo_rpi: deprecate this VOwm42016-09-121-0/+3
|
* vo: remove unused VOCTRL_GET_PANSCANwm42016-09-081-2/+0
| | | | | | It was used to determine whether the VO supports VOCTRL_SET_PANSCAN. With all those changes to property semantics this became unnecessary, and its only use was dropped at some point.
* options: deprecate suboptions for the remaining AO/VOswm42016-09-051-0/+1
|
* vo: change messy handling of fullscreen and other flagswm42016-08-301-1/+0
| | | | | | | | | | | | | | Before this commit, all VOs had to toggle the option flag themselves, now command.c does it. I can't really comprehend why it required every VO to do this manually. Maybe it was for rejecting the property/option change if the VO didn't support a specific capability. But then it could have checked the VOCTRL result. In any case, I don't care, and successfully changing the property without doing anything (With some VOs) is fine too. Many things work this way now, and it's simpler overall. This change will be useful for cleaning up VO option handling.
* mp_image: split colorimetry metadata into its own structNiklas Haas2016-07-031-1/+1
| | | | | | | | | | | | | | | | | | This has two reasons: 1. I tend to add new fields to this metadata, and every time I've done so I've consistently forgotten to update all of the dozens of places in which this colorimetry metadata might end up getting used. While most usages don't really care about most of the metadata, sometimes the intend was simply to “copy” the colorimetry metadata from one struct to another. With this being inside a substruct, those lines of code can now simply read a.color = b.color without having to care about added or removed fields. 2. It makes the type definitions nicer for upcoming refactors. In going through all of the usages, I also expanded a few where I felt that omitting the “young” fields was a bug.
* vo_rpi: fix destroying overlaysGusar3212016-06-131-0/+3
| | | | | | | Commit 74e3d11 resulted in the background overlay not getting destroyed when mpv quits. Add back a piece of code that was removed in that commit to restore correct functionality. Fixes issue #3100
* vo_rpi: rename mutex/cond variableswm42016-04-261-17/+17
| | | | They're now used for the TV callback too, not just vsync.
* vo_rpi: wait for vsync with a timeoutwm42016-04-261-2/+6
| | | | | | Sucks, but better than freezing forever given the (to me) unpredictable RPI behavior. This will be good enough to drop out of vsync timing mode, or to abort playback.
* vo_rpi: attempt to survive display mode changeswm42016-04-261-38/+90
| | | | | | | | | | | | Recreate all dispmanx objects after mode changes signalled by the TV callback. This is needed since dispmanx objects are marked as invalid and cease working. One important point is that the vsync callbacks will stop coming when this happens, so restoring the callback is important. Note that the MMAL renderer itself does not get trashed by the firmware on such events, but we completely reconfigure it anyway when it happens.
* vp_rpi: fix indentationwm42016-04-261-10/+8
| | | | | This also moves the p->background check into the top if (the code effectively didn't do anything when this false).
* mp_image: allow passing NULL to mp_image_new_custom_ref()wm42016-04-251-2/+1
| | | | | | | A minor simplification. Most callers don't need this, and there's no good reason why the caller should provide an "initializer" like this. (This function calls mp_image_new_dummy_ref(), which has no reason for an initializer either.)
* vo_opengl, vo_rpi: unbreak a few thingswm42016-02-241-2/+2
| | | | | Commit 2f562825 didn't remove the "color" declaration for these. Since the shader header already declares it, shader compilation broke.
* vo_rpi: add geometry handlingUros Vampl2016-02-051-10/+59
| | | | | | This makes it possible to set video size and position using the --geometry and/or --autofit options. It's also possible to switch between fullscreen/non-fullscreen playback during runtime.
* Relicense some non-MPlayer source files to LGPL 2.1 or laterwm42016-01-191-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This covers source files which were added in mplayer2 and mpv times only, and where all code is covered by LGPL relicensing agreements. There are probably more files to which this applies, but I'm being conservative here. A file named ao_sdl.c exists in MPlayer too, but the mpv one is a complete rewrite, and was added some time after the original ao_sdl.c was removed. The same applies to vo_sdl.c, for which the SDL2 API is radically different in addition (MPlayer supports SDL 1.2 only). common.c contains only code written by me. But common.h is a strange case: although it originally was named mp_common.h and exists in MPlayer too, by now it contains only definitions written by uau and me. The exceptions are the CONTROL_ defines - thus not changing the license of common.h yet. codec_tags.c contained once large tables generated from MPlayer's codecs.conf, but all of these tables were removed. From demux_playlist.c I'm removing a code fragment from someone who was not asked; this probably could be done later (see commit 15dccc37). misc.c is a bit complicated to reason about (it was split off mplayer.c and thus contains random functions out of this file), but actually all functions have been added post-MPlayer. Except get_relative_time(), which was written by uau, but looks similar to 3 different versions of something similar in each of the Unix/win32/OSX timer source files. I'm not sure what that means in regards to copyright, so I've just moved it into another still-GPL source file for now. screenshot.c once had some minor parts of MPlayer's vf_screenshot.c, but they're all gone.
* vo_rpi: handle rotationwm42016-01-051-1/+14
| | | | | Since the MMAL video renderer component supports exactly what we need, it's pretty simple.
* vo_rpi: work around firmware oddness leading to incorrect video rectwm42016-01-051-2/+4
| | | | | | | | | | | Apparently, the firmware will ignore pixel_x/pixel_y if the numeric value of them gets too high (even if they indicate square pixel aspect ratio). Even worse, the destination rectangle is ignored completely, and the video frame is simply stretched to the screen. I suspect this is an overflow or weird sanity check within the firmware. Work it around by limiting the fields to 16000, which is an arbitrary but apparently working limit.
* vo_rpi: fix previous commitwm42015-12-261-1/+1
| | | | Meh. Fixes #2639.
* vo_rpi: fix compilationwm42015-12-261-5/+1
| | | | | | | | | Untested, but should be fine. Broken by commit 0a0bb905. Also fix the include statement in context_rpi.c, which caused another compilation failure. Also untested. (Because I'm lazy.) Fixes #2638.
* vo_opengl: prefix per-backend source files with context_wm42015-12-191-1/+1
|
* vo_rpi: set aspect ratiowm42015-11-251-5/+8
| | | | | Otherwise, the MMAL output component will letter-box the video within the specified dest_rect while keeping square pixels.
* vo_rpi: log subtitle render timewm42015-11-251-0/+4
|
* vo_rpi: add an option to disable OSDwm42015-11-251-19/+25
| | | | | | The OSD takes up an entire fullscreen dispmanx layer. Although the GPU should be able to handle it (possibly even without any disadvantages), it'll still be useful for debugging performance issues.
* video/out: remove an unused parameterwm42015-10-031-1/+1
| | | | | | | | | | | This parameter has been unused for years (the last flag was removed in commit d658b115). Get rid of it. This affects the general VO API, as well as the vo_opengl backend API, so it touches a lot of files. The VOFLAGs are still used to control OpenGL context creation, so move them to the OpenGL backend code.
* vo_opengl: move shader file caching to video.cwm42015-09-231-1/+1
| | | | | | It's just about loading and cachign small files, not does not necessarily have anything to do with shaders. Move it to video.c where it's used.
* vo_rpi: fix compilationwm42015-09-111-2/+2
| | | | The recent OpenGL refactor commits forgot to update this file.
* vo_rpi: disable background by defaultwm42015-08-201-6/+13
| | | | And add an option to enable it.
* vo_rpi: use correct variable for osd layerwm42015-08-201-1/+1
| | | | | This is a cosmetic change, because the value is exactly the same. (The old code just duplicates the logic, sort of.)
* vo_rpi: fix blackscreen before the first subtitle/OSD is renderedwm42015-08-201-0/+1
| | | | | The OSD overlay wasn't initialized, so it remained solid black until the first time a subtitle line or an OSD element became visible.
* vo_rpi: redraw subtitles only on changewm42015-08-181-4/+15
| | | | | | | | | | | Since vo_rpi uses MMAL for video output, which is completely independent from the GLES overlay, we can just not redraw the GLES screen if subtitles do not change. (As a furhter optimization, the dispmanx overlay could be removed if nothing is visible. But I'm not sure if adding and removing the overlay frequently is a good idea for performance, so this could just as well go the other way.)
* vo_rpi: use EGL to render subtitleswm42015-08-181-124/+82
| | | | | | | | Slightly faster than using the dispmanx mess (perhaps to a large amount due to the rather stupid C-only unoptimized ASS->RGBA blending code). Do this by reusing vo_opengl's subtitle renderer, and vo_opengl's RPI backend.
* vo_rpi: fix NULL pointer derefwm42015-08-141-1/+1
| | | | Can happen in obscure situations and with hw decoding disabled.
* vo_rpi: simplify background handlingwm42015-08-131-19/+1
| | | | Apparently this is sufficient.
* vo_rpi: unregister vsync callbackwm42015-08-131-1/+3
| | | | Small bug, much pain.
* vo_rpi: skip OSD rendering when repeating frameswm42015-08-131-4/+8
| | | | It's unnecessary and slow. Doesn't help too much, though.
* vo_rpi: support display syncwm42015-08-101-4/+51
| | | | | | | | This VO is special because it normally doesn't block on vsync, but can be made to do so. Supposedly the MMAL video output API merely sets a "current frame" field when sending an output frame, and the firmware will pick up whatever frame that field is set to at the time of a vsync.
* vo_rpi: determine and return display refresh ratewm42015-07-271-0/+24
| | | | Reverse engineered from tvservice.c.
* vo_rpi: update renderer size on display size changes toowm42015-05-011-0/+2
| | | | | | | | (Not sure why it worked without this when I tested the previous changes.) Untested, but should be fine. This is equivalent what is done on e.g. panscan changes.
* vo_rpi: update display size on display mode switcheswm42015-04-301-0/+23
|
* vo_rpi: actually draw a black backgroundwm42015-04-301-23/+65
| | | | | | | | Also factor the display size initialization into a separate function. For some reason this seems to work, although setting the background color using this 1x1 pixel bitmap does not work. I blame the RPI beign a terrible piece of hardware with even worse drivers.
* vo_rpi: explicitly reference MMAL VC driverwm42015-04-131-0/+8
| | | | | | | This is optional, but ensures that linking with -Wl,--as-needed does not drop the MMAL VC driver. The driver normally "reg