LCOV - code coverage report
Current view: top level - media/webrtc/trunk/webrtc/modules/video_coding - generic_encoder.h (source / functions) Hit Total Coverage
Test: output.info Lines: 0 4 0.0 %
Date: 2017-07-14 16:53:18 Functions: 0 2 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /*
       2             :  *  Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
       3             :  *
       4             :  *  Use of this source code is governed by a BSD-style license
       5             :  *  that can be found in the LICENSE file in the root of the source
       6             :  *  tree. An additional intellectual property rights grant can be found
       7             :  *  in the file PATENTS.  All contributing project authors may
       8             :  *  be found in the AUTHORS file in the root of the source tree.
       9             :  */
      10             : 
      11             : #ifndef WEBRTC_MODULES_VIDEO_CODING_GENERIC_ENCODER_H_
      12             : #define WEBRTC_MODULES_VIDEO_CODING_GENERIC_ENCODER_H_
      13             : 
      14             : #include <stdio.h>
      15             : #include <vector>
      16             : 
      17             : #include "webrtc/modules/video_coding/include/video_codec_interface.h"
      18             : #include "webrtc/modules/video_coding/include/video_coding_defines.h"
      19             : 
      20             : #include "webrtc/base/criticalsection.h"
      21             : #include "webrtc/base/race_checker.h"
      22             : 
      23             : namespace webrtc {
      24             : class CriticalSectionWrapper;
      25             : 
      26             : namespace media_optimization {
      27             : class MediaOptimization;
      28             : }  // namespace media_optimization
      29             : 
      30           0 : struct EncoderParameters {
      31             :   BitrateAllocation target_bitrate;
      32             :   uint8_t loss_rate;
      33             :   int64_t rtt;
      34             :   uint32_t input_frame_rate;
      35             : };
      36             : 
      37             : class VCMEncodedFrameCallback : public EncodedImageCallback {
      38             :  public:
      39             :   VCMEncodedFrameCallback(EncodedImageCallback* post_encode_callback,
      40             :                           media_optimization::MediaOptimization* media_opt);
      41             :   virtual ~VCMEncodedFrameCallback();
      42             : 
      43             :   // Implements EncodedImageCallback.
      44             :   EncodedImageCallback::Result OnEncodedImage(
      45             :       const EncodedImage& encoded_image,
      46             :       const CodecSpecificInfo* codec_specific_info,
      47             :       const RTPFragmentationHeader* fragmentation) override;
      48           0 :   void SetInternalSource(bool internal_source) {
      49           0 :     internal_source_ = internal_source;
      50           0 :   }
      51             : 
      52             :  private:
      53             :   bool internal_source_;
      54             :   EncodedImageCallback* const post_encode_callback_;
      55             :   media_optimization::MediaOptimization* const media_opt_;
      56             : };
      57             : 
      58             : class VCMGenericEncoder {
      59             :   friend class VCMCodecDataBase;
      60             : 
      61             :  public:
      62             :   VCMGenericEncoder(VideoEncoder* encoder,
      63             :                     VCMEncodedFrameCallback* encoded_frame_callback,
      64             :                     bool internal_source);
      65             :   ~VCMGenericEncoder();
      66             :   int32_t Release();
      67             :   int32_t InitEncode(const VideoCodec* settings,
      68             :                      int32_t number_of_cores,
      69             :                      size_t max_payload_size);
      70             :   int32_t Encode(const VideoFrame& frame,
      71             :                  const CodecSpecificInfo* codec_specific,
      72             :                  const std::vector<FrameType>& frame_types);
      73             : 
      74             :   void SetEncoderParameters(const EncoderParameters& params);
      75             :   EncoderParameters GetEncoderParameters() const;
      76             : 
      77             :   int32_t SetPeriodicKeyFrames(bool enable);
      78             :   int32_t RequestFrame(const std::vector<FrameType>& frame_types);
      79             :   bool InternalSource() const;
      80             :   void OnDroppedFrame();
      81             :   bool SupportsNativeHandle() const;
      82             : 
      83             :  private:
      84             :   rtc::RaceChecker race_checker_;
      85             : 
      86             :   VideoEncoder* const encoder_ GUARDED_BY(race_checker_);
      87             :   VCMEncodedFrameCallback* const vcm_encoded_frame_callback_;
      88             :   const bool internal_source_;
      89             :   rtc::CriticalSection params_lock_;
      90             :   EncoderParameters encoder_params_ GUARDED_BY(params_lock_);
      91             :   bool is_screenshare_;
      92             : };
      93             : 
      94             : }  // namespace webrtc
      95             : 
      96             : #endif  // WEBRTC_MODULES_VIDEO_CODING_GENERIC_ENCODER_H_

Generated by: LCOV version 1.13