Do not hold a lock when calling VCMReceiveCallback::FrameToRender.

DecodedImageCallback is allowed to be called on a thread different from decoding thread. To avoid the deadlock in VCMDecodedFrameCallback::Decoded, VCMDecodedFrameCallback::_critSect  should not be held while calling VCMReceiveCallback::FrameToRender.

BUG=1832
R=stefan@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/1570004

Patch from Wu-Cheng Li <wuchengli@chromium.org>.

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4162 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
fischman@webrtc.org
2013-06-04 03:29:37 +00:00
parent 3ee13e4ac2
commit e001b57d84
2 changed files with 17 additions and 10 deletions

View File

@ -48,12 +48,12 @@ public:
int32_t Pop(uint32_t timestamp);
private:
// Protect |_receiveCallback| and |_timestampMap|.
CriticalSectionWrapper* _critSect;
Clock* _clock;
I420VideoFrame _frame;
VCMReceiveCallback* _receiveCallback;
VCMReceiveCallback* _receiveCallback; // Guarded by |_critSect|.
VCMTiming& _timing;
VCMTimestampMap _timestampMap;
VCMTimestampMap _timestampMap; // Guarded by |_critSect|.
uint64_t _lastReceivedPictureID;
};
@ -98,6 +98,9 @@ public:
int32_t SetCodecConfigParameters(const uint8_t* /*buffer*/,
int32_t /*size*/);
/**
* Set decode callback. Deregistering while decoding is illegal.
*/
int32_t RegisterDecodeCompleteCallback(VCMDecodedFrameCallback* callback);
bool External() const;