OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 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 21 matching lines...) Expand all Loading... |
32 size_t max_payload_size) override; | 32 size_t max_payload_size) override; |
33 | 33 |
34 int32_t RegisterEncodeCompleteCallback( | 34 int32_t RegisterEncodeCompleteCallback( |
35 EncodedImageCallback* callback) override; | 35 EncodedImageCallback* callback) override; |
36 | 36 |
37 int32_t Release() override; | 37 int32_t Release() override; |
38 int32_t Encode(const VideoFrame& frame, | 38 int32_t Encode(const VideoFrame& frame, |
39 const CodecSpecificInfo* codec_specific_info, | 39 const CodecSpecificInfo* codec_specific_info, |
40 const std::vector<FrameType>* frame_types) override; | 40 const std::vector<FrameType>* frame_types) override; |
41 int32_t SetChannelParameters(uint32_t packet_loss, int64_t rtt) override; | 41 int32_t SetChannelParameters(uint32_t packet_loss, int64_t rtt) override; |
42 | 42 int32_t SetRateAllocation(const BitrateAllocation& bitrate_allocation, |
43 int32_t SetRates(uint32_t bitrate, uint32_t framerate) override; | 43 uint32_t framerate) override; |
44 void OnDroppedFrame() override; | 44 void OnDroppedFrame() override; |
45 bool SupportsNativeHandle() const override; | 45 bool SupportsNativeHandle() const override; |
46 | 46 |
47 private: | 47 private: |
48 bool InitFallbackEncoder(); | 48 bool InitFallbackEncoder(); |
49 | 49 |
50 // Settings used in the last InitEncode call and used if a dynamic fallback to | 50 // Settings used in the last InitEncode call and used if a dynamic fallback to |
51 // software is required. | 51 // software is required. |
52 VideoCodec codec_settings_; | 52 VideoCodec codec_settings_; |
53 int32_t number_of_cores_; | 53 int32_t number_of_cores_; |
54 size_t max_payload_size_; | 54 size_t max_payload_size_; |
55 | 55 |
56 // The last bitrate/framerate set, and a flag for noting they are set. | 56 // The last bitrate/framerate set, and a flag for noting they are set. |
57 bool rates_set_; | 57 bool rates_set_; |
58 uint32_t bitrate_; | 58 BitrateAllocation bitrate_allocation_; |
59 uint32_t framerate_; | 59 uint32_t framerate_; |
60 | 60 |
61 // The last channel parameters set, and a flag for noting they are set. | 61 // The last channel parameters set, and a flag for noting they are set. |
62 bool channel_parameters_set_; | 62 bool channel_parameters_set_; |
63 uint32_t packet_loss_; | 63 uint32_t packet_loss_; |
64 int64_t rtt_; | 64 int64_t rtt_; |
65 | 65 |
66 const EncoderType encoder_type_; | 66 const EncoderType encoder_type_; |
67 webrtc::VideoEncoder* const encoder_; | 67 webrtc::VideoEncoder* const encoder_; |
68 | 68 |
69 std::unique_ptr<webrtc::VideoEncoder> fallback_encoder_; | 69 std::unique_ptr<webrtc::VideoEncoder> fallback_encoder_; |
70 std::string fallback_implementation_name_; | 70 std::string fallback_implementation_name_; |
71 EncodedImageCallback* callback_; | 71 EncodedImageCallback* callback_; |
72 }; | 72 }; |
73 | 73 |
74 } // namespace webrtc | 74 } // namespace webrtc |
75 | 75 |
76 #endif // WEBRTC_MEDIA_ENGINE_VIDEOENCODERSOFTWAREFALLBACKWRAPPER_H_ | 76 #endif // WEBRTC_MEDIA_ENGINE_VIDEOENCODERSOFTWAREFALLBACKWRAPPER_H_ |
OLD | NEW |