[vlc-commits] Stream out switcher: use existing kludges to port to new FFMpeg/Libav

Konstantin Pavlov git at videolan.org
Thu Sep 29 23:34:48 CEST 2011


vlc/vlc-1.1 | branch: master | Konstantin Pavlov <thresh at videolan.org> | Wed Sep 21 09:57:10 2011 +0400| [9ba3e5ec530efa1d51eb5dfe59db2e100e126b08] | committer: Jean-Baptiste Kempf

Stream out switcher: use existing kludges to port to new FFMpeg/Libav
API.

Also, distinguish between SSE and SSE2 CPUs.
(cherry picked from commit 8e0d48c860f46914e0115a21fd4a7dae4f270959)

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-1.1.git/?a=commit;h=9ba3e5ec530efa1d51eb5dfe59db2e100e126b08
---

 modules/stream_out/switcher.c |   28 ++++++++++++++++++----------
 1 files changed, 18 insertions(+), 10 deletions(-)

diff --git a/modules/stream_out/switcher.c b/modules/stream_out/switcher.c
index 929ab99..3eee587 100644
--- a/modules/stream_out/switcher.c
+++ b/modules/stream_out/switcher.c
@@ -57,6 +57,8 @@
 #   include <libpostproc/postprocess.h>
 #endif
 
+#include "../codec/avcodec/avcodec.h"
+
 #define SOUT_CFG_PREFIX "sout-switcher-"
 #define MAX_PICTURES 10
 #define MAX_AUDIO 30
@@ -362,20 +364,23 @@ static sout_stream_id_t *Add( sout_stream_t *p_stream, es_format_t *p_fmt )
         id->ff_enc_c->dsp_mask = 0;
         if( !(i_cpu & CPU_CAPABILITY_MMX) )
         {
-            id->ff_enc_c->dsp_mask |= FF_MM_MMX;
+            id->ff_enc_c->dsp_mask |= AV_CPU_FLAG_MMX;
         }
         if( !(i_cpu & CPU_CAPABILITY_MMXEXT) )
         {
-            id->ff_enc_c->dsp_mask |= FF_MM_MMXEXT;
+            id->ff_enc_c->dsp_mask |= AV_CPU_FLAG_MMX2;
         }
         if( !(i_cpu & CPU_CAPABILITY_3DNOW) )
         {
-            id->ff_enc_c->dsp_mask |= FF_MM_3DNOW;
+            id->ff_enc_c->dsp_mask |= AV_CPU_FLAG_3DNOW;
         }
         if( !(i_cpu & CPU_CAPABILITY_SSE) )
         {
-            id->ff_enc_c->dsp_mask |= FF_MM_SSE;
-            id->ff_enc_c->dsp_mask |= FF_MM_SSE2;
+            id->ff_enc_c->dsp_mask |= AV_CPU_FLAG_SSE;
+        }
+        if( !(i_cpu & CPU_CAPABILITY_SSE2) )
+        {
+            id->ff_enc_c->dsp_mask |= AV_CPU_FLAG_SSE2;
         }
 
         id->ff_enc_c->sample_rate = p_fmt->audio.i_rate;
@@ -751,20 +756,23 @@ static mtime_t VideoCommand( sout_stream_t *p_stream, sout_stream_id_t *id )
         id->ff_enc_c->dsp_mask = 0;
         if( !(i_cpu & CPU_CAPABILITY_MMX) )
         {
-            id->ff_enc_c->dsp_mask |= FF_MM_MMX;
+            id->ff_enc_c->dsp_mask |= AV_CPU_FLAG_MMX;
         }
         if( !(i_cpu & CPU_CAPABILITY_MMXEXT) )
         {
-            id->ff_enc_c->dsp_mask |= FF_MM_MMXEXT;
+            id->ff_enc_c->dsp_mask |= AV_CPU_FLAG_MMX2;
         }
         if( !(i_cpu & CPU_CAPABILITY_3DNOW) )
         {
-            id->ff_enc_c->dsp_mask |= FF_MM_3DNOW;
+            id->ff_enc_c->dsp_mask |= AV_CPU_FLAG_3DNOW;
         }
         if( !(i_cpu & CPU_CAPABILITY_SSE) )
         {
-            id->ff_enc_c->dsp_mask |= FF_MM_SSE;
-            id->ff_enc_c->dsp_mask |= FF_MM_SSE2;
+            id->ff_enc_c->dsp_mask |= AV_CPU_FLAG_SSE;
+        }
+        if( !(i_cpu & CPU_CAPABILITY_SSE2) )
+        {
+            id->ff_enc_c->dsp_mask |= AV_CPU_FLAG_SSE2;
         }
 
         id->ff_enc_c->width = p_sys->p_pictures[p_sys->i_cmd-1].format.i_width;



More information about the vlc-commits mailing list