Closed Bug 1324926 Opened 8 years ago Closed 8 years ago

[EME] Improve logging in EME/GMP modules

Categories

(Core :: Audio/Video: Playback, defect, P3)

defect

Tracking

()

RESOLVED FIXED
mozilla53
Tracking Status
firefox53 --- fixed

People

(Reporter: cpearce, Assigned: cpearce)

References

Details

Attachments

(4 files)

While debugging a Linux/Netflix issue, it seemed handy to improve logging of EME/GMP.
Attachment #8820444 - Flags: review?(gsquelart) → review+
Comment on attachment 8820445 [details] Bug 1324926 - Log keyId as hex when decoding video via GMP. https://reviewboard.mozilla.org/r/99942/#review100420
Attachment #8820445 - Flags: review?(gsquelart) → review+
Comment on attachment 8820446 [details] Bug 1324926 - Convert other EME/GMP byte logging from Base64 to Hex. https://reviewboard.mozilla.org/r/99944/#review100424
Attachment #8820446 - Flags: review?(gsquelart) → review+
Comment on attachment 8820447 [details] Bug 1324926 - Log expiration in terms of hours remaining in MediaKeySession.SetExpiration(). https://reviewboard.mozilla.org/r/99946/#review100426
Attachment #8820447 - Flags: review?(gsquelart) → review+
Pushed by cpearce@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/b0a59896aa01 Log Gecko version and buildID in GMP log. r=gerald https://hg.mozilla.org/integration/autoland/rev/1694d0248f1a Log keyId as hex when decoding video via GMP. r=gerald https://hg.mozilla.org/integration/autoland/rev/3a5fc19f492b Convert other EME/GMP byte logging from Base64 to Hex. r=gerald https://hg.mozilla.org/integration/autoland/rev/e57acea9a4ab Log expiration in terms of hours remaining in MediaKeySession.SetExpiration(). r=gerald
Pushed by cpearce@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/4b7650c9b073 Log Gecko version and buildID in GMP log. r=gerald https://hg.mozilla.org/integration/autoland/rev/c7e0e99464b4 Log keyId as hex when decoding video via GMP. r=gerald https://hg.mozilla.org/integration/autoland/rev/1fa993c1b9e7 Convert other EME/GMP byte logging from Base64 to Hex. r=gerald https://hg.mozilla.org/integration/autoland/rev/158945ebbebc Log expiration in terms of hours remaining in MediaKeySession.SetExpiration(). r=gerald
Comment on attachment 8820445 [details] Bug 1324926 - Log keyId as hex when decoding video via GMP. https://reviewboard.mozilla.org/r/99942/#review100508 ::: dom/media/gmp/GMPUtils.cpp:69 (Diff revision 2) > } > return base64; > } > > +nsCString > +ToHexString(const uint8_t * aBytes, uint32_t aLength) just find a extra white space uint8_t * aBytes,
Comment on attachment 8820445 [details] Bug 1324926 - Log keyId as hex when decoding video via GMP. https://reviewboard.mozilla.org/r/99942/#review100512 ::: dom/media/gmp/GMPUtils.cpp:80 (Diff revision 2) > + 'c', 'd', 'e', 'f' > + }; > + nsCString str; > + for (uint32_t i = 0; i < aLength; i++) { > + char buf[3]; > + buf[0] = hex[aBytes[i] & 0xf0 >> 4]; Hi Chris, Have you run this code locally and the shown the correct result ? For me, "& 0xf0" will be prompted into integer which means the length is 32bits. After shifting 4 bits, it larger than 0xFF which may cause a stack overflow, right?
It works for me locally. I would assume that when assigning to a char, the value would be converted to an 8 bit type. If this was a memcpy, I'd be more worried about a write out-of-bounds.
Flags: needinfo?(cpearce)
> > + buf[0] = hex[aBytes[i] & 0xf0 >> 4]; Doesn't >> have higher precedence than &?
Flags: needinfo?(cpearce)
Oh dear, I missed that one. Thanks David.
Flags: needinfo?(cpearce)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: