Index: webrtc/modules/video_coding/generic_decoder.h |
diff --git a/webrtc/modules/video_coding/generic_decoder.h b/webrtc/modules/video_coding/generic_decoder.h |
index fcfea7740ea98e006e866fe3e153928c72bcb399..a6fe9ce8873ac6acff9894f6221a797153bca5e1 100644 |
--- a/webrtc/modules/video_coding/generic_decoder.h |
+++ b/webrtc/modules/video_coding/generic_decoder.h |
@@ -18,7 +18,6 @@ |
#include "webrtc/modules/video_coding/include/video_codec_interface.h" |
#include "webrtc/modules/video_coding/timestamp_map.h" |
#include "webrtc/modules/video_coding/timing.h" |
-#include "webrtc/rtc_base/criticalsection.h" |
#include "webrtc/rtc_base/thread_checker.h" |
namespace webrtc { |
@@ -40,6 +39,7 @@ class VCMDecodedFrameCallback : public DecodedImageCallback { |
public: |
VCMDecodedFrameCallback(VCMTiming* timing, Clock* clock); |
~VCMDecodedFrameCallback() override; |
+ |
void SetUserReceiveCallback(VCMReceiveCallback* receiveCallback); |
VCMReceiveCallback* UserReceiveCallback(); |
@@ -59,7 +59,7 @@ class VCMDecodedFrameCallback : public DecodedImageCallback { |
private: |
rtc::ThreadChecker construction_thread_; |
- // Protect |_timestampMap|. |
+ rtc::ThreadChecker decoder_thread_; |
Clock* const _clock; |
// This callback must be set before the decoder thread starts running |
// and must only be unset when external threads (e.g decoder thread) |
@@ -67,10 +67,9 @@ class VCMDecodedFrameCallback : public DecodedImageCallback { |
// while there are more than one threads involved, it must be set |
// from the same thread, and therfore a lock is not required to access it. |
VCMReceiveCallback* _receiveCallback = nullptr; |
- VCMTiming* _timing; |
- rtc::CriticalSection lock_; |
- VCMTimestampMap _timestampMap GUARDED_BY(lock_); |
- uint64_t _lastReceivedPictureID; |
+ VCMTiming* _timing ACCESS_ON(decoder_thread_); |
+ VCMTimestampMap _timestampMap ACCESS_ON(decoder_thread_); |
+ uint64_t _lastReceivedPictureID ACCESS_ON(decoder_thread_); |
int64_t ntp_offset_; |
}; |
@@ -96,18 +95,24 @@ class VCMGenericDecoder { |
*/ |
int32_t RegisterDecodeCompleteCallback(VCMDecodedFrameCallback* callback); |
- bool External() const; |
bool PrefersLateDecoding() const; |
bool IsSameDecoder(VideoDecoder* decoder) const { |
return decoder_.get() == decoder; |
} |
+#if defined(WEBRTC_ANDROID) |
+ // See https://bugs.chromium.org/p/webrtc/issues/detail?id=7361 |
+ void PollDecodedFrames(); |
+#endif |
+ |
private: |
- VCMDecodedFrameCallback* _callback; |
- VCMFrameInformation _frameInfos[kDecoderFrameMemoryLength]; |
- uint32_t _nextFrameInfoIdx; |
+ rtc::ThreadChecker decoder_thread_; |
+ VCMDecodedFrameCallback* _callback ACCESS_ON(decoder_thread_); |
+ VCMFrameInformation _frameInfos[kDecoderFrameMemoryLength] ACCESS_ON( |
+ decoder_thread_); |
+ uint32_t _nextFrameInfoIdx ACCESS_ON(decoder_thread_); |
std::unique_ptr<VideoDecoder> decoder_; |
- VideoCodecType _codecType; |
+ VideoCodecType _codecType ACCESS_ON(decoder_thread_); |
const bool _isExternal; |
VideoContentType _last_keyframe_content_type; |
}; |