root / src / gst / rtpPay.cpp @ 201e2bb8
History | View | Annotate | Download (3.8 kB)
| 1 |
/* rtpPay.cpp
|
|---|---|
| 2 |
* Copyright (C) 2008-2009 Société des arts technologiques (SAT) |
| 3 |
* http://www.sat.qc.ca |
| 4 |
* All rights reserved. |
| 5 |
* |
| 6 |
* This file is part of Scenic. |
| 7 |
* |
| 8 |
* Scenic is free software: you can redistribute it and/or modify |
| 9 |
* it under the terms of the GNU General Public License as published by |
| 10 |
* the Free Software Foundation, either version 3 of the License, or |
| 11 |
* (at your option) any later version. |
| 12 |
* |
| 13 |
* Scenic is distributed in the hope that it will be useful, |
| 14 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 |
* GNU General Public License for more details. |
| 17 |
* |
| 18 |
* You should have received a copy of the GNU General Public License |
| 19 |
* along with Scenic. If not, see <http://www.gnu.org/licenses/>. |
| 20 |
* |
| 21 |
*/ |
| 22 |
|
| 23 |
#include <cassert> |
| 24 |
#include <gst/gst.h> |
| 25 |
#include "rtpPay.h" |
| 26 |
#include "pipeline.h" |
| 27 |
#include "util/logWriter.h" |
| 28 |
|
| 29 |
TheoraPay::TheoraPay(const Pipeline &pipeline)
|
| 30 |
{
|
| 31 |
rtpPay_ = pipeline.makeElement("rtptheorapay", NULL); |
| 32 |
} |
| 33 |
|
| 34 |
|
| 35 |
TheoraDepay::TheoraDepay(const Pipeline &pipeline)
|
| 36 |
{
|
| 37 |
rtpPay_ = pipeline.makeElement("rtptheoradepay", NULL); |
| 38 |
} |
| 39 |
|
| 40 |
H264Pay::H264Pay(const Pipeline &pipeline)
|
| 41 |
{
|
| 42 |
rtpPay_ = pipeline.makeElement("rtph264pay", NULL); |
| 43 |
// FIXME: Find out why setting buffer-list to true breaks rtp so badly, DON'T SET THIS TO TRUE
|
| 44 |
//g_object_set(rtpPay_, "buffer-list", TRUE, NULL);
|
| 45 |
} |
| 46 |
|
| 47 |
|
| 48 |
H264Depay::H264Depay(const Pipeline &pipeline)
|
| 49 |
{
|
| 50 |
rtpPay_ = pipeline.makeElement("rtph264depay", NULL); |
| 51 |
} |
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
H263Pay::H263Pay(const Pipeline &pipeline)
|
| 56 |
{
|
| 57 |
rtpPay_ = pipeline.makeElement("rtph263ppay", NULL); |
| 58 |
} |
| 59 |
|
| 60 |
|
| 61 |
H263Depay::H263Depay(const Pipeline &pipeline)
|
| 62 |
{
|
| 63 |
rtpPay_ = pipeline.makeElement("rtph263pdepay", NULL); |
| 64 |
} |
| 65 |
|
| 66 |
|
| 67 |
Mpeg4Pay::Mpeg4Pay(const Pipeline &pipeline)
|
| 68 |
{
|
| 69 |
rtpPay_ = pipeline.makeElement("rtpmp4vpay", NULL); |
| 70 |
|
| 71 |
// this means that our payloader will output bufferlists instead of
|
| 72 |
// 1 packet per buffer. this will allow downstream elements that are bufferlist aware
|
| 73 |
// to avoid unneeded memcpys
|
| 74 |
// FIXME: Find out why setting buffer-list to true breaks rtp so badly, DON'T SET THIS TO TRUE
|
| 75 |
// this bug might have been fixed with (in gst-plugins-base) on oct. 16th
|
| 76 |
// so expected in gst-plugins-base-0.10.26
|
| 77 |
// commit 7bca2a001941798c1a4005ee37802708ed13c225
|
| 78 |
//
|
| 79 |
// rtp: Correct timestamping of buffers when buffer_lists are used
|
| 80 |
//
|
| 81 |
// The timestamping of buffers when buffer_lists are used failed if
|
| 82 |
// a buffer did not have both a timestamp and an offset.
|
| 83 |
//
|
| 84 |
// g_object_set(rtpPay_, "buffer-list", TRUE, NULL);
|
| 85 |
// The default of true works fine for perfect-rtptime
|
| 86 |
// g_object_set(rtpPay_, "perfect-rtptime", FALSE, NULL);
|
| 87 |
} |
| 88 |
|
| 89 |
|
| 90 |
Mpeg4Depay::Mpeg4Depay(const Pipeline &pipeline)
|
| 91 |
{
|
| 92 |
rtpPay_ = pipeline.makeElement("rtpmp4vdepay", NULL); |
| 93 |
} |
| 94 |
|
| 95 |
|
| 96 |
VorbisPay::VorbisPay(const Pipeline &pipeline)
|
| 97 |
{
|
| 98 |
rtpPay_ = pipeline.makeElement("rtpvorbispay", NULL); |
| 99 |
g_object_set(G_OBJECT(rtpPay_), "max-ptime", Pay::MAX_PTIME, NULL); |
| 100 |
} |
| 101 |
|
| 102 |
|
| 103 |
VorbisDepay::VorbisDepay(const Pipeline &pipeline)
|
| 104 |
{
|
| 105 |
rtpPay_ = pipeline.makeElement("rtpvorbisdepay", NULL); |
| 106 |
} |
| 107 |
|
| 108 |
CeltPay::CeltPay(const Pipeline &pipeline)
|
| 109 |
{
|
| 110 |
rtpPay_ = pipeline.makeElement("rtpceltpay", NULL); |
| 111 |
g_object_set(G_OBJECT(rtpPay_), "max-ptime", Pay::MAX_PTIME, NULL); |
| 112 |
} |
| 113 |
|
| 114 |
CeltDepay::CeltDepay(const Pipeline &pipeline)
|
| 115 |
{
|
| 116 |
rtpPay_ = pipeline.makeElement("rtpceltdepay", NULL); |
| 117 |
} |
| 118 |
|
| 119 |
L16Pay::L16Pay(const Pipeline &pipeline)
|
| 120 |
{
|
| 121 |
rtpPay_ = pipeline.makeElement("rtpL16pay", NULL); |
| 122 |
g_object_set(G_OBJECT(rtpPay_), "max-ptime", Pay::MAX_PTIME, NULL); |
| 123 |
} |
| 124 |
|
| 125 |
|
| 126 |
L16Depay::L16Depay(const Pipeline &pipeline)
|
| 127 |
{
|
| 128 |
rtpPay_ = pipeline.makeElement("rtpL16depay", NULL); |
| 129 |
} |
| 130 |
|
| 131 |
|
| 132 |
MpaPay::MpaPay(const Pipeline &pipeline)
|
| 133 |
{
|
| 134 |
rtpPay_ = pipeline.makeElement("rtpmpapay", NULL); |
| 135 |
} |
| 136 |
|
| 137 |
|
| 138 |
MpaDepay::MpaDepay(const Pipeline &pipeline)
|
| 139 |
{
|
| 140 |
rtpPay_ = pipeline.makeElement("rtpmpadepay", NULL); |
| 141 |
} |
| 142 |
|
