Commit Graph

14 Commits

Author SHA1 Message Date
wm4 eb15151705 Move options/config related files from mpvcore/ to options/
Since m_option.h and options.h are extremely often included, a lot of
files have to be changed.

Moving path.c/h to options/ is a bit questionable, but since this is
mainly about access to config files (which are also handled in
options/), it's probably ok.
2013-12-17 02:07:57 +01:00
wm4 e5311586ab Rename sub.c/.h to osd.c/.h
This was way too misleading. osd.c merely calls the subtitle renderers,
instead of actually dealing with subtitles.
2013-11-24 14:44:58 +01:00
Stefano Pigozzi 37388ebb0e configure: uniform the defines to #define HAVE_xxx (0|1)
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
2013-11-03 21:59:54 +01:00
wm4 c8930e80a8 video/out: remove useless info struct and redundant fields
The author and comment fields were printed only in -v mode.
2013-10-23 19:30:01 +02:00
wm4 1061f43a2f gl_osd: mp_msg conversion 2013-09-12 01:34:42 +02:00
Stefano Pigozzi c2cb85851f vo_corevideo: use dwidth/dheight for window dimensions
In the previous commit I wrongly used params->d_h/d_w which happened to work
by chance.
2013-08-25 21:14:59 +02:00
Stefano Pigozzi dc2ebae8cf vo_corevideo: convert to use reconfig instead of config 2013-08-25 20:47:46 +02:00
Stefano Pigozzi e66049c31b vo_corevideo: don't set colormatrix on direct rendering path
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
2013-08-25 20:41:43 +02:00
Stefano Pigozzi d4a874f726 vo_corevideo: fix regression in colormatrix handling
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.
2013-08-25 12:13:46 +02:00
Stefano Pigozzi a9cb2dc1b8 video: add vda decode support (with hwaccel) and direct rendering
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.
2013-08-22 12:13:30 +02:00
Stefano Pigozzi 30f2db5930 vo_corevideo: add uyvy422 pixel format support
Looks like the vda_h264_dec in ffmpeg likes to output this format and it
inserted swscale to do pixfmt conversion to yuyv422.
2013-08-15 11:22:40 +02:00
Stefano Pigozzi 406241005e core: move contents to mpvcore (2/2)
Followup commit. Fixes all the files references.
2013-08-06 22:52:31 +02:00
Stefano Pigozzi 01178727a9 vo_corevideo: use new log API
Also removes the printing of the OpenGL info when using verbose mode since
gl_common already does that.
2013-08-01 08:38:29 +02:00
Stefano Pigozzi 3b236d176d vo_corevideo: move to C from Objective-C
This file was alredy written in C. The only remaining part was the file
exension and `#import`s.
2013-08-01 08:28:16 +02:00