Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1083)

Unified Diff: webrtc/modules/video_coding/generic_decoder.h

Issue 2744813002: Start documenting the threading model (Closed)
Patch Set: Convert thread checks in Android code to DCHECKs Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/modules/video_coding/frame_buffer2.cc ('k') | webrtc/modules/video_coding/generic_decoder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 48e25196e93d74b3618792c64d70a8239b2c5231..b50a22919b54ee50b6862f5d85318b2acb153b82 100644
--- a/webrtc/modules/video_coding/generic_decoder.h
+++ b/webrtc/modules/video_coding/generic_decoder.h
@@ -11,9 +11,11 @@
#ifndef WEBRTC_MODULES_VIDEO_CODING_GENERIC_DECODER_H_
#define WEBRTC_MODULES_VIDEO_CODING_GENERIC_DECODER_H_
+#include "webrtc/base/criticalsection.h"
+#include "webrtc/base/thread_checker.h"
#include "webrtc/modules/include/module_common_types.h"
-#include "webrtc/modules/video_coding/include/video_codec_interface.h"
#include "webrtc/modules/video_coding/encoded_frame.h"
+#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"
@@ -33,32 +35,35 @@ struct VCMFrameInformation {
class VCMDecodedFrameCallback : public DecodedImageCallback {
public:
VCMDecodedFrameCallback(VCMTiming* timing, Clock* clock);
- virtual ~VCMDecodedFrameCallback();
- void SetUserReceiveCallback(VCMReceiveCallback* receiveCallback);
- VCMReceiveCallback* UserReceiveCallback();
+ ~VCMDecodedFrameCallback() override;
+
+ void SetUserReceiveCallback(VCMReceiveCallback* receiveCallback);
+ VCMReceiveCallback* UserReceiveCallback();
- int32_t Decoded(VideoFrame& decodedImage) override;
- int32_t Decoded(VideoFrame& decodedImage, int64_t decode_time_ms) override;
- void Decoded(VideoFrame& decodedImage,
- rtc::Optional<int32_t> decode_time_ms,
- rtc::Optional<uint8_t> qp) override;
- int32_t ReceivedDecodedReferenceFrame(const uint64_t pictureId) override;
- int32_t ReceivedDecodedFrame(const uint64_t pictureId) override;
+ int32_t Decoded(VideoFrame& decodedImage) override;
+ int32_t Decoded(VideoFrame& decodedImage, int64_t decode_time_ms) override;
+ void Decoded(VideoFrame& decodedImage,
+ rtc::Optional<int32_t> decode_time_ms,
+ rtc::Optional<uint8_t> qp) override;
+ int32_t ReceivedDecodedReferenceFrame(const uint64_t pictureId) override;
+ int32_t ReceivedDecodedFrame(const uint64_t pictureId) override;
- uint64_t LastReceivedPictureID() const;
- void OnDecoderImplementationName(const char* implementation_name);
+ uint64_t LastReceivedPictureID() const;
+ void OnDecoderImplementationName(const char* implementation_name);
- void Map(uint32_t timestamp, VCMFrameInformation* frameInfo);
- int32_t Pop(uint32_t timestamp);
+ void Map(uint32_t timestamp, VCMFrameInformation* frameInfo);
+ int32_t Pop(uint32_t timestamp);
private:
- // Protect |_receiveCallback| and |_timestampMap|.
- CriticalSectionWrapper* _critSect;
- Clock* _clock;
- VCMReceiveCallback* _receiveCallback GUARDED_BY(_critSect);
- VCMTiming* _timing;
- VCMTimestampMap _timestampMap GUARDED_BY(_critSect);
- uint64_t _lastReceivedPictureID;
+ // Protect |_receiveCallback| and |_timestampMap|.
+ rtc::CriticalSection _critSect;
+ Clock* _clock;
+ VCMReceiveCallback* _receiveCallback GUARDED_BY(_critSect);
+ VCMTiming* _timing;
+ VCMTimestampMap _timestampMap GUARDED_BY(_critSect);
+ uint64_t _lastReceivedPictureID;
+ rtc::ThreadChecker decoder_thread_checker_;
+ rtc::ThreadChecker construction_thread_checker_;
};
class VCMGenericDecoder {
@@ -92,6 +97,7 @@ class VCMGenericDecoder {
bool External() const;
bool PrefersLateDecoding() const;
+ void PollDecodedFrames();
private:
VCMDecodedFrameCallback* _callback;
@@ -101,6 +107,7 @@ class VCMGenericDecoder {
VideoCodecType _codecType;
bool _isExternal;
bool _keyFrameDecoded;
+ rtc::ThreadChecker decoder_thread_checker_;
};
} // namespace webrtc
« no previous file with comments | « webrtc/modules/video_coding/frame_buffer2.cc ('k') | webrtc/modules/video_coding/generic_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698