aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-sbc.c
diff options
context:
space:
mode:
authorMichal Labedzki <michal.labedzki@tieto.com>2014-11-12 11:57:12 +0100
committerMichal Labedzki <michal.labedzki@tieto.com>2014-11-14 10:28:22 +0000
commitf1dee59d6661dc9538819209607e7884c45049b9 (patch)
treeee6911c2f2d620fbb6d69cb0433ac5880fd26262 /epan/dissectors/packet-sbc.c
parentad1977bc197b9695d05f11f4975d0aa27d10c90b (diff)
Bluetooth: A2DP: Add AVRCP song position indicator
"sbc.avrcp_song_position" can be used to determine time synchronization between AVRCP and A2DP. It is updated on every AVRCP PlaybackPositionChanged. Also provide version for aptx. Change-Id: I48cd49f0fee54131a738290e2a70a24d33ba1d22 Reviewed-on: https://code.wireshark.org/review/5290 Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
Diffstat (limited to 'epan/dissectors/packet-sbc.c')
-rw-r--r--epan/dissectors/packet-sbc.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/epan/dissectors/packet-sbc.c b/epan/dissectors/packet-sbc.c
index 8e57f58942..b308be1083 100644
--- a/epan/dissectors/packet-sbc.c
+++ b/epan/dissectors/packet-sbc.c
@@ -62,6 +62,7 @@ static int hf_sbc_cummulative_frame_duration = -1;
static int hf_sbc_delta_time = -1;
static int hf_sbc_delta_time_from_the_beginning = -1;
static int hf_sbc_cummulative_duration = -1;
+static int hf_sbc_avrcp_song_position = -1;
static int hf_sbc_diff = -1;
static int hf_sbc_data = -1;
@@ -252,13 +253,19 @@ dissect_sbc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
proto_item_append_text(pitem, " ms");
PROTO_ITEM_SET_GENERATED(pitem);
+ pitem = proto_tree_add_double(sbc_tree, hf_sbc_avrcp_song_position, tvb, offset, 0, info->previous_media_packet_info->avrcp_song_position);
+ proto_item_append_text(pitem, " ms");
+ PROTO_ITEM_SET_GENERATED(pitem);
+
nstime_delta(&delta, &pinfo->fd->abs_ts, &info->previous_media_packet_info->first_abs_ts);
pitem = proto_tree_add_double(sbc_tree, hf_sbc_delta_time_from_the_beginning, tvb, offset, 0, nstime_to_msec(&delta));
proto_item_append_text(pitem, " ms");
PROTO_ITEM_SET_GENERATED(pitem);
- if (!pinfo->fd->flags.visited)
+ if (!pinfo->fd->flags.visited) {
info->current_media_packet_info->cummulative_frame_duration += cummulative_frame_duration;
+ info->current_media_packet_info->avrcp_song_position += cummulative_frame_duration;
+ }
pitem = proto_tree_add_double(sbc_tree, hf_sbc_cummulative_duration, tvb, offset, 0, info->previous_media_packet_info->cummulative_frame_duration);
proto_item_append_text(pitem, " ms");
@@ -378,6 +385,11 @@ proto_register_sbc(void)
FT_DOUBLE, BASE_NONE, NULL, 0x00,
NULL, HFILL }
},
+ { &hf_sbc_avrcp_song_position,
+ { "AVRCP Song Position", "sbc.avrcp_song_position",
+ FT_DOUBLE, BASE_NONE, NULL, 0x00,
+ NULL, HFILL }
+ },
{ &hf_sbc_diff,
{ "Diff", "sbc.diff",
FT_DOUBLE, BASE_NONE, NULL, 0x00,