MixerEffectPlugin.cpp 1.95 KB
Newer Older
1
/*****************************************************************************
2
 * MixerEffectPlugin.cpp: Effect module to mix multiple frame in one
3
 *****************************************************************************
Ludovic Fauvet's avatar
Ludovic Fauvet committed
4
 * Copyright (C) 2008-2010 VideoLAN
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
 *
 * Authors: Vincent Carrubba <cyberbouba@gmail.com>
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
 *****************************************************************************/

23
#include "MixerEffectPlugin.h"
24 25 26

//#include "VlmcPlugin.h"

27 28
#include <QtDebug>

29
MixerEffectPlugin::MixerEffectPlugin()
30
{
31
}
32

33
MixerEffectPlugin::~MixerEffectPlugin()
34 35 36
{
}

37
void    MixerEffectPlugin::init( IEffectNode* ien )
38
{
39
    m_ien = ien;
Hugo Beauzee-Luyssen's avatar
Hugo Beauzee-Luyssen committed
40 41
    for ( unsigned int i = 0; i < 64; ++i )
        m_ien->createStaticVideoInput();
42
    m_ien->createStaticVideoOutput();
43 44 45
    return ;
}

46
void	MixerEffectPlugin::render( void )
47
{
48 49 50
  quint32                   i;
  quint32                   nbIns;
  static LightVideoFrame    nullFrame;
51

52
  nbIns = m_ien->getNBStaticsVideosInputs();
Hugo Beauzee-Luyssen's avatar
Hugo Beauzee-Luyssen committed
53
  for ( i = nbIns; i > 0; --i )
54
  {
55
      const LightVideoFrame&   lvf = (*m_ien->getStaticVideoInput( i ));
56
      if ( lvf->frame.octets != NULL )
57
      {
58
          (*m_ien->getStaticVideoOutput( 1 )) << lvf;
59
          return ;
60 61
      }
  }
62
  (*m_ien->getStaticVideoOutput( 1 )) << nullFrame;
63 64
  return ;
}