Commit 8e0d48c8 authored by Konstantin Pavlov's avatar Konstantin Pavlov

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

API.

Also, distinguish between SSE and SSE2 CPUs.
parent 64568cf4
......@@ -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;
......
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