Revision 07c11e3e src/gst/engine/codec.cpp
| b/src/gst/engine/codec.cpp | ||
|---|---|---|
| 89 | 89 |
} |
| 90 | 90 |
|
| 91 | 91 |
|
| 92 |
/// Constructor |
|
| 93 |
AudioConvertedEncoder::AudioConvertedEncoder() : |
|
| 94 |
aconv_(Pipeline::Instance()->makeElement("audioconvert", NULL))
|
|
| 95 |
{}
|
|
| 96 |
|
|
| 97 |
/// Destructor |
|
| 98 |
AudioConvertedEncoder::~AudioConvertedEncoder() |
|
| 99 |
{
|
|
| 100 |
Pipeline::Instance()->remove(&aconv_); |
|
| 101 |
} |
|
| 102 |
|
|
| 103 |
|
|
| 104 |
/// Constructor |
|
| 105 |
AudioConvertedDecoder::AudioConvertedDecoder() : |
|
| 106 |
aconv_(0) |
|
| 107 |
{}
|
|
| 108 |
|
|
| 109 |
|
|
| 110 |
void AudioConvertedDecoder::init() |
|
| 111 |
{
|
|
| 112 |
aconv_ = Pipeline::Instance()->makeElement("audioconvert", NULL);
|
|
| 113 |
} |
|
| 114 |
|
|
| 115 |
/// Destructor |
|
| 116 |
AudioConvertedDecoder::~AudioConvertedDecoder() |
|
| 117 |
{
|
|
| 118 |
Pipeline::Instance()->remove(&aconv_); |
|
| 119 |
} |
|
| 120 |
|
|
| 121 | 92 |
VideoEncoder::VideoEncoder(GstElement *encoder, bool supportsInterlaced) : |
| 122 | 93 |
colorspc_(Pipeline::Instance()->makeElement("ffmpegcolorspace", NULL)),
|
| 123 | 94 |
supportsInterlaced_(supportsInterlaced) // most codecs don't have this property |
| ... | ... | |
| 411 | 382 |
return MIN_BUFFER_USEC; |
| 412 | 383 |
} |
| 413 | 384 |
|
| 414 |
void VorbisDecoder::init() |
|
| 385 |
|
|
| 386 |
VorbisDecoder::VorbisDecoder() |
|
| 415 | 387 |
{
|
| 416 | 388 |
decoder_ = Pipeline::Instance()->makeElement("vorbisdec", NULL);
|
| 417 | 389 |
} |
| 418 | 390 |
|
| 391 |
|
|
| 419 | 392 |
/// Creates an RtpVorbisDepay |
| 420 | 393 |
RtpPay* VorbisDecoder::createDepayloader() const |
| 421 | 394 |
{
|
| ... | ... | |
| 423 | 396 |
} |
| 424 | 397 |
|
| 425 | 398 |
/// Constructor |
| 426 |
RawEncoder::RawEncoder() : AudioConvertedEncoder() |
|
| 399 |
RawEncoder::RawEncoder() : |
|
| 400 |
aconv_(Pipeline::Instance()->makeElement("audioconvert", NULL))
|
|
| 401 |
{}
|
|
| 402 |
|
|
| 403 |
/// Destructor |
|
| 404 |
RawEncoder::~RawEncoder() |
|
| 427 | 405 |
{
|
| 428 |
// FIXME: HACK ATTACK: it's simpler to have this placeholder element |
|
| 429 |
// that pretends to be an aconv, and it has no |
|
| 430 |
// effect, but this isn't very smart. |
|
| 431 |
//aconv_ = Pipeline::Instance()->makeElement("audioconvert", NULL);
|
|
| 432 |
//g_object_set(aconv_, "silent", TRUE, NULL); |
|
| 406 |
Pipeline::Instance()->remove(&aconv_); |
|
| 433 | 407 |
} |
| 434 | 408 |
|
| 435 |
|
|
| 436 | 409 |
/// Creates an RtpL16Pay |
| 437 | 410 |
Pay* RawEncoder::createPayloader() const |
| 438 | 411 |
{
|
| ... | ... | |
| 440 | 413 |
} |
| 441 | 414 |
|
| 442 | 415 |
/// Constructor |
| 443 |
RawDecoder::RawDecoder() |
|
| 416 |
RawDecoder::RawDecoder() : |
|
| 417 |
aconv_(Pipeline::Instance()->makeElement("audioconvert", NULL))
|
|
| 444 | 418 |
{}
|
| 445 | 419 |
|
| 446 | 420 |
|
| 421 |
/// Destructor |
|
| 422 |
RawDecoder::~RawDecoder() |
|
| 423 |
{
|
|
| 424 |
Pipeline::Instance()->remove(&aconv_); |
|
| 425 |
} |
|
| 426 |
|
|
| 447 | 427 |
/// Creates an RtpL16Depay |
| 448 | 428 |
RtpPay* RawDecoder::createDepayloader() const |
| 449 | 429 |
{
|
| ... | ... | |
| 451 | 431 |
} |
| 452 | 432 |
|
| 453 | 433 |
/// Constructor |
| 454 |
LameEncoder::LameEncoder() : AudioConvertedEncoder(), |
|
| 434 |
LameEncoder::LameEncoder() : |
|
| 435 |
aconv_(Pipeline::Instance()->makeElement("audioconvert", NULL)),
|
|
| 455 | 436 |
mp3parse_(Pipeline::Instance()->makeElement("mp3parse", NULL))
|
| 456 | 437 |
{
|
| 457 | 438 |
/// FIXME: put this in initializer list somehow |
| ... | ... | |
| 465 | 446 |
LameEncoder::~LameEncoder() |
| 466 | 447 |
{
|
| 467 | 448 |
Pipeline::Instance()->remove(&mp3parse_); |
| 449 |
Pipeline::Instance()->remove(&aconv_); |
|
| 468 | 450 |
} |
| 469 | 451 |
|
| 470 | 452 |
/// Constructor |
| 471 |
MadDecoder::MadDecoder() |
|
| 472 |
{}
|
|
| 473 |
|
|
| 474 |
|
|
| 475 |
void MadDecoder::init() |
|
| 453 |
MadDecoder::MadDecoder() : |
|
| 454 |
aconv_(Pipeline::Instance()->makeElement("audioconvert", NULL))
|
|
| 476 | 455 |
{
|
| 477 |
AudioConvertedDecoder::init(); |
|
| 478 | 456 |
decoder_ = Pipeline::Instance()->makeElement("mad", NULL);
|
| 479 | 457 |
gstlinkable::link(decoder_, aconv_); |
| 480 | 458 |
} |
| 481 | 459 |
|
| 460 |
MadDecoder::~MadDecoder() |
|
| 461 |
{
|
|
| 462 |
Pipeline::Instance()->remove(&aconv_); |
|
| 463 |
} |
|
| 464 |
|
|
| 465 |
|
|
| 482 | 466 |
/** |
| 483 | 467 |
* Creates an RtpMpaPay */ |
| 484 | 468 |
Pay* LameEncoder::createPayloader() const |
Also available in: Unified diff