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 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 | 80 |
81 /******************************/ | 81 /******************************/ |
82 /* VCMGenericEncoder class */ | 82 /* VCMGenericEncoder class */ |
83 /******************************/ | 83 /******************************/ |
84 class VCMGenericEncoder | 84 class VCMGenericEncoder |
85 { | 85 { |
86 friend class VCMCodecDataBase; | 86 friend class VCMCodecDataBase; |
87 public: | 87 public: |
88 VCMGenericEncoder(VideoEncoder* encoder, | 88 VCMGenericEncoder(VideoEncoder* encoder, |
89 VideoEncoderRateObserver* rate_observer, | 89 VideoEncoderRateObserver* rate_observer, |
| 90 VCMEncodedFrameCallback* encoded_frame_callback, |
90 bool internalSource); | 91 bool internalSource); |
91 ~VCMGenericEncoder(); | 92 ~VCMGenericEncoder(); |
92 /** | 93 /** |
93 * Free encoder memory | 94 * Free encoder memory |
94 */ | 95 */ |
95 int32_t Release(); | 96 int32_t Release(); |
96 /** | 97 /** |
97 * Initialize the encoder with the information from the VideoCodec | 98 * Initialize the encoder with the information from the VideoCodec |
98 */ | 99 */ |
99 int32_t InitEncode(const VideoCodec* settings, | 100 int32_t InitEncode(const VideoCodec* settings, |
100 int32_t numberOfCores, | 101 int32_t numberOfCores, |
101 size_t maxPayloadSize); | 102 size_t maxPayloadSize); |
102 /** | 103 /** |
103 * Encode raw image | 104 * Encode raw image |
104 * inputFrame : Frame containing raw image | 105 * inputFrame : Frame containing raw image |
105 * codecSpecificInfo : Specific codec data | 106 * codecSpecificInfo : Specific codec data |
106 * cameraFrameRate : Request or information from the remote side | 107 * cameraFrameRate : Request or information from the remote side |
107 * frameType : The requested frame type to encode | 108 * frameType : The requested frame type to encode |
108 */ | 109 */ |
109 int32_t Encode(const VideoFrame& inputFrame, | 110 int32_t Encode(const VideoFrame& inputFrame, |
110 const CodecSpecificInfo* codecSpecificInfo, | 111 const CodecSpecificInfo* codecSpecificInfo, |
111 const std::vector<FrameType>& frameTypes); | 112 const std::vector<FrameType>& frameTypes); |
112 | 113 |
113 void SetEncoderParameters(const EncoderParameters& params); | 114 void SetEncoderParameters(const EncoderParameters& params); |
114 /** | |
115 * Register a transport callback which will be called to deliver the encoded | |
116 * buffers | |
117 */ | |
118 int32_t RegisterEncodeCallback( | |
119 VCMEncodedFrameCallback* VCMencodedFrameCallback); | |
120 | |
121 EncoderParameters GetEncoderParameters() const; | 115 EncoderParameters GetEncoderParameters() const; |
122 | 116 |
123 int32_t SetPeriodicKeyFrames(bool enable); | 117 int32_t SetPeriodicKeyFrames(bool enable); |
124 | 118 |
125 int32_t RequestFrame(const std::vector<FrameType>& frame_types); | 119 int32_t RequestFrame(const std::vector<FrameType>& frame_types); |
126 | 120 |
127 bool InternalSource() const; | 121 bool InternalSource() const; |
128 | 122 |
129 void OnDroppedFrame(); | 123 void OnDroppedFrame(); |
130 | 124 |
131 bool SupportsNativeHandle() const; | 125 bool SupportsNativeHandle() const; |
132 | 126 |
133 int GetTargetFramerate(); | 127 int GetTargetFramerate(); |
134 | 128 |
135 private: | 129 private: |
136 VideoEncoder* const encoder_; | 130 VideoEncoder* const encoder_; |
137 VideoEncoderRateObserver* const rate_observer_; | 131 VideoEncoderRateObserver* const rate_observer_; |
138 VCMEncodedFrameCallback* vcm_encoded_frame_callback_; | 132 VCMEncodedFrameCallback* const vcm_encoded_frame_callback_; |
139 EncoderParameters encoder_params_ GUARDED_BY(params_lock_); | |
140 const bool internal_source_; | 133 const bool internal_source_; |
141 mutable rtc::CriticalSection params_lock_; | 134 mutable rtc::CriticalSection params_lock_; |
| 135 EncoderParameters encoder_params_ GUARDED_BY(params_lock_); |
142 VideoRotation rotation_; | 136 VideoRotation rotation_; |
143 bool is_screenshare_; | 137 bool is_screenshare_; |
144 }; // end of VCMGenericEncoder class | 138 }; // end of VCMGenericEncoder class |
145 | 139 |
146 } // namespace webrtc | 140 } // namespace webrtc |
147 | 141 |
148 #endif // WEBRTC_MODULES_VIDEO_CODING_GENERIC_ENCODER_H_ | 142 #endif // WEBRTC_MODULES_VIDEO_CODING_GENERIC_ENCODER_H_ |
OLD | NEW |