aboutsummaryrefslogtreecommitdiffhomepage
path: root/video
Commit message (Collapse)AuthorAge
* 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).
* vd_lavc: simplify some unneeded ifdefferyGravatar wm42016-04-25
| | | | These were for ancient libavcodec versions.
* vd_lavc: make image_format hwdec field optionalGravatar wm42016-04-25
| | | | | | | For Mediacodec in particular we don't care about the format. It can just decode to whatever it wants. The only case we would care about is it not returning an opaque format if we don't have proper interop, but libavcodec always returns non-opaque formats by default.
* vd_lavc: simplify RPI and Mediacodec wrappersGravatar wm42016-04-25
| | | | | | | | | | | | Use the recently added lavc_suffix mechanism to select the wrapper decoder. With all hwdec callbacks being optional, and RPI/Mediacodec having only dummy callbacks, all the callbacks can be removed as well. The result is that the vd_lavc_hwdec struct for both of them is tiny. It's better to move them to vd_lavc.c directly, because they are so trivial and small.
* vd_lavc: make all hwdec callbacks optionalGravatar wm42016-04-25
|
* vd_lavc: set AVCodecContext.time_base to forced time baseGravatar wm42016-04-25
| | | | | This is a bit sketchy, as there isn't a truly standard way to communicate the timebase.
* vd_lavc: better hwdec wrapper decoder selectionGravatar wm42016-04-25
| | | | | | | | | | | | | | | | This is intended for cases when --hwdec needs to override the decoder implementation in use, like for example on the RPI. It does two things: 1. Allow the hwdec to indicate a decoder suffix. libavcodec by convention adds a suffix to all wrapper decoders, and here we start relying on it. While not necessarily the best idea, it's the only thing we got. libavcodec's hwaccel list is useless, because it only has the codec ID, not the associated decoder's name. 2. Make --hwdec=auto work properly. It shouldn't fail anymore, and hwdec probing should reliably work, even if a different decoder is selected with --vd. The semantics of --hwdec should dictate that it overrides the default decoder.
* vd_lavc: allow process_image() to return NULLGravatar wm42016-04-25
| | | | In case of errors or whatever.
* 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.)
* vd_lavc: fix hwdec fallback if hwdec pre-initialization failsGravatar wm42016-04-22
| | | | Damn.
* vo_opengl: always reset some GL state when leaving rendererGravatar wm42016-04-22
| | | | | | The active texture and some pixelstore parameters are now always reset to defaults when entering and leaving the renderer. Could be important for libmpv.
* d3dva: move Intel_H264_NoFGT_ClearVideo to lower priorityGravatar Kevin Mitchell2016-04-18
| | | | | | This seems to cause problems, so only use it if H264_E is not available. fixes #3059
* dxva2: fix missing newline in error messageGravatar Kevin Mitchell2016-04-18
|
* d3dva: include selected decoder and format in verbose outputGravatar Kevin Mitchell2016-04-17
|
* vo_opengl: fix an outdated commentGravatar wm42016-04-16
| | | | This wasn't updated over multiple iterations.
* vo_lavc: fix build on LibavGravatar wm42016-04-15
| | | | | OF COURSE Libav doesn't have AV_PICTURE_TYPE_NONE. Why the fuck would it?
* mp_image: make mp_image_copy_fields_* privateGravatar wm42016-04-15
| | | | | Future code should always use mp_image_{to,from}_av_frame(). Everything else is way too messy and fragile.
* vo_lavc: unsupport deprecated AVFMT_RAWPICTUREGravatar wm42016-04-15
| | | | | | | | As of ffmpeg git master, only the libavdevice decklink wrapper supports this. Everything else has dropped support. You're now supposed to use AV_CODEC_ID_WRAPPED_AVFRAME, which works a bit differently. Normal AVFrames should still work for these encoders.
* vo_lavc: send refcounted AVFrame to encoderGravatar wm42016-04-15
| | | | | | This potentially makes it more efficient, and actually makes it simpler. Yes, AV_PICTURE_TYPE_NONE is the default for pict_type.
* mp_image: add mp_image_to_av_frame()Gravatar wm42016-04-15
| | | | | What mp_image_to_av_frame_and_unref() should have been. (The _unref variant is still useful though.)
* mp_image: simplify mp_image_steal_data()Gravatar wm42016-04-15
| | | | Why was this so complex.
* mp_image: pass through AVHWFramesContextGravatar wm42016-04-15
| | | | In both directions.
* lcms: include math.hGravatar wm42016-04-15
| | | | Fixes #3053.
* vo_opengl: rpi: don't include x11 header fileGravatar wm42016-04-15
| | | | Copy & paste bug.
* vo_opengl: simplify and improve up scale=oversampleGravatar Niklas Haas2016-04-12
| | | | | | | | | Since what we're doing is a linear blend of the four colors, we can just do it for free by using GPU sampling. This requires significantly fewer texture fetches and calculations to compute the final color, making it much more efficient. The code is also much shorter and simpler.
* vf_vavpp: reindentGravatar wm42016-04-11
|
* vaapi: determine surface format in decoder, not in rendererGravatar wm42016-04-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Until now, we have made the assumption that a driver will use only 1 hardware surface format. the format is dictated by the driver (you don't create surfaces with a specific format - you just pass a rt_format and get a surface that will be in a specific driver-chosen format). In particular, the renderer created a dummy surface to probe the format, and hoped the decoder would produce the same format. Due to a driver bug this required a workaround to actually get the same format as the driver did. Change this so that the format is determined in the decoder. The format is then passed down as hw_subfmt, which allows the renderer to configure itself with the correct format. If the hardware surface changes its format midstream, the renderer can be reconfigured using the normal mechanisms. This calls va_surface_init_subformat() each time after the decoder returns a surface. Since libavcodec/AVFrame has no concept of sub- formats, this is unavoidable. It creates and destroys a derived VAImage, but this shouldn't have any bad performance effects (at least I didn't notice any measurable effects). Note that vaDeriveImage() failures are silently ignored as some drivers (the vdpau wrapper) support neither vaDeriveImage, nor EGL interop. In addition, we still probe whether we can map an image in the EGL interop code. This is important as it's the only way to determine whether EGL interop is supported at all. With respect to the driver bug mentioned above, it doesn't matter which format the test surface has. In vf_vavpp, also remove the rt_format guessing business. I think the existing logic was a bit meaningless anyway. It's not even a given that vavpp produces the same rt_format for output.
* encode_lavc: Migrate to codecpar API.Gravatar Rudolf Polzer2016-04-11
|
* aspect: rework --video-unscaledGravatar Niklas Haas2016-04-10
| | | | | | | | | | | | | | | | | | | In the past, --video-unscaled also disabled zooming and aspect ratio corrections. But this didn't make much sense in terms of being a useful option. The new behavior just sets the initial video size to be unscaled, but it's still affected by zoom commands and aspect ratio corrections. To get the old behavior back, --video-aspect=0 --video-zoom=0 need to be added as well (in the general case). Most of the time it should not make a difference though. Also, there seems to have been some additional dst_rect clamping code inside src_dst_split_scaling that didn't seem to either be necessary nor ever get triggered. (The code immediately above it already makes sure to crop the video if it's larger than the dst_rect) No idea why it was there, but I just removed it.
* aspect: remove useless debug messagesGravatar wm42016-04-10
| | | | Never needed them. This makes the code slightly more readable.
* vo_opengl: improve rotation handling (again)Gravatar wm42016-04-08
| | | | | | | | | | | | | | | | | Apply basic transformations like rotation by 90° and mirroring when sampling from the source textures. The original idea was making this part of img_tex.transform, but this didn't work: lots of code plays tricks on the transform, so manipulating it is not necessarily transparent, especially when width/height are switched. So add a new pre_transform field, which is strictly applied before the normal transform. This fixes most glitches involved with rotating the image. Cropping and rotation are now weirdly separated, even though they could be done in the same step. I think this is not much of a problem, and has the advantage that changing panscan does not trigger FBO reallocations (I think...).
* vo_opengl: log if glGetString(GL_VERSION) returns NULLGravatar wm42016-04-08
| | | | | | Typically happens with some implementations if no context is currrent, or is otherwise broken. This is particularly relevant to the opengl_cb API, because the API user will have no other indication what went wrong.
* d3d: fix Windows buildGravatar wm42016-04-07
| | | | | | Commit f009d16f accidentally broke it. Thanks to RiCON for noticing and testing.
* vo_opengl: videotoolbox: use kCVPixelBufferLock_ReadOnly for screenshotsGravatar wm42016-04-07
| | | | Why not.
* videotoolbox: change how videotoolbox format is managedGravatar wm42016-04-07
| | | | | | | | | | | | | | | | | | | | | | | The underlying intention of this code is to make changing --videotoolbox-format at runtime work. For this reason, the format can't just be statically setup, but must be read from the option at runtime. This means the format is not fixed anymore, and we have to make sure the renderer is property reinitialized if the format changes. There is currently no way to trigger reinit on this level, which is why the mp_image_params.hw_subfmt field was introduced. One sketchy thing remains: normally, the renderer is supposed to be involved with VO format negotiation, which would ensure that the VO can take the format at all. Since the hw_subfmt is not part of this format negotiation, it's implied the get_vt_fmt() callback only returns formats supported by the renderer. This is not necessarily clear because vo_opengl checks this with converted_imgfmt separately. None of this matters in practice though, because we know all formats are always supported. (This still requires somehow triggering decoder reinit to make the change effective.)
* mp_image: introduce a hw_subfmt fieldGravatar wm42016-04-07
| | | | | | | | | | | For hwaccel formats, mp_image will merely point to a hardware surface handle. In these cases, the mp_image_params.imgfmt field describes the format insufficiently, because it mostly only describes the type of the hardware format, not its underlying format. Introduce hw_subfmt to describe the underlying format. It makes sense to use it with most hwaccels, though for now it will be used with the following commit only.
* vd_lavc: let hardware decoder request delaying frames explicitlyGravatar wm42016-04-07
| | | | | | | | | | Until now, the presence of the process_image() callback was used to set a delay queue with a hardcoded size. Change this to a vd_lavc_hwdec field instead, so the decoder can explicitly set this if it's really needed. Do this so process_image() can be used in the VideoToolbox glue code for something entirely unrelated.
* vd_lavc: fix codec vs. decoder confusionGravatar wm42016-04-07
| | | | | | | | | | Some functions which expected a codec name (i.e. the name of the video format itself) were passed a decoder name. Most "native" libavcodec decoders have the same name as the codec, so this was never an issue. This should mean that e.g. using "--vd=lavc:h264_mmal --hwdec=mmal" should now actually enable native surface mode (instead of doing copy- back).
* vo: don't reset vsync statistics on seeks etc.Gravatar wm42016-04-06
| | | | | | | | | | | | | | | | | | The sync-by-display mode relies on using the vsync statistics for timing. As a consequence discontinuities must be handled somehow. Until now we have done this by completely resetting these statistics. This can be somewhat annoying, especially if the GL driver's vsync timing is not ideal. So after e.g. a seek it could take a second until it locked back to the proper values. Change it not to reset all statistics. Some state obviously has to be reset, because it's a discontinuity. To make it worse, the driver's vsync behavior will also change on such discontinuities. To compensate, we discard the timings for the first 2 vsyncs after each discontinuity (via num_successive_vsyncs). This is probably not fully ideal, and num_total_vsync_samples handling in particular becomes a bit questionable.
* vo_opengl: fix build breakageGravatar wm42016-04-06
|
* vo_opengl: minor simplificationGravatar wm42016-04-05
| | | | It's the same functionally.
* vo_opengl: fix nnedi + rectangle texturesGravatar wm42016-04-05
| | | | Shader compilation error due to incompatible samplers.
* aspect: make video-zoom logarithmicGravatar Niklas Haas2016-04-03
| | | | | | | | | | | | | The past behavior was a bit weird, especially when zooming out. There was no simple way to zoom in or out in consistent increments using keybindings alone. The new behavior preserves most of the old behavior's semantics but scales out to infinity better. It coincidentally also makes it really easy to get clean power of 2 ratios (e.g. 2x, 4x, 8x and their inverses). Fixes #3004.
* gl_lcms: choose BT.1886 gamma per-channelGravatar Niklas Haas2016-04-01
| | | | | | | | | This makes the black point closer (chromatically) to the white point, by ensuring channels keep their consistent brightness ratios as they go down to zero. I also raised the 3DLUT version as this changes semantics and is a separate commit from the previous one.
* vo_opengl: generate 3DLUT against source and use full BT.1886Gravatar Niklas Haas2016-04-01
| | | | | | | | | | | | | | | | | | | This commit refactors the 3DLUT loading mechanism to build the 3DLUT against the original source characteristics of the file. This allows us, among other things, to use a real BT.1886 profile for the source. This also allows us to actually use perceptual mappings. Finally, this reduces errors on standard gamut displays (where the previous 3DLUT target of BT.2020 was unreasonably wide). This also improves the overall accuracy of the 3DLUT due to eliminating rounding errors where possible, and allows for more accurate use of LUT-based ICC profiles. The current code is somewhat more ugly than necessary, because the idea was to implement this commit in a working state first, and then maybe refactor the profile loading mechanism in a later commit. Fixes #2815.
* demux_lavf, ad_lavc, ad_spdif, vd_lavc: handle FFmpeg codecpar API changeGravatar wm42016-03-31
| | | | | | | | | AVFormatContext.codec is deprecated now, and you're supposed to use AVFormatContext.codecpar instead. Handle this for all of the normal playback code. Encoding mode isn't touched.
* dxva2: abort on mp_image_new_custom_ref failureGravatar Kevin Mitchell2016-03-30
|
* dxva2: stop using pointer obfuscator LPDIRECT3DSURFACE9Gravatar Kevin Mitchell2016-03-30
| | | | It's just ugly and unnecessary.