Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(650)

Side by Side Diff: webrtc/modules/video_coding/main/source/generic_encoder.h

Issue 1424843002: Make VCMEncodedFrameCallback const. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 73
74 /******************************/ 74 /******************************/
75 /* VCMGenericEncoder class */ 75 /* VCMGenericEncoder class */
76 /******************************/ 76 /******************************/
77 class VCMGenericEncoder 77 class VCMGenericEncoder
78 { 78 {
79 friend class VCMCodecDataBase; 79 friend class VCMCodecDataBase;
80 public: 80 public:
81 VCMGenericEncoder(VideoEncoder* encoder, 81 VCMGenericEncoder(VideoEncoder* encoder,
82 VideoEncoderRateObserver* rate_observer, 82 VideoEncoderRateObserver* rate_observer,
83 VCMEncodedFrameCallback* encoded_frame_callback,
83 bool internalSource); 84 bool internalSource);
84 ~VCMGenericEncoder(); 85 ~VCMGenericEncoder();
85 /** 86 /**
86 * Free encoder memory 87 * Free encoder memory
87 */ 88 */
88 int32_t Release(); 89 int32_t Release();
89 /** 90 /**
90 * Initialize the encoder with the information from the VideoCodec 91 * Initialize the encoder with the information from the VideoCodec
91 */ 92 */
92 int32_t InitEncode(const VideoCodec* settings, 93 int32_t InitEncode(const VideoCodec* settings,
(...skipping 16 matching lines...) Expand all
109 // TODO(tommi): We could replace BitRate and FrameRate below with a GetRates 110 // TODO(tommi): We could replace BitRate and FrameRate below with a GetRates
110 // method that matches SetRates. For fetching current rates, we'd then only 111 // method that matches SetRates. For fetching current rates, we'd then only
111 // grab the lock once instead of twice. 112 // grab the lock once instead of twice.
112 int32_t SetRates(uint32_t target_bitrate, uint32_t frameRate); 113 int32_t SetRates(uint32_t target_bitrate, uint32_t frameRate);
113 /** 114 /**
114 * Set a new packet loss rate and a new round-trip time in milliseconds. 115 * Set a new packet loss rate and a new round-trip time in milliseconds.
115 */ 116 */
116 int32_t SetChannelParameters(int32_t packetLoss, int64_t rtt); 117 int32_t SetChannelParameters(int32_t packetLoss, int64_t rtt);
117 int32_t CodecConfigParameters(uint8_t* buffer, int32_t size); 118 int32_t CodecConfigParameters(uint8_t* buffer, int32_t size);
118 /** 119 /**
119 * Register a transport callback which will be called to deliver the encoded
120 * buffers
121 */
122 int32_t RegisterEncodeCallback(
123 VCMEncodedFrameCallback* VCMencodedFrameCallback);
124 /**
125 * Get encoder bit rate 120 * Get encoder bit rate
126 */ 121 */
127 uint32_t BitRate() const; 122 uint32_t BitRate() const;
128 /** 123 /**
129 * Get encoder frame rate 124 * Get encoder frame rate
130 */ 125 */
131 uint32_t FrameRate() const; 126 uint32_t FrameRate() const;
132 127
133 int32_t SetPeriodicKeyFrames(bool enable); 128 int32_t SetPeriodicKeyFrames(bool enable);
134 129
135 int32_t RequestFrame(const std::vector<FrameType>& frame_types); 130 int32_t RequestFrame(const std::vector<FrameType>& frame_types);
136 131
137 bool InternalSource() const; 132 bool InternalSource() const;
138 133
139 void OnDroppedFrame(); 134 void OnDroppedFrame();
140 135
141 bool SupportsNativeHandle() const; 136 bool SupportsNativeHandle() const;
142 137
143 int GetTargetFramerate(); 138 int GetTargetFramerate();
144 139
145 private: 140 private:
146 VideoEncoder* const encoder_; 141 VideoEncoder* const encoder_;
147 VideoEncoderRateObserver* const rate_observer_; 142 VideoEncoderRateObserver* const rate_observer_;
148 VCMEncodedFrameCallback* vcm_encoded_frame_callback_; 143 VCMEncodedFrameCallback* const vcm_encoded_frame_callback_;
149 uint32_t bit_rate_; 144 uint32_t bit_rate_;
150 uint32_t frame_rate_; 145 uint32_t frame_rate_;
151 const bool internal_source_; 146 const bool internal_source_;
152 mutable rtc::CriticalSection rates_lock_; 147 mutable rtc::CriticalSection rates_lock_;
153 VideoRotation rotation_; 148 VideoRotation rotation_;
154 bool is_screenshare_; 149 bool is_screenshare_;
155 }; // end of VCMGenericEncoder class 150 }; // end of VCMGenericEncoder class
156 151
157 } // namespace webrtc 152 } // namespace webrtc
158 153
159 #endif // WEBRTC_MODULES_VIDEO_CODING_GENERIC_ENCODER_H_ 154 #endif // WEBRTC_MODULES_VIDEO_CODING_GENERIC_ENCODER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698