aboutsummaryrefslogtreecommitdiffstats
path: root/ui/qt/rtp_audio_stream.h
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2015-10-26 08:34:58 -0700
committerGerald Combs <gerald@wireshark.org>2015-10-27 18:00:32 +0000
commit2ccb9d2d957a6c118c00a193d0fbe19712153208 (patch)
tree42d36e350b002ecedea7c32fe198e1e3fa4875a8 /ui/qt/rtp_audio_stream.h
parent25de4422c6c7bac10d0375a9ebdc2bd180dd733d (diff)
Add jitter logic to RtpAudioStream.
Copy the jitter logic from rtp_player.c to rtp_audio_stream.cpp. This still isn't correct but the RTP player should now be complete enough to start looking at the bug list at the top of rtp_player_dialog.cpp. Disable timing and jitter controls while we're playing while we're here. Fixes bug 11635. Bug: 11635 Change-Id: Ie583ade522702cbe1bbcea4475a535caa1d74fa2 Reviewed-on: https://code.wireshark.org/review/11295 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'ui/qt/rtp_audio_stream.h')
-rw-r--r--ui/qt/rtp_audio_stream.h53
1 files changed, 52 insertions, 1 deletions
diff --git a/ui/qt/rtp_audio_stream.h b/ui/qt/rtp_audio_stream.h
index f329870161..063332c0d1 100644
--- a/ui/qt/rtp_audio_stream.h
+++ b/ui/qt/rtp_audio_stream.h
@@ -48,6 +48,8 @@ class RtpAudioStream : public QObject
{
Q_OBJECT
public:
+ enum TimingMode { JitterBuffer, RtpTimestamp, Uninterrupted };
+
explicit RtpAudioStream(QObject *parent, struct _rtp_stream_info *rtp_stream);
~RtpAudioStream();
bool isMatch(const struct _rtp_stream_info *rtp_stream) const;
@@ -88,6 +90,45 @@ public:
*/
const QVector<double> outOfSequenceSamples(int y_offset = 0);
+ /**
+ * @brief Return a list of jitter dropped timestamps.
+ * @return A set of timestamps suitable for passing to QCPGraph::setData.
+ */
+ const QVector<double> jitterDroppedTimestamps(bool relative = true);
+ int jitterDropped() { return jitter_drop_timestamps_.size(); }
+ /**
+ * @brief Return a list of jitter dropped samples. Y value is constant.
+ * @param y_offset Y axis offset to be used for stacking graphs.
+ * @return A set of values suitable for passing to QCPGraph::setData.
+ */
+ const QVector<double> jitterDroppedSamples(int y_offset = 0);
+
+ /**
+ * @brief Return a list of wrong timestamps.
+ * @return A set of timestamps suitable for passing to QCPGraph::setData.
+ */
+ const QVector<double> wrongTimestampTimestamps(bool relative = true);
+ int wrongTimestamps() { return wrong_timestamp_timestamps_.size(); }
+ /**
+ * @brief Return a list of wrong timestamp samples. Y value is constant.
+ * @param y_offset Y axis offset to be used for stacking graphs.
+ * @return A set of values suitable for passing to QCPGraph::setData.
+ */
+ const QVector<double> wrongTimestampSamples(int y_offset = 0);
+
+ /**
+ * @brief Return a list of inserted silence timestamps.
+ * @return A set of timestamps suitable for passing to QCPGraph::setData.
+ */
+ const QVector<double> insertedSilenceTimestamps(bool relative = true);
+ int insertedSilences() { return silence_timestamps_.size(); }
+ /**
+ * @brief Return a list of wrong timestamp samples. Y value is constant.
+ * @param y_offset Y axis offset to be used for stacking graphs.
+ * @return A set of values suitable for passing to QCPGraph::setData.
+ */
+ const QVector<double> insertedSilenceSamples(int y_offset = 0);
+
quint32 nearestPacket(double timestamp, bool is_relative = true);
QRgb color() { return color_; }
@@ -95,6 +136,9 @@ public:
QAudio::State outputState() const;
+ void setJitterBufferSize(int jitter_buffer_size) { jitter_buffer_size_ = jitter_buffer_size; }
+ void setTimingMode(TimingMode timing_mode) { timing_mode_ = timing_mode; }
+
signals:
void startedPlaying();
void processedSecs(double secs);
@@ -114,7 +158,6 @@ private:
quint32 ssrc_;
QVector<struct _rtp_packet *>rtp_packets_;
- int last_sequence_;
QTemporaryFile *tempfile_;
struct _GHashTable *decoders_hash_;
QList<const struct _rtp_stream_info *>rtp_streams_;
@@ -130,9 +173,17 @@ private:
QMap<double, quint32> packet_timestamps_;
QVector<qint16> visual_samples_;
QVector<double> out_of_seq_timestamps_;
+ QVector<double> jitter_drop_timestamps_;
+ QVector<double> wrong_timestamp_timestamps_;
+ QVector<double> silence_timestamps_;
qint16 max_sample_val_;
QRgb color_;
+ int jitter_buffer_size_;
+ TimingMode timing_mode_;
+
+ void writeSilence(int samples);
+
private slots:
void outputStateChanged();
void outputNotify();