Bug 1521964 Comment 9 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

(In reply to Mike Conley (:mconley) (:⚙️) from comment #7)

> (In reply to Sotaro Ikeda [:sotaro] from comment #4)
> > When I modified the GetVideoSize() as to return a valid size, video was shown to 2nd video element.
> 
>   I initially thought we could have the VideoSink hold a weak reference to the VideoFrameContainer, but that seems like a bad idea if the VideoSink / MediaDecoderStateMachine is mostly operating on a different thread (unless we have some thread-safe WeakRef capability that I'm not aware of).

thread-safe WeakRef exists as ThreadSafeWeakPtr. It was added by Bug 1404742. But it does not fit well to this use case, I think. Since the weak ref continue to exist in VideoSink.
(In reply to Mike Conley (:mconley) (:⚙️) from comment #7)

> (In reply to Sotaro Ikeda [:sotaro] from comment #4)
> > When I modified the GetVideoSize() as to return a valid size, video was shown to 2nd video element.
> 
>   I initially thought we could have the VideoSink hold a weak reference to the VideoFrameContainer, but that seems like a bad idea if the VideoSink / MediaDecoderStateMachine is mostly operating on a different thread (unless we have some thread-safe WeakRef capability that I'm not aware of).

thread-safe WeakRef exists as ThreadSafeWeakPtr. It was added by Bug 1404742. But it seems not fit well to this use case, I think. Since the weak ref continue to exist in VideoSink.
(In reply to Mike Conley (:mconley) (:⚙️) from comment #7)

> (In reply to Sotaro Ikeda [:sotaro] from comment #4)
> > When I modified the GetVideoSize() as to return a valid size, video was shown to 2nd video element.
> 
>   I initially thought we could have the VideoSink hold a weak reference to the VideoFrameContainer, but that seems like a bad idea if the VideoSink / MediaDecoderStateMachine is mostly operating on a different thread (unless we have some thread-safe WeakRef capability that I'm not aware of).

thread-safe WeakRef exists as ThreadSafeWeakPtr. It was added by Bug 1404742. But it seems not fit well to this use case, since the weak ref continue to exist in VideoSink.

Back to Bug 1521964 Comment 9