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 */ |
11 | 11 |
12 #ifndef WEBRTC_MODULES_VIDEO_CODING_CODECS_H264_H264_ENCODER_IMPL_H_ | 12 #ifndef WEBRTC_MODULES_VIDEO_CODING_CODECS_H264_H264_ENCODER_IMPL_H_ |
13 #define WEBRTC_MODULES_VIDEO_CODING_CODECS_H264_H264_ENCODER_IMPL_H_ | 13 #define WEBRTC_MODULES_VIDEO_CODING_CODECS_H264_H264_ENCODER_IMPL_H_ |
14 | 14 |
15 #include <memory> | 15 #include <memory> |
16 #include <vector> | 16 #include <vector> |
17 | 17 |
18 #include "webrtc/modules/video_coding/codecs/h264/include/h264.h" | 18 #include "webrtc/modules/video_coding/codecs/h264/include/h264.h" |
19 #include "webrtc/modules/video_coding/utility/h264_bitstream_parser.h" | 19 #include "webrtc/modules/video_coding/utility/h264_bitstream_parser.h" |
20 #include "webrtc/modules/video_coding/utility/quality_scaler.h" | |
21 | 20 |
22 #include "third_party/openh264/src/codec/api/svc/codec_app_def.h" | 21 #include "third_party/openh264/src/codec/api/svc/codec_app_def.h" |
23 | 22 |
24 class ISVCEncoder; | 23 class ISVCEncoder; |
25 | 24 |
26 namespace webrtc { | 25 namespace webrtc { |
27 | 26 |
28 class H264EncoderImpl : public H264Encoder { | 27 class H264EncoderImpl : public H264Encoder { |
magjed_webrtc
2016/10/07 12:02:54
Implement GetQPThresholds() for this class:
rtc::O
| |
29 public: | 28 public: |
30 H264EncoderImpl(); | 29 H264EncoderImpl(); |
31 ~H264EncoderImpl() override; | 30 ~H264EncoderImpl() override; |
32 | 31 |
33 // |max_payload_size| is ignored. | 32 // |max_payload_size| is ignored. |
34 // The following members of |codec_settings| are used. The rest are ignored. | 33 // The following members of |codec_settings| are used. The rest are ignored. |
35 // - codecType (must be kVideoCodecH264) | 34 // - codecType (must be kVideoCodecH264) |
36 // - targetBitrate | 35 // - targetBitrate |
37 // - maxFramerate | 36 // - maxFramerate |
38 // - width | 37 // - width |
(...skipping 18 matching lines...) Expand all Loading... | |
57 // Unsupported / Do nothing. | 56 // Unsupported / Do nothing. |
58 int32_t SetChannelParameters(uint32_t packet_loss, int64_t rtt) override; | 57 int32_t SetChannelParameters(uint32_t packet_loss, int64_t rtt) override; |
59 int32_t SetPeriodicKeyFrames(bool enable) override; | 58 int32_t SetPeriodicKeyFrames(bool enable) override; |
60 void OnDroppedFrame() override; | 59 void OnDroppedFrame() override; |
61 | 60 |
62 private: | 61 private: |
63 bool IsInitialized() const; | 62 bool IsInitialized() const; |
64 SEncParamExt CreateEncoderParams() const; | 63 SEncParamExt CreateEncoderParams() const; |
65 | 64 |
66 webrtc::H264BitstreamParser h264_bitstream_parser_; | 65 webrtc::H264BitstreamParser h264_bitstream_parser_; |
67 QualityScaler quality_scaler_; | |
68 // Reports statistics with histograms. | 66 // Reports statistics with histograms. |
69 void ReportInit(); | 67 void ReportInit(); |
70 void ReportError(); | 68 void ReportError(); |
71 | 69 |
72 ISVCEncoder* openh264_encoder_; | 70 ISVCEncoder* openh264_encoder_; |
73 VideoCodec codec_settings_; | 71 VideoCodec codec_settings_; |
74 int32_t number_of_cores_; | 72 int32_t number_of_cores_; |
75 | 73 |
76 EncodedImage encoded_image_; | 74 EncodedImage encoded_image_; |
77 std::unique_ptr<uint8_t[]> encoded_image_buffer_; | 75 std::unique_ptr<uint8_t[]> encoded_image_buffer_; |
78 EncodedImageCallback* encoded_image_callback_; | 76 EncodedImageCallback* encoded_image_callback_; |
79 | 77 |
80 bool has_reported_init_; | 78 bool has_reported_init_; |
81 bool has_reported_error_; | 79 bool has_reported_error_; |
82 }; | 80 }; |
83 | 81 |
84 } // namespace webrtc | 82 } // namespace webrtc |
85 | 83 |
86 #endif // WEBRTC_MODULES_VIDEO_CODING_CODECS_H264_H264_ENCODER_IMPL_H_ | 84 #endif // WEBRTC_MODULES_VIDEO_CODING_CODECS_H264_H264_ENCODER_IMPL_H_ |
OLD | NEW |