summaryrefslogtreecommitdiffstats
path: root/video/out/vo_corevideo.c
Commit message (Collapse)AuthorAgeFilesLines
* configure: uniform the defines to #define HAVE_xxx (0|1)Stefano Pigozzi2013-11-031-4/+4
| | | | | | | | | | | | | | | | | | | | | The configure followed 5 different convetions of defines because the next guy always wanted to introduce a new better way to uniform it[1]. For an hypothetic feature 'hurr' you could have had: * #define HAVE_HURR 1 / #undef HAVE_DURR * #define HAVE_HURR / #undef HAVE_DURR * #define CONFIG_HURR 1 / #undef CONFIG_DURR * #define HAVE_HURR 1 / #define HAVE_DURR 0 * #define CONFIG_HURR 1 / #define CONFIG_DURR 0 All is now uniform and uses: * #define HAVE_HURR 1 * #define HAVE_DURR 0 We like definining to 0 as opposed to `undef` bcause it can help spot typos and is very helpful when doing big reorganizations in the code. [1]: http://xkcd.com/927/ related
* video/out: remove useless info struct and redundant fieldswm42013-10-231-6/+2
| | | | The author and comment fields were printed only in -v mode.
* gl_osd: mp_msg conversionwm42013-09-121-1/+1
|
* vo_corevideo: use dwidth/dheight for window dimensionsStefano Pigozzi2013-08-251-1/+1
| | | | | In the previous commit I wrongly used params->d_h/d_w which happened to work by chance.
* vo_corevideo: convert to use reconfig instead of configStefano Pigozzi2013-08-251-7/+6
|
* vo_corevideo: don't set colormatrix on direct rendering pathStefano Pigozzi2013-08-251-23/+49
| | | | | | | | | | | The current code uses GL_YCBCR_422_APPLE texture format. This allows to handle transparently the conversion to RGB but always use BT.601 colormatrix [1]. Hopefully I can adapt gl_video to take CVPixelBuffers soon so that `vo=opengl` can be used instead of `vo=corevideo` with `hwdec=vda` [1]: http://www.opengl.org/registry/specs/APPLE/ycbcr_422.txt http://www.opengl.org/registry/specs/APPLE/rgb_422.txt
* vo_corevideo: fix regression in colormatrix handlingStefano Pigozzi2013-08-251-40/+22
| | | | | | | | | | Regression since 18b6c01d92. That commit changed the colorspace handling to always reinit the video output. Since the CVPixelBuffers are lazily created, VOCTRL_SET_YUV_COLORSPACE was always called when the CVPixelBufferRef was NULL. Since CoreVideo functions do not complain when called on NULL, no one noticed that CVBufferSetAttachment, which stored the color matrix meta data was called on NULL.
* video: add vda decode support (with hwaccel) and direct renderingStefano Pigozzi2013-08-221-105/+309
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Decoding H264 using Video Decode Acceleration used the custom 'vda_h264_dec' decoder in FFmpeg. The Good: This new implementation has some advantages over the previous one: - It works with Libav: vda_h264_dec never got into Libav since they prefer client applications to use the hwaccel API. - It is way more efficient: in my tests this implementation yields a reduction of CPU usage of roughly ~50% compared to using `vda_h264_dec` and ~65-75% compared to h264 software decoding. This is mainly because `vo_corevideo` was adapted to perform direct rendering of the `CVPixelBufferRefs` created by the Video Decode Acceleration API Framework. The Bad: - `vo_corevideo` is required to use VDA decoding acceleration. - only works with versions of ffmpeg/libav new enough (needs reference refcounting). That is FFmpeg 2.0+ and Libav's git master currently. The Ugly: VDA was hardcoded to use UYVY (2vuy) for the uploaded video texture. One one end this makes the code simple since Apple's OpenGL implementation actually supports this out of the box. It would be nice to support other output image formats and choose the best format depending on the input, or at least making it configurable. My tests indicate that CPU usage actually increases with a 420p IMGFMT output which is not what I would have expected. NOTE: There is a small memory leak with old versions of FFmpeg and with Libav since the CVPixelBufferRef is not automatically released when the AVFrame is deallocated. This can cause leaks inside libavcodec for decoded frames that are discarded before mpv wraps them inside a refcounted mp_image (this only happens on seeks). For frames that enter mpv's refcounting facilities, this is not a problem since we rewrap the CVPixelBufferRef in our mp_image that properly forwards CVPixelBufferRetain/CvPixelBufferRelease calls to the underying CVPixelBufferRef. So, for FFmpeg use something more recent than `b3d63995` for Libav the patch was posted to the dev ML in July and in review since, apparently, the proposed fix is rather hacky.
* vo_corevideo: add uyvy422 pixel format supportStefano Pigozzi2013-08-151-0/+5
| | | | | Looks like the vda_h264_dec in ffmpeg likes to output this format and it inserted swscale to do pixfmt conversion to yuyv422.
* core: move contents to mpvcore (2/2)Stefano Pigozzi2013-08-061-1/+1
| | | | Followup commit. Fixes all the files references.
* vo_corevideo: use new log APIStefano Pigozzi2013-08-011-15/+5
| | | | | Also removes the printing of the OpenGL info when using verbose mode since gl_common already does that.
* vo_corevideo: move to C from Objective-CStefano Pigozzi2013-08-011-0/+401
This file was alredy written in C. The only remaining part was the file exension and `#import`s.