[vlc-devel] libvlc_video_set_format_callbacks() and "cyuv" chroma

Jérôme FORISSIER jerome at taodyne.com
Sat Mar 10 02:17:34 CET 2012


On 8 mars 2012, at 16:44, Rémi Denis-Courmont wrote:

> On Thu, 8 Mar 2012 16:37:03 +0100, Jérôme FORISSIER <jerome at taodyne.com>
> wrote:
>> Any idea what might be going wrong?
> 
> CYUV fell into disrepair and is not currently supported because there has
> been no use for it.
> Patch welcome.

Here you go:

From: Jerome Forissier <jerome at taodyne.com>
Date: Fri, 9 Mar 2012 17:08:44 +0100
Subject: [PATCH] Add CYUV to video_format_Setup() and to the list of YUV
 packed chroma codes.

Fixes: `i420_yuy2_sse2 filter warning: can't get output picture'
when the setup callback passed to libvlc_video_set_callbacks()
sets *chroma to "CYUV".
---
 src/misc/es_format.c |    1 +
 src/misc/fourcc.c    |    3 ++-
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/misc/es_format.c b/src/misc/es_format.c
index 51741fe..e5c31a7 100644
--- a/src/misc/es_format.c
+++ b/src/misc/es_format.c
@@ -157,6 +157,7 @@ void video_format_Setup( video_format_t *p_fmt, vlc_fourcc_t i_chroma,
     case VLC_CODEC_YVYU:
     case VLC_CODEC_UYVY:
     case VLC_CODEC_VYUY:
+    case VLC_CODEC_CYUV:
     case VLC_CODEC_J422:
         p_fmt->i_bits_per_pixel = 16;
         break;
diff --git a/src/misc/fourcc.c b/src/misc/fourcc.c
index 9410d77..15d452c 100644
--- a/src/misc/fourcc.c
+++ b/src/misc/fourcc.c
@@ -1498,7 +1498,8 @@ const char *vlc_fourcc_GetDescription( int i_cat, vlc_fourcc_t i_fourcc )
 
 #define VLC_CODEC_YUV_PACKED \
     VLC_CODEC_YUYV, VLC_CODEC_YVYU, \
-    VLC_CODEC_UYVY, VLC_CODEC_VYUY
+    VLC_CODEC_UYVY, VLC_CODEC_VYUY, \
+    VLC_CODEC_CYUV
 
 #define VLC_CODEC_FALLBACK_420 \
     VLC_CODEC_YUV_PLANAR_422, VLC_CODEC_YUV_PACKED, \
-- 
1.7.5.4


This patch has been moderately tested by me: I just checked that the vmem output does indeed generate pictures (but it turns out it's not the format I need anyway :o). 

Now another question about the vmem output: audio-visual and video filters (transform, sepia...) do not work. audio-visual used to work with VLC 1.1 (not sure for video filters).
Where should I look to fix that?

Thanks,

-- 
Jérôme




More information about the vlc-devel mailing list