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 8e26a8b1afa51874caa3f39d9edf2ba788fa6b88..f7196f04c5aeca6f153376063bd7fb438996973f 100644 |
--- a/webrtc/modules/video_coding/generic_decoder.h |
+++ b/webrtc/modules/video_coding/generic_decoder.h |
@@ -11,6 +11,8 @@ |
#ifndef WEBRTC_MODULES_VIDEO_CODING_GENERIC_DECODER_H_ |
#define WEBRTC_MODULES_VIDEO_CODING_GENERIC_DECODER_H_ |
+#include <memory> |
+ |
#include "webrtc/base/criticalsection.h" |
#include "webrtc/base/thread_checker.h" |
#include "webrtc/modules/include/module_common_types.h" |
@@ -73,8 +75,6 @@ class VCMDecodedFrameCallback : public DecodedImageCallback { |
}; |
class VCMGenericDecoder { |
- friend class VCMCodecDataBase; |
- |
public: |
explicit VCMGenericDecoder(VideoDecoder* decoder, bool isExternal = false); |
~VCMGenericDecoder(); |
@@ -92,26 +92,23 @@ class VCMGenericDecoder { |
int32_t Decode(const VCMEncodedFrame& inputFrame, int64_t nowMs); |
/** |
- * Free the decoder memory |
- */ |
- int32_t Release(); |
- |
- /** |
* Set decode callback. Deregistering while decoding is illegal. |
*/ |
int32_t RegisterDecodeCompleteCallback(VCMDecodedFrameCallback* callback); |
bool External() const; |
bool PrefersLateDecoding() const; |
+ bool IsSameDecoder(VideoDecoder* decoder) const { |
+ return decoder_.get() == decoder; |
+ } |
private: |
VCMDecodedFrameCallback* _callback; |
VCMFrameInformation _frameInfos[kDecoderFrameMemoryLength]; |
uint32_t _nextFrameInfoIdx; |
- VideoDecoder* const _decoder; |
+ std::unique_ptr<VideoDecoder> decoder_; |
VideoCodecType _codecType; |
- bool _isExternal; |
- bool _keyFrameDecoded; |
+ const bool _isExternal; |
VideoContentType _last_keyframe_content_type; |
}; |