Index: webrtc/modules/video_coding/generic_encoder.h |
diff --git a/webrtc/modules/video_coding/generic_encoder.h b/webrtc/modules/video_coding/generic_encoder.h |
index 5346b638c39488cf8e04130e9a3d21616b0e13d3..f739edb44fe478dee0fea11cb1c85d62c74a2f86 100644 |
--- a/webrtc/modules/video_coding/generic_encoder.h |
+++ b/webrtc/modules/video_coding/generic_encoder.h |
@@ -11,11 +11,12 @@ |
#ifndef WEBRTC_MODULES_VIDEO_CODING_GENERIC_ENCODER_H_ |
#define WEBRTC_MODULES_VIDEO_CODING_GENERIC_ENCODER_H_ |
+#include <stdio.h> |
+#include <vector> |
+ |
#include "webrtc/modules/video_coding/include/video_codec_interface.h" |
#include "webrtc/modules/video_coding/include/video_coding_defines.h" |
-#include <stdio.h> |
- |
#include "webrtc/base/criticalsection.h" |
#include "webrtc/base/scoped_ptr.h" |
@@ -36,10 +37,10 @@ struct EncoderParameters { |
/*************************************/ |
/* VCMEncodeFrameCallback class */ |
/***********************************/ |
-class VCMEncodedFrameCallback : public EncodedImageCallback |
-{ |
-public: |
- VCMEncodedFrameCallback(EncodedImageCallback* post_encode_callback); |
+class VCMEncodedFrameCallback : public EncodedImageCallback { |
+ public: |
+ explicit VCMEncodedFrameCallback( |
+ EncodedImageCallback* post_encode_callback); |
virtual ~VCMEncodedFrameCallback(); |
/* |
@@ -56,16 +57,21 @@ public: |
/** |
* Set media Optimization |
*/ |
- void SetMediaOpt (media_optimization::MediaOptimization* mediaOpt); |
+ void SetMediaOpt(media_optimization::MediaOptimization* mediaOpt); |
+ |
+ void SetPayloadType(uint8_t payloadType) { |
+ _payloadType = payloadType; |
+ } |
- void SetPayloadType(uint8_t payloadType) { _payloadType = payloadType; }; |
- void SetInternalSource(bool internalSource) { _internalSource = internalSource; }; |
+ void SetInternalSource(bool internalSource) { |
+ _internalSource = internalSource; |
+ } |
void SetRotation(VideoRotation rotation) { _rotation = rotation; } |
void SignalLastEncoderImplementationUsed( |
const char* encoder_implementation_name); |
-private: |
+ private: |
VCMPacketizationCallback* send_callback_; |
media_optimization::MediaOptimization* _mediaOpt; |
uint8_t _payloadType; |
@@ -77,68 +83,67 @@ private: |
#ifdef DEBUG_ENCODER_BIT_STREAM |
FILE* _bitStreamAfterEncoder; |
#endif |
-};// end of VCMEncodeFrameCallback class |
- |
+}; // end of VCMEncodeFrameCallback class |
/******************************/ |
/* VCMGenericEncoder class */ |
/******************************/ |
-class VCMGenericEncoder |
-{ |
- friend class VCMCodecDataBase; |
-public: |
- VCMGenericEncoder(VideoEncoder* encoder, |
- VideoEncoderRateObserver* rate_observer, |
- VCMEncodedFrameCallback* encoded_frame_callback, |
- bool internalSource); |
- ~VCMGenericEncoder(); |
- /** |
- * Free encoder memory |
- */ |
- int32_t Release(); |
- /** |
- * Initialize the encoder with the information from the VideoCodec |
- */ |
- int32_t InitEncode(const VideoCodec* settings, |
- int32_t numberOfCores, |
- size_t maxPayloadSize); |
- /** |
- * Encode raw image |
- * inputFrame : Frame containing raw image |
- * codecSpecificInfo : Specific codec data |
- * cameraFrameRate : Request or information from the remote side |
- * frameType : The requested frame type to encode |
- */ |
- int32_t Encode(const VideoFrame& inputFrame, |
- const CodecSpecificInfo* codecSpecificInfo, |
- const std::vector<FrameType>& frameTypes); |
- |
- void SetEncoderParameters(const EncoderParameters& params); |
- EncoderParameters GetEncoderParameters() const; |
- |
- int32_t SetPeriodicKeyFrames(bool enable); |
- |
- int32_t RequestFrame(const std::vector<FrameType>& frame_types); |
- |
- bool InternalSource() const; |
- |
- void OnDroppedFrame(); |
- |
- bool SupportsNativeHandle() const; |
- |
- int GetTargetFramerate(); |
- |
-private: |
- VideoEncoder* const encoder_; |
- VideoEncoderRateObserver* const rate_observer_; |
- VCMEncodedFrameCallback* const vcm_encoded_frame_callback_; |
- const bool internal_source_; |
- mutable rtc::CriticalSection params_lock_; |
- EncoderParameters encoder_params_ GUARDED_BY(params_lock_); |
- VideoRotation rotation_; |
- bool is_screenshare_; |
-}; // end of VCMGenericEncoder class |
+class VCMGenericEncoder { |
+ friend class VCMCodecDataBase; |
+ |
+ public: |
+ VCMGenericEncoder(VideoEncoder* encoder, |
+ VideoEncoderRateObserver* rate_observer, |
+ VCMEncodedFrameCallback* encoded_frame_callback, |
+ bool internalSource); |
+ ~VCMGenericEncoder(); |
+ /** |
+ * Free encoder memory |
+ */ |
+ int32_t Release(); |
+ /** |
+ * Initialize the encoder with the information from the VideoCodec |
+ */ |
+ int32_t InitEncode(const VideoCodec* settings, |
+ int32_t numberOfCores, |
+ size_t maxPayloadSize); |
+ /** |
+ * Encode raw image |
+ * inputFrame : Frame containing raw image |
+ * codecSpecificInfo : Specific codec data |
+ * cameraFrameRate : Request or information from the remote side |
+ * frameType : The requested frame type to encode |
+ */ |
+ int32_t Encode(const VideoFrame& inputFrame, |
+ const CodecSpecificInfo* codecSpecificInfo, |
+ const std::vector<FrameType>& frameTypes); |
+ |
+ void SetEncoderParameters(const EncoderParameters& params); |
+ EncoderParameters GetEncoderParameters() const; |
+ |
+ int32_t SetPeriodicKeyFrames(bool enable); |
+ |
+ int32_t RequestFrame(const std::vector<FrameType>& frame_types); |
+ |
+ bool InternalSource() const; |
+ |
+ void OnDroppedFrame(); |
+ |
+ bool SupportsNativeHandle() const; |
+ |
+ int GetTargetFramerate(); |
+ |
+ private: |
+ VideoEncoder* const encoder_; |
+ VideoEncoderRateObserver* const rate_observer_; |
+ VCMEncodedFrameCallback* const vcm_encoded_frame_callback_; |
+ const bool internal_source_; |
+ mutable rtc::CriticalSection params_lock_; |
+ EncoderParameters encoder_params_ GUARDED_BY(params_lock_); |
+ VideoRotation rotation_; |
+ bool is_screenshare_; |
+}; // end of VCMGenericEncoder class |
} // namespace webrtc |
-#endif // WEBRTC_MODULES_VIDEO_CODING_GENERIC_ENCODER_H_ |
+#endif // WEBRTC_MODULES_VIDEO_CODING_GENERIC_ENCODER_H_ |