Closed Bug 830172 Opened 11 years ago Closed 11 years ago

Change WMFByteStream to use an nsThreadPool for async I/O operations

Categories

(Core :: Audio/Video, defect)

x86_64
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla21

People

(Reporter: cpearce, Assigned: cpearce)

References

Details

Attachments

(1 file)

WMFByteStream's async read implementation simply creates one WMF work queue per WMFByteStream. If we open too many WMFByteStreams at once (like test_too_many_elements does), the creation of work queues fails, and we fail to playback media. We can just use an nsThreadPool to perform the MediaResource I/O operations instead.

We use the byte stream's work queue to call the WMF "I/O complete" callbacks, we'll need to move these calls to a shared work queue.
Is this related to Bug 823646 ?
Nope.
* Use shared nsIThreadPool instead of MFWorkQueues for processing WMFByteStream async read requests.
* We use an nsIThreadPoolListener to ensure MSCOM is initialized and uninitialized on the work pool threads.
* Manage thread pool lifetime on the main thread.
* Fail reads if the byte stream has been shutdown.
* test_too_many_elements passes with MP3 and MP4 files.
Attachment #708825 - Flags: review?(paul)
(In reply to Chris Pearce (:cpearce) from comment #3)
> * test_too_many_elements passes with MP3 and MP4 files.

(It didn't before).
Comment on attachment 708825 [details] [diff] [review]
Patch v1: Use nsIThreadPool instead of MFWorkQueues.

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

::: content/media/wmf/WMFByteStream.cpp
@@ +128,5 @@
> +  if (!sThreadPool) {
> +    nsresult rv;
> +    nsCOMPtr<nsIThreadPool> pool = do_CreateInstance(NS_THREADPOOL_CONTRACTID, &rv);
> +    NS_ENSURE_SUCCESS(rv, rv);
> +  

nit: trailing space.
Attachment #708825 - Flags: review?(paul) → review+
https://hg.mozilla.org/mozilla-central/rev/8d404fcb334b
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla21
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: