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

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

Issue 2966823002: A few simplifications to CodecDatabase and VCMGenericDecoder (Closed)
Patch Set: Created 3 years, 6 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/codec_database.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 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;
};
« no previous file with comments | « webrtc/modules/video_coding/codec_database.cc ('k') | webrtc/modules/video_coding/generic_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698