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 "webrtc/modules/video_coding/codecs/h264/include/h264.h" | |
16 | |
17 #include <memory> | 15 #include <memory> |
18 #include <vector> | 16 #include <vector> |
19 | 17 |
| 18 #include "webrtc/modules/video_coding/codecs/h264/include/h264.h" |
| 19 #include "webrtc/modules/video_coding/utility/h264_bitstream_parser.h" |
| 20 #include "webrtc/modules/video_coding/utility/quality_scaler.h" |
| 21 |
| 22 #include "third_party/openh264/src/codec/api/svc/codec_app_def.h" |
20 | 23 |
21 class ISVCEncoder; | 24 class ISVCEncoder; |
22 | 25 |
23 namespace webrtc { | 26 namespace webrtc { |
24 | 27 |
25 class H264EncoderImpl : public H264Encoder { | 28 class H264EncoderImpl : public H264Encoder { |
26 public: | 29 public: |
27 H264EncoderImpl(); | 30 H264EncoderImpl(); |
28 ~H264EncoderImpl() override; | 31 ~H264EncoderImpl() override; |
29 | 32 |
(...skipping 19 matching lines...) Expand all Loading... |
49 const CodecSpecificInfo* codec_specific_info, | 52 const CodecSpecificInfo* codec_specific_info, |
50 const std::vector<FrameType>* frame_types) override; | 53 const std::vector<FrameType>* frame_types) override; |
51 | 54 |
52 // Unsupported / Do nothing. | 55 // Unsupported / Do nothing. |
53 int32_t SetChannelParameters(uint32_t packet_loss, int64_t rtt) override; | 56 int32_t SetChannelParameters(uint32_t packet_loss, int64_t rtt) override; |
54 int32_t SetPeriodicKeyFrames(bool enable) override; | 57 int32_t SetPeriodicKeyFrames(bool enable) override; |
55 void OnDroppedFrame() override; | 58 void OnDroppedFrame() override; |
56 | 59 |
57 private: | 60 private: |
58 bool IsInitialized() const; | 61 bool IsInitialized() const; |
| 62 SEncParamExt CreateEncoderParams() const; |
59 | 63 |
| 64 webrtc::H264BitstreamParser h264_bitstream_parser_; |
| 65 QualityScaler quality_scaler_; |
60 // Reports statistics with histograms. | 66 // Reports statistics with histograms. |
61 void ReportInit(); | 67 void ReportInit(); |
62 void ReportError(); | 68 void ReportError(); |
63 | 69 |
64 ISVCEncoder* openh264_encoder_; | 70 ISVCEncoder* openh264_encoder_; |
65 VideoCodec codec_settings_; | 71 VideoCodec codec_settings_; |
| 72 int32_t number_of_cores_; |
66 | 73 |
67 EncodedImage encoded_image_; | 74 EncodedImage encoded_image_; |
68 std::unique_ptr<uint8_t[]> encoded_image_buffer_; | 75 std::unique_ptr<uint8_t[]> encoded_image_buffer_; |
69 EncodedImageCallback* encoded_image_callback_; | 76 EncodedImageCallback* encoded_image_callback_; |
70 | 77 |
71 bool has_reported_init_; | 78 bool has_reported_init_; |
72 bool has_reported_error_; | 79 bool has_reported_error_; |
73 }; | 80 }; |
74 | 81 |
75 } // namespace webrtc | 82 } // namespace webrtc |
76 | 83 |
77 #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 |