OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 #ifndef WEBRTC_VIDEO_VIE_ENCODER_H_ | 11 #ifndef WEBRTC_VIDEO_VIE_ENCODER_H_ |
12 #define WEBRTC_VIDEO_VIE_ENCODER_H_ | 12 #define WEBRTC_VIDEO_VIE_ENCODER_H_ |
13 | 13 |
14 #include <memory> | 14 #include <memory> |
15 #include <vector> | 15 #include <vector> |
16 | 16 |
17 #include "webrtc/base/criticalsection.h" | 17 #include "webrtc/base/criticalsection.h" |
18 #include "webrtc/base/scoped_ref_ptr.h" | 18 #include "webrtc/base/scoped_ref_ptr.h" |
19 #include "webrtc/base/thread_annotations.h" | 19 #include "webrtc/base/thread_annotations.h" |
20 #include "webrtc/common_types.h" | 20 #include "webrtc/common_types.h" |
21 #include "webrtc/frame_callback.h" | 21 #include "webrtc/frame_callback.h" |
22 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" | 22 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" |
23 #include "webrtc/modules/video_coding/include/video_coding_defines.h" | 23 #include "webrtc/modules/video_coding/include/video_coding_defines.h" |
| 24 #include "webrtc/modules/video_coding/utility/ivf_file_writer.h" |
24 #include "webrtc/modules/video_processing/include/video_processing.h" | 25 #include "webrtc/modules/video_processing/include/video_processing.h" |
25 #include "webrtc/typedefs.h" | 26 #include "webrtc/typedefs.h" |
26 | 27 |
27 namespace webrtc { | 28 namespace webrtc { |
28 | 29 |
29 class Config; | 30 class Config; |
30 class EncodedImageCallback; | 31 class EncodedImageCallback; |
31 class OveruseFrameDetector; | 32 class OveruseFrameDetector; |
32 class PacedSender; | 33 class PacedSender; |
33 class PayloadRouter; | 34 class PayloadRouter; |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 void RegisterPostEncodeImageCallback( | 110 void RegisterPostEncodeImageCallback( |
110 EncodedImageCallback* post_encode_callback); | 111 EncodedImageCallback* post_encode_callback); |
111 | 112 |
112 int GetPaddingNeededBps() const; | 113 int GetPaddingNeededBps() const; |
113 | 114 |
114 void OnBitrateUpdated(uint32_t bitrate_bps, | 115 void OnBitrateUpdated(uint32_t bitrate_bps, |
115 uint8_t fraction_lost, | 116 uint8_t fraction_lost, |
116 int64_t round_trip_time_ms); | 117 int64_t round_trip_time_ms); |
117 | 118 |
118 private: | 119 private: |
| 120 static const bool kEnableFrameRecording = false; |
| 121 static const int kMaxLayers = 3; |
| 122 |
119 bool EncoderPaused() const EXCLUSIVE_LOCKS_REQUIRED(data_cs_); | 123 bool EncoderPaused() const EXCLUSIVE_LOCKS_REQUIRED(data_cs_); |
120 void TraceFrameDropStart() EXCLUSIVE_LOCKS_REQUIRED(data_cs_); | 124 void TraceFrameDropStart() EXCLUSIVE_LOCKS_REQUIRED(data_cs_); |
121 void TraceFrameDropEnd() EXCLUSIVE_LOCKS_REQUIRED(data_cs_); | 125 void TraceFrameDropEnd() EXCLUSIVE_LOCKS_REQUIRED(data_cs_); |
122 | 126 |
123 const uint32_t number_of_cores_; | 127 const uint32_t number_of_cores_; |
124 const std::vector<uint32_t> ssrcs_; | 128 const std::vector<uint32_t> ssrcs_; |
125 | 129 |
126 const std::unique_ptr<VideoProcessing> vp_; | 130 const std::unique_ptr<VideoProcessing> vp_; |
127 const std::unique_ptr<QMVideoSettingsCallback> qm_callback_; | 131 const std::unique_ptr<QMVideoSettingsCallback> qm_callback_; |
128 const std::unique_ptr<VideoCodingModule> vcm_; | 132 const std::unique_ptr<VideoCodingModule> vcm_; |
(...skipping 19 matching lines...) Expand all Loading... |
148 std::vector<int64_t> time_last_intra_request_ms_ GUARDED_BY(data_cs_); | 152 std::vector<int64_t> time_last_intra_request_ms_ GUARDED_BY(data_cs_); |
149 | 153 |
150 ProcessThread* module_process_thread_; | 154 ProcessThread* module_process_thread_; |
151 | 155 |
152 bool has_received_sli_ GUARDED_BY(data_cs_); | 156 bool has_received_sli_ GUARDED_BY(data_cs_); |
153 uint8_t picture_id_sli_ GUARDED_BY(data_cs_); | 157 uint8_t picture_id_sli_ GUARDED_BY(data_cs_); |
154 bool has_received_rpsi_ GUARDED_BY(data_cs_); | 158 bool has_received_rpsi_ GUARDED_BY(data_cs_); |
155 uint64_t picture_id_rpsi_ GUARDED_BY(data_cs_); | 159 uint64_t picture_id_rpsi_ GUARDED_BY(data_cs_); |
156 | 160 |
157 bool video_suspended_ GUARDED_BY(data_cs_); | 161 bool video_suspended_ GUARDED_BY(data_cs_); |
| 162 |
| 163 std::unique_ptr<IvfFileWriter> file_writers_[kMaxLayers]; |
158 }; | 164 }; |
159 | 165 |
160 } // namespace webrtc | 166 } // namespace webrtc |
161 | 167 |
162 #endif // WEBRTC_VIDEO_VIE_ENCODER_H_ | 168 #endif // WEBRTC_VIDEO_VIE_ENCODER_H_ |
OLD | NEW |