diff options
author | Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl> | 2015-11-13 11:59:40 +0100 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2015-11-16 10:05:46 +0200 |
commit | 4384b35f4382a9d8b2597e5f6baeb62287cbff96 (patch) | |
tree | 0b871ceb06b7f2b2c9af793daf9898d67fdd960e | |
parent | 101b439a6a3815d0ffcaa86ac0b099ef9061778a (diff) | |
download | bluez-4384b35f4382a9d8b2597e5f6baeb62287cbff96.tar.gz |
tools/avinfo: Print content protection
-rw-r--r-- | tools/avinfo.c | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/tools/avinfo.c b/tools/avinfo.c index cc756f101..31c4e106e 100644 --- a/tools/avinfo.c +++ b/tools/avinfo.c @@ -74,6 +74,10 @@ #define AVDTP_MEDIA_TYPE_VIDEO 0x01 #define AVDTP_MEDIA_TYPE_MULTIMEDIA 0x02 +/* Content Protection types definitions */ +#define AVDTP_CONTENT_PROTECTION_TYPE_DTCP 0x0001 +#define AVDTP_CONTENT_PROTECTION_TYPE_SCMS_T 0x0002 + struct avdtp_service_capability { uint8_t category; uint8_t length; @@ -158,6 +162,11 @@ struct getcap_resp { uint8_t caps[0]; } __attribute__ ((packed)); +struct avdtp_content_protection_capability { + uint16_t content_protection_type; + uint8_t data[0]; +} __attribute__ ((packed)); + static void print_aptx(a2dp_aptx_t *aptx) { printf("\t\tVendor Specific Value (aptX)"); @@ -405,6 +414,25 @@ static void print_media_codec(struct avdtp_media_codec_capability *cap) } } +static void print_content_protection( + struct avdtp_content_protection_capability *cap) +{ + printf("\tContent Protection: "); + + switch (btohs(cap->content_protection_type)) { + case AVDTP_CONTENT_PROTECTION_TYPE_DTCP: + printf("DTCP"); + break; + case AVDTP_CONTENT_PROTECTION_TYPE_SCMS_T: + printf("SCMS-T"); + break; + default: + printf("Unknown"); + } + + printf("\n"); +} + static void print_caps(void *data, int size) { int processed; @@ -423,13 +451,15 @@ static void print_caps(void *data, int size) case AVDTP_MEDIA_TRANSPORT: case AVDTP_REPORTING: case AVDTP_RECOVERY: - case AVDTP_CONTENT_PROTECTION: case AVDTP_MULTIPLEXING: /* FIXME: Add proper functions */ break; case AVDTP_MEDIA_CODEC: print_media_codec((void *) cap->data); break; + case AVDTP_CONTENT_PROTECTION: + print_content_protection((void *) cap->data); + break; } processed += 2 + cap->length; |