blob: 713ac9a1d9ba5a29636f456e78a5859918276408 [file] [log] [blame]
Emeric Vigier1f90ce12012-08-06 13:39:08 -04001/*
2 * Copyright (C) 2004, 2005, 2006, 2008, 2009, 2010 Savoir-Faire Linux Inc.
3 * Author: Pierre-Luc Bacon <pierre-luc.bacon@savoirfairelinux.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3 of the License, or
8 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 *
18 * Additional permission under GNU GPL version 3 section 7:
19 *
20 * If you modify this program, or any covered work, by linking or
21 * combining it with the OpenSSL project's OpenSSL library (or a
22 * modified version of that library), containing parts covered by the
23 * terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
24 * grants you additional permission to convey the resulting work.
25 * Corresponding Source for a non-source form of such a combination
26 * shall include the source code for the parts of OpenSSL used as well
27 * as that of the covered work.
28 */
29
30#ifndef CODEC_H_
31#define CODEC_H_
32
33#include "cc_config.h" // for types
34
35/**
36 * Interface for both audio codecs as well as video codecs.
37 */
38namespace sfl {
39class Codec {
40 public:
41 virtual ~Codec() {}
42 /**
43 * @return The mimesubtype for this codec. Eg. : "theora"
44 */
45 virtual std::string getMimeSubtype() const = 0;
46
47 /**
48 * @return payload type numeric identifier.
49 */
50 virtual uint8 getPayloadType() const = 0;
51
52 /**
53 * @return RTP clock rate in Hz.
54 */
55 virtual uint32 getClockRate() const = 0;
56
57 /**
58 * @return The bitrate for which this codec is configured // TODO deal with VBR case.
59 */
60 virtual double getBitRate() const = 0;
61};
62}
63
64typedef sfl::Codec* create_t();
65
66typedef void destroy_t (sfl::Codec*);
67
68#endif // CODEC_H_