Commit 9ba3e5ec authored by Konstantin Pavlov's avatar Konstantin Pavlov Committed by 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: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 9f9a30c0
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment