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

Konstantin Pavlov git at videolan.org
Wed Sep 21 15:38:20 CEST 2011


vlc | branch: master | Konstantin Pavlov <thresh at videolan.org> | Wed Sep 21 09:57:10 2011 +0400| [8e0d48c860f46914e0115a21fd4a7dae4f270959] | committer: Konstantin Pavlov

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

Also, distinguish between SSE and SSE2 CPUs.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=8e0d48c860f46914e0115a21fd4a7dae4f270959
---

 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 ca57a28..9909040 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
@@ -360,20 +362,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;
@@ -749,20 +754,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