diff options
author | henrik.lundin@webrtc.org <henrik.lundin@webrtc.org> | 2014-11-04 08:53:10 +0000 |
---|---|---|
committer | henrik.lundin@webrtc.org <henrik.lundin@webrtc.org> | 2014-11-04 08:53:10 +0000 |
commit | dba94e18151cc387c12be460b29651022897e459 (patch) | |
tree | 3a4fa6e2724b5076b4a1eef4b224a15aed5ea9f7 | |
parent | deb9e492c3db34f9580f6799ac7fdd5bb72e3d1e (diff) | |
download | webrtc-dba94e18151cc387c12be460b29651022897e459.tar.gz |
Improving error message from neteq_rtpplay
If a packet with unknown RTP payload type is inserted, this CL
will make sure that the error message is a little more detailed
and gives a better understadning of what to do.
BUG=2692
R=tina.legrand@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/27909004
git-svn-id: http://webrtc.googlecode.com/svn/trunk/webrtc@7603 4adac7df-926f-26a2-2b94-8c16560cd09d
-rw-r--r-- | modules/audio_coding/neteq/interface/neteq.h | 2 | ||||
-rw-r--r-- | modules/audio_coding/neteq/neteq_impl.cc | 2 | ||||
-rw-r--r-- | modules/audio_coding/neteq/neteq_impl.h | 2 | ||||
-rw-r--r-- | modules/audio_coding/neteq/tools/neteq_rtpplay.cc | 20 |
4 files changed, 21 insertions, 5 deletions
diff --git a/modules/audio_coding/neteq/interface/neteq.h b/modules/audio_coding/neteq/interface/neteq.h index 925cb231..560e77ba 100644 --- a/modules/audio_coding/neteq/interface/neteq.h +++ b/modules/audio_coding/neteq/interface/neteq.h @@ -248,7 +248,7 @@ class NetEq { // Returns the error code for the last occurred error. If no error has // occurred, 0 is returned. - virtual int LastError() = 0; + virtual int LastError() const = 0; // Returns the error code last returned by a decoder (audio or comfort noise). // When LastError() returns kDecoderErrorCode or kComfortNoiseErrorCode, check diff --git a/modules/audio_coding/neteq/neteq_impl.cc b/modules/audio_coding/neteq/neteq_impl.cc index edf618ef..44faa22a 100644 --- a/modules/audio_coding/neteq/neteq_impl.cc +++ b/modules/audio_coding/neteq/neteq_impl.cc @@ -352,7 +352,7 @@ bool NetEqImpl::GetPlayoutTimestamp(uint32_t* timestamp) { return true; } -int NetEqImpl::LastError() { +int NetEqImpl::LastError() const { CriticalSectionScoped lock(crit_sect_.get()); return error_code_; } diff --git a/modules/audio_coding/neteq/neteq_impl.h b/modules/audio_coding/neteq/neteq_impl.h index fc2284d9..348f483c 100644 --- a/modules/audio_coding/neteq/neteq_impl.h +++ b/modules/audio_coding/neteq/neteq_impl.h @@ -178,7 +178,7 @@ class NetEqImpl : public webrtc::NetEq { // Returns the error code for the last occurred error. If no error has // occurred, 0 is returned. - virtual int LastError() OVERRIDE; + virtual int LastError() const OVERRIDE; // Returns the error code last returned by a decoder (audio or comfort noise). // When LastError() returns kDecoderErrorCode or kComfortNoiseErrorCode, check diff --git a/modules/audio_coding/neteq/tools/neteq_rtpplay.cc b/modules/audio_coding/neteq/tools/neteq_rtpplay.cc index 1015e177..ef2c0b6b 100644 --- a/modules/audio_coding/neteq/tools/neteq_rtpplay.cc +++ b/modules/audio_coding/neteq/tools/neteq_rtpplay.cc @@ -289,8 +289,24 @@ int main(int argc, char* argv[]) { static_cast<int>(payload_len), packet->time_ms() * sample_rate_hz / 1000); if (error != NetEq::kOK) { - std::cerr << "InsertPacket returned error code " << neteq->LastError() - << std::endl; + if (neteq->LastError() == NetEq::kUnknownRtpPayloadType) { + std::cerr << "RTP Payload type " + << static_cast<int>(rtp_header.header.payloadType) + << " is unknown." << std::endl; + std::cerr << "Use --codec_map to view default mapping." << std::endl; + std::cerr << "Use --helpshort for information on how to make custom " + "mappings." << std::endl; + } else { + std::cerr << "InsertPacket returned error code " << neteq->LastError() + << std::endl; + std::cerr << "Header data:" << std::endl; + std::cerr << " PT = " + << static_cast<int>(rtp_header.header.payloadType) + << std::endl; + std::cerr << " SN = " << rtp_header.header.sequenceNumber + << std::endl; + std::cerr << " TS = " << rtp_header.header.timestamp << std::endl; + } } // Get next packet from file. |