Closed
Bug 815226
Opened 12 years ago
Closed 12 years ago
Make the MediaPluginReader not depend on the concrete type of the AbstractMediaDecoder passed to it
Categories
(Core :: Audio/Video, defect)
Tracking
()
RESOLVED
FIXED
mozilla20
People
(Reporter: ehsan.akhgari, Assigned: ehsan.akhgari)
References
Details
Attachments
(1 file, 1 obsolete file)
(deleted),
patch
|
cpearce
:
review+
|
Details | Diff | Splinter Review |
My fix to bug 813637 was sort of a dirty hack which will actually fail when we have decoder objects which are not MediaPluginDecoders. We should just put GetContentType in a C++ interface and try to QI for it.
Assignee | ||
Comment 1•12 years ago
|
||
Comment 2•12 years ago
|
||
Comment on attachment 685251 [details] [diff] [review]
Patch (v1)
Review of attachment 685251 [details] [diff] [review]:
-----------------------------------------------------------------
Could you instead just pass MediaPluginDecoder::mType to the MediaPluginReader constructor, and use that to init MediaPluginReader::mType, rather than retrieving it from MediaPluginDecoder?
Comment 3•12 years ago
|
||
Assuming what I said in comment 2 works, please also add a comment to warn against regressing this.
I still don't get why the cast from bug 813637 didn't work.
You could also try changing the type passed into MediaPluginReader::MediaPluginReader from AbstractMediaDecoder to MediaPluginDecoder, then the cast would happen in code that understands the layout of MediaPluginDecoder?
Assignee | ||
Comment 4•12 years ago
|
||
(In reply to Chris Pearce (:cpearce) from comment #3)
> Assuming what I said in comment 2 works, please also add a comment to warn
> against regressing this.
OK, let me see what I can do.
> I still don't get why the cast from bug 813637 didn't work.
AbstractMediaDecoder is the second base of MediaDecoder, so the cast should modify the address stored in the pointer to be one word less than the value passed to the function, which static_cast does correctly, but reinterpret_cast doesn't.
The reason that static_cast is not the right fix is that it's assuming that it knows what the concrete type of the object passed to MediaPluginReader::MediaPluginReader is, which is the wrong assumption when my decodeAudioData stuff lands.
> You could also try changing the type passed into
> MediaPluginReader::MediaPluginReader from AbstractMediaDecoder to
> MediaPluginDecoder, then the cast would happen in code that understands the
> layout of MediaPluginDecoder?
Well I could do that, but that would defeat the purpose of AbstractMediaDecoder entirely, and prevent me from using MediaPluginReader for web audio. But I think just making the constructor take the content type as a second argument would work fine. I'll attach a patch soon.
Assignee | ||
Comment 5•12 years ago
|
||
OK, this is definitely much better!
Attachment #685251 -
Attachment is obsolete: true
Attachment #685251 -
Flags: review?(cpearce)
Attachment #685302 -
Flags: review?(cpearce)
Comment 6•12 years ago
|
||
Comment on attachment 685302 [details] [diff] [review]
Patch (v2)
Review of attachment 685302 [details] [diff] [review]:
-----------------------------------------------------------------
Sweet.
Attachment #685302 -
Flags: review?(cpearce) → review+
Assignee | ||
Comment 7•12 years ago
|
||
Comment 8•12 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla20
You need to log in
before you can comment on or make changes to this bug.
Description
•