Closed Bug 1062666 Opened 10 years ago Closed 10 years ago

Debugging aid for MSE data handling

Categories

(Core :: Audio/Video, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla35

People

(Reporter: kinetik, Assigned: kinetik)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 2 obsolete files)

When debugging particular classes of bugs, it'd be useful to dump each chunk of data appended to a SourceBuffer to disk for later inspection/reconstruction.  This would consist of a directory tree for each MediaSource, then each SourceBuffer, then each TrackBuffer and each decoder.  A log of which chunks were appended to what in which order (for, e.g. later replay) would also be useful along with the raw data.
Attached patch wip (obsolete) — Splinter Review
Attached patch is already useful for debugging.  Given $mse is a pointer to a MediaSource object, invoking:

    p (('mozilla::dom::MediaSource'*)$mse)->Dump("/path/to/use/mse-debug")

The dump code assumes /path/to/use exists, and will create "mse-debug" and a tree below it containing each ResourceItem for each MediaDecoderReader for each TrackBuffer.
Cleaned up slightly.  This is already useful enough to land, so I'll request review after a try push.
Attachment #8486226 - Attachment is obsolete: true
(In reply to Matthew Gregan [:kinetik] from comment #4)
> https://tbpl.mozilla.org/?tree=Try&rev=46e44e3f7bd9

Killed, darn unified builds.
Attachment #8486819 - Attachment is obsolete: true
Assignee: nobody → kinetik
Status: NEW → ASSIGNED
Attachment #8486844 - Flags: review?(cajbir.bugzilla)
Comment on attachment 8486844 [details] [diff] [review]
Add a debug-only dump method to MediaSource for debugging issues with appended data

Review of attachment 8486844 [details] [diff] [review]:
-----------------------------------------------------------------

::: content/media/mediasource/MediaSource.cpp
@@ +516,5 @@
> +void
> +MediaSource::Dump(const char* aPath)
> +{
> +  char buf[255];
> +  sprintf(buf, "%s/mediasource-%p", aPath, this);

Use PR_snprintf (or similar function that handles the size of 'buf') in places throughout where sprintf is used.

::: content/media/mediasource/MediaSource.h
@@ +98,5 @@
>    // initialization.
>    void QueueInitializationEvent();
>  
> +#if defined(DEBUG)
> +  void Dump(const char* aPath);

Add a comment explaining what this function is for and what it does to the given path. How to call it from gdb as you describe in comment 2 would also be useful.
Attachment #8486844 - Flags: review?(cajbir.bugzilla) → review+
Backed out, my try push was opt only, which isn't that useful for stuff hidden behind DEBUG.
https://hg.mozilla.org/mozilla-central/rev/0a3666402f8b
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla35
Flags: qe-verify-
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: