aboutsummaryrefslogtreecommitdiffhomepage
path: root/video/out/vo_rpi.c
Commit message (Collapse)AuthorAge
* vo_gpu: add internal ability to skip osd/subs for renderingGravatar wm42018-02-11
| | | | Needed for the following commit.
* vo_rpi: fix build (probably)Gravatar wm42017-10-17
| | | | Untested. If it works, fixes #4919.
* vo_opengl: refactor into vo_gpuGravatar Niklas Haas2017-09-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 operationGravatar wm42017-08-15
| | | | Commit 697c4389a9e6 worked "almost". I couldn't test it at the time.
* rpi: fix buildGravatar wm42017-08-11
| | | | | | | | | | | 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 undeprecateGravatar wm42016-12-08
| | | | Using vo_opengl + MMAL overlay didn't quite work out.
* options: remove deprecated sub-option handling for --vo and --aoGravatar wm42016-11-25
| | | | | | | | 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 renderingGravatar wm42016-09-14
| | | | | | | | | 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 VOsGravatar wm42016-09-13
| | | | | | | | | 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 VOGravatar wm42016-09-12
|
* vo: remove unused VOCTRL_GET_PANSCANGravatar wm42016-09-08
| | | | | | 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/VOsGravatar wm42016-09-05
|
* vo: change messy handling of fullscreen and other flagsGravatar wm42016-08-30
| | | | | | | | | | | | | | 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 structGravatar Niklas Haas2016-07-03
| | | | | | | | | | | | | | | | | | 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 overlaysGravatar Gusar3212016-06-13
| | | | | | | 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 variablesGravatar wm42016-04-26
| | | | They're now used for the TV callback too, not just vsync.
* vo_rpi: wait for vsync with a timeoutGravatar wm42016-04-26
| | | | | | 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 changesGravatar wm42016-04-26
| | | | | | | | | | | | 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 indentationGravatar wm42016-04-26
| | | | | 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()Gravatar wm42016-04-25
| | | | | | | 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 thingsGravatar wm42016-02-24
| | | | | Commit 2f562825 didn't remove the "color" declaration for these. Since the shader header already declares it, shader compilation broke.
* vo_rpi: add geometry handlingGravatar Uros Vampl2016-02-05
| | | | | | 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 laterGravatar wm42016-01-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 rotationGravatar wm42016-01-05
| | | | | 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 rectGravatar wm42016-01-05
| | | | | | | | | | | 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 commitGravatar wm42015-12-26
| | | | Meh. Fixes #2639.
* vo_rpi: fix compilationGravatar wm42015-12-26
| | | | | | | | | 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_Gravatar wm42015-12-19
|
* vo_rpi: set aspect ratioGravatar wm42015-11-25
| | | | | Otherwise, the MMAL output component will letter-box the video within the specified dest_rect while keeping square pixels.
* vo_rpi: log subtitle render timeGravatar wm42015-11-25
|
* vo_rpi: add an option to disable OSDGravatar wm42015-11-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 parameterGravatar wm42015-10-03
| | | | | | | | | | | 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.cGravatar wm42015-09-23
| | | | | | 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 compilationGravatar wm42015-09-11
| | | | The recent OpenGL refactor commits forgot to update this file.
* vo_rpi: disable background by defaultGravatar wm42015-08-20
| | | | And add an option to enable it.
* vo_rpi: use correct variable for osd layerGravatar wm42015-08-20
| | | | | 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 renderedGravatar wm42015-08-20
| | | | | 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 changeGravatar wm42015-08-18
| | | | | | | | | | | 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 subtitlesGravatar wm42015-08-18
| | | | | | | | 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 derefGravatar wm42015-08-14
| | | | Can happen in obscure situations and with hw decoding disabled.
* vo_rpi: simplify background handlingGravatar wm42015-08-13
| | | | Apparently this is sufficient.
* vo_rpi: unregister vsync callbackGravatar wm42015-08-13
| | | | Small bug, much pain.
* vo_rpi: skip OSD rendering when repeating framesGravatar wm42015-08-13
| | | | It's unnecessary and slow. Doesn't help too much, though.
* vo_rpi: support display syncGravatar wm42015-08-10
| | | | | | | | 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 rateGravatar wm42015-07-27
| | | | Reverse engineered from tvservice.c.
* vo_rpi: update renderer size on display size changes tooGravatar wm42015-05-01
| | | | | | | | (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 switchesGravatar wm42015-04-30
|
* vo_rpi: actually draw a black backgroundGravatar wm42015-04-30
| | | | | | | | 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 driverGravatar wm42015-04-13
| | | | | | | This is optional, but ensures that linking with -Wl,--as-needed does not drop the MMAL VC driver. The driver normally "registers" itself in the library constructor, but since no symbols are explicitly referenced, the linker could remove it with as-needed enabled.
* video/out: fix screenshot image formatsGravatar wm42015-04-07
| | | | | | | Use variants without alpha. I skipped vo_sdl, because format selection seems a bit more complicated here, and nobody cares about vo_sdl anymore.