~noskcaj/ubuntu/saucy/sflphone/merge-1.2.3-2

« back to all changes in this revision

Viewing changes to daemon/src/audio/codecs/g722.cpp

  • Committer: Jackson Doak
  • Date: 2013-07-10 21:04:46 UTC
  • mfrom: (20.1.3 sid)
  • Revision ID: noskcaj@ubuntu.com-20130710210446-y8f587vza807icr9
Properly merged from upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 *  Copyright (C) 2004, 2005, 2006, 2008, 2009, 2010, 2011 Savoir-Faire Linux Inc.
3
 
 * Author:  Alexandre Savard <alexandre.savard@savoirfairelinux.com>
4
 
 *
5
 
 * Motly borrowed from asterisk's sources (Steve Underwood <steveu@coppice.org>)
6
 
 *
7
 
 * This program is free software; you can redistribute it and/or modify
8
 
 * it under the terms of the GNU General Public License as published by
9
 
 * the Free Software Foundation; either version 3 of the License, or
10
 
 * (at your option) any later version.
11
 
 *
12
 
 * This program is distributed in the hope that it will be useful,
13
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
 
 * GNU General Public License for more details.
16
 
 *
17
 
 * You should have received a copy of the GNU General Public License
18
 
 * along with this program; if not, write to the Free Software
19
 
 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
2
 *  Copyright (C) 2004-2012 Savoir-Faire Linux Inc.
 
3
 *  Author:  Alexandre Savard <alexandre.savard@savoirfairelinux.com>
 
4
 *
 
5
 *  Mostly borrowed from asterisk's sources (Steve Underwood <steveu@coppice.org>)
 
6
 *
 
7
 *  This program is free software; you can redistribute it and/or modify
 
8
 *  it under the terms of the GNU General Public License as published by
 
9
 *  the Free Software Foundation; either version 3 of the License, or
 
10
 *  (at your option) any later version.
 
11
 *
 
12
 *  This program is distributed in the hope that it will be useful,
 
13
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
15
 *  GNU General Public License for more details.
 
16
 *
 
17
 *  You should have received a copy of the GNU General Public License
 
18
 *  along with this program; if not, write to the Free Software
 
19
 *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA.
20
20
 *
21
21
 *  Additional permission under GNU GPL version 3 section 7:
22
22
 *
50
50
        }
51
51
 
52
52
    private:
53
 
        virtual int decode(SFLDataFormat *dst, unsigned char *src, size_t buf_size)
 
53
        int decode(SFLDataFormat *dst, unsigned char *src, size_t buf_size)
54
54
        {
55
55
            return g722_decode(dst, src, buf_size);
56
56
        }
57
57
 
58
 
        virtual int encode(unsigned char *dst, SFLDataFormat *src, size_t /*buf_size*/)
 
58
        int encode(unsigned char *dst, SFLDataFormat *src, size_t /*buf_size*/)
59
59
        {
60
60
            int out = g722_encode(dst, src, frameSize_);
61
61
            return out;
758
758
 
759
759
// the class factories
760
760
// cppcheck-suppress unusedFunction
761
 
extern "C" sfl::Codec* CODEC_ENTRY()
 
761
extern "C" sfl::AudioCodec* AUDIO_CODEC_ENTRY()
762
762
{
763
763
    return new G722;
764
764
}
765
765
 
766
766
// cppcheck-suppress unusedFunction
767
 
extern "C" void destroy(sfl::Codec* a)
 
767
extern "C" void destroy(sfl::AudioCodec* a)
768
768
{
769
769
    delete a;
770
770
}