Skip to content
Snippets Groups Projects
Commit 972818d5 authored by Tristan Matthews's avatar Tristan Matthews
Browse files

Revert "* #6295: removed unused clone method"

This reverts commit d04bf094.
parent d04bf094
No related branches found
No related tags found
No related merge requests found
...@@ -32,6 +32,8 @@ ...@@ -32,6 +32,8 @@
#include "MimeParameters.h" // TODO Move to some higher directory #include "MimeParameters.h" // TODO Move to some higher directory
#include <tr1/memory>
#include <cc++/digest.h> #include <cc++/digest.h>
/** /**
...@@ -59,6 +61,11 @@ class Codec : public virtual MimeParameters ...@@ -59,6 +61,11 @@ class Codec : public virtual MimeParameters
*/ */
virtual std::string getDescription() const = 0; virtual std::string getDescription() const = 0;
/**
* @return A copy of the current codec.
*/
virtual Codec* clone() const = 0;
/** /**
* Build a unique hash code for identifying the codec uniquely. * Build a unique hash code for identifying the codec uniquely.
* Note that if multiple implementations of codec are provided, * Note that if multiple implementations of codec are provided,
......
...@@ -135,6 +135,15 @@ class Alaw : public sfl::AudioCodec ...@@ -135,6 +135,15 @@ class Alaw : public sfl::AudioCodec
std::string getDescription() const { std::string getDescription() const {
return "audio/PCMA 8000 (\"alaw\") codec."; return "audio/PCMA 8000 (\"alaw\") codec.";
} }
/**
* @Override
*/
Alaw* clone() const {
return new Alaw (*this);
}
}; };
// the class factories // the class factories
......
...@@ -133,6 +133,11 @@ class AudioCodec : public Codec ...@@ -133,6 +133,11 @@ class AudioCodec : public Codec
*/ */
unsigned int getFrameSize() const; unsigned int getFrameSize() const;
/**
* @Override
*/
virtual AudioCodec* clone() const = 0;
protected: protected:
/** Holds SDP-compliant codec name */ /** Holds SDP-compliant codec name */
std::string _codecName; // what we put inside sdp std::string _codecName; // what we put inside sdp
......
...@@ -156,6 +156,14 @@ class Celt : public sfl::AudioCodec ...@@ -156,6 +156,14 @@ class Celt : public sfl::AudioCodec
return "audio/celt 32000 (\"HD\") codec. Based on libcelt, by Jean-Marc Valin."; return "audio/celt 32000 (\"HD\") codec. Based on libcelt, by Jean-Marc Valin.";
} }
/**
* @Override
*/
Celt* clone() const {
return new Celt (*this);
}
private: private:
CELTMode *_mode; CELTMode *_mode;
......
...@@ -829,6 +829,14 @@ class G722 : public sfl::AudioCodec ...@@ -829,6 +829,14 @@ class G722 : public sfl::AudioCodec
return "G722 codec. Most of the code comes from Steve Underwood (<steveu@coppice.org>) for the Asterisk project."; return "G722 codec. Most of the code comes from Steve Underwood (<steveu@coppice.org>) for the Asterisk project.";
} }
/**
* @Override
*/
G722* clone() const {
return new G722 (*this);
}
private: private:
g722_decode_state_t *decode_s; g722_decode_state_t *decode_s;
......
...@@ -93,6 +93,14 @@ class Gsm : public sfl::AudioCodec ...@@ -93,6 +93,14 @@ class Gsm : public sfl::AudioCodec
return "GSM codec. Based on libgsm, (C) Jutta Degener and Carsten Bormann, Technische Universitaet Berlin."; return "GSM codec. Based on libgsm, (C) Jutta Degener and Carsten Bormann, Technische Universitaet Berlin.";
} }
/**
* @Override
*/
Gsm* clone() const {
return new Gsm (*this);
}
private: private:
gsm _decode_gsmhandle; gsm _decode_gsmhandle;
gsm _encode_gsmhandle; gsm _encode_gsmhandle;
......
...@@ -121,6 +121,14 @@ class Speex : public sfl::AudioCodec ...@@ -121,6 +121,14 @@ class Speex : public sfl::AudioCodec
return "audio/speex 8000 (\"narrow band\") codec. Based on libspeex, by Jean-Marc Valin."; return "audio/speex 8000 (\"narrow band\") codec. Based on libspeex, by Jean-Marc Valin.";
} }
/**
* @Override
*/
Speex* clone() const {
return new Speex (*this);
}
private: private:
const SpeexMode* _speexModePtr; const SpeexMode* _speexModePtr;
SpeexBits _speex_dec_bits; SpeexBits _speex_dec_bits;
......
...@@ -123,6 +123,14 @@ class Speex : public sfl::AudioCodec ...@@ -123,6 +123,14 @@ class Speex : public sfl::AudioCodec
return "audio/speex 32000 (\"ultra wide band\") codec. Based on libspeex, by Jean-Marc Valin."; return "audio/speex 32000 (\"ultra wide band\") codec. Based on libspeex, by Jean-Marc Valin.";
} }
/**
* @Override
*/
Speex* clone() const {
return new Speex (*this);
}
private: private:
const SpeexMode* _speexModePtr; const SpeexMode* _speexModePtr;
SpeexBits _speex_dec_bits; SpeexBits _speex_dec_bits;
......
...@@ -122,6 +122,13 @@ class Speex : public sfl::AudioCodec ...@@ -122,6 +122,13 @@ class Speex : public sfl::AudioCodec
return "audio/speex 16000 (\"wide band\") codec. Based on libspeex, by Jean-Marc Valin."; return "audio/speex 16000 (\"wide band\") codec. Based on libspeex, by Jean-Marc Valin.";
} }
/**
* @Override
*/
Speex* clone() const {
return new Speex (*this);
}
private: private:
const SpeexMode* _speexModePtr; const SpeexMode* _speexModePtr;
SpeexBits _speex_dec_bits; SpeexBits _speex_dec_bits;
......
...@@ -130,6 +130,14 @@ class Ulaw : public sfl::AudioCodec ...@@ -130,6 +130,14 @@ class Ulaw : public sfl::AudioCodec
std::string getDescription() const { std::string getDescription() const {
return "audio/PCMU 8000 (\"ulaw\") codec."; return "audio/PCMU 8000 (\"ulaw\") codec.";
} }
/**
* @Override
*/
Ulaw* clone() const {
return new Ulaw (*this);
}
}; };
// the class factories // the class factories
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment