OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 * | 9 * |
10 */ | 10 */ |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 int32_t SetRates(uint32_t bitrate, uint32_t framerate) override; | 47 int32_t SetRates(uint32_t bitrate, uint32_t framerate) override; |
48 | 48 |
49 // The result of encoding - an EncodedImage and RTPFragmentationHeader - are | 49 // The result of encoding - an EncodedImage and RTPFragmentationHeader - are |
50 // passed to the encode complete callback. | 50 // passed to the encode complete callback. |
51 int32_t Encode(const VideoFrame& frame, | 51 int32_t Encode(const VideoFrame& frame, |
52 const CodecSpecificInfo* codec_specific_info, | 52 const CodecSpecificInfo* codec_specific_info, |
53 const std::vector<FrameType>* frame_types) override; | 53 const std::vector<FrameType>* frame_types) override; |
54 | 54 |
55 const char* ImplementationName() const override; | 55 const char* ImplementationName() const override; |
56 | 56 |
| 57 QualityScaler::Settings GetQPThresholds() const override; |
| 58 |
57 // Unsupported / Do nothing. | 59 // Unsupported / Do nothing. |
58 int32_t SetChannelParameters(uint32_t packet_loss, int64_t rtt) override; | 60 int32_t SetChannelParameters(uint32_t packet_loss, int64_t rtt) override; |
59 int32_t SetPeriodicKeyFrames(bool enable) override; | 61 int32_t SetPeriodicKeyFrames(bool enable) override; |
60 void OnDroppedFrame() override; | 62 void OnDroppedFrame() override; |
61 | 63 |
62 private: | 64 private: |
63 bool IsInitialized() const; | 65 bool IsInitialized() const; |
64 SEncParamExt CreateEncoderParams() const; | 66 SEncParamExt CreateEncoderParams() const; |
65 | 67 |
66 webrtc::H264BitstreamParser h264_bitstream_parser_; | 68 webrtc::H264BitstreamParser h264_bitstream_parser_; |
67 QualityScaler quality_scaler_; | |
68 // Reports statistics with histograms. | 69 // Reports statistics with histograms. |
69 void ReportInit(); | 70 void ReportInit(); |
70 void ReportError(); | 71 void ReportError(); |
71 | 72 |
72 ISVCEncoder* openh264_encoder_; | 73 ISVCEncoder* openh264_encoder_; |
73 VideoCodec codec_settings_; | 74 VideoCodec codec_settings_; |
74 int32_t number_of_cores_; | 75 int32_t number_of_cores_; |
75 | 76 |
76 EncodedImage encoded_image_; | 77 EncodedImage encoded_image_; |
77 std::unique_ptr<uint8_t[]> encoded_image_buffer_; | 78 std::unique_ptr<uint8_t[]> encoded_image_buffer_; |
78 EncodedImageCallback* encoded_image_callback_; | 79 EncodedImageCallback* encoded_image_callback_; |
79 | 80 |
80 bool has_reported_init_; | 81 bool has_reported_init_; |
81 bool has_reported_error_; | 82 bool has_reported_error_; |
82 }; | 83 }; |
83 | 84 |
84 } // namespace webrtc | 85 } // namespace webrtc |
85 | 86 |
86 #endif // WEBRTC_MODULES_VIDEO_CODING_CODECS_H264_H264_ENCODER_IMPL_H_ | 87 #endif // WEBRTC_MODULES_VIDEO_CODING_CODECS_H264_H264_ENCODER_IMPL_H_ |
OLD | NEW |