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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 | 70 |
71 static VideoCodingModule* Create( | 71 static VideoCodingModule* Create( |
72 Clock* clock, | 72 Clock* clock, |
73 VideoEncoderRateObserver* encoder_rate_observer, | 73 VideoEncoderRateObserver* encoder_rate_observer, |
74 VCMQMSettingsCallback* qm_settings_callback); | 74 VCMQMSettingsCallback* qm_settings_callback); |
75 | 75 |
76 static VideoCodingModule* Create(Clock* clock, EventFactory* event_factory); | 76 static VideoCodingModule* Create(Clock* clock, EventFactory* event_factory); |
77 | 77 |
78 static void Destroy(VideoCodingModule* module); | 78 static void Destroy(VideoCodingModule* module); |
79 | 79 |
80 // Get number of supported codecs | |
81 // | |
82 // Return value : Number of supported codecs | |
83 static uint8_t NumberOfCodecs(); | |
84 | |
85 // Get supported codec settings with using id | |
86 // | |
87 // Input: | |
88 // - listId : Id or index of the codec to look up | |
89 // - codec : Memory where the codec settings will be stored | |
90 // | |
91 // Return value : VCM_OK, on success | |
92 // VCM_PARAMETER_ERROR if codec not supported or id too | |
93 // high | |
94 static int32_t Codec(const uint8_t listId, VideoCodec* codec); | |
95 | |
96 // Get supported codec settings using codec type | 80 // Get supported codec settings using codec type |
97 // | 81 // |
98 // Input: | 82 // Input: |
99 // - codecType : The codec type to get settings for | 83 // - codecType : The codec type to get settings for |
100 // - codec : Memory where the codec settings will be stored | 84 // - codec : Memory where the codec settings will be stored |
101 // | 85 // |
102 // Return value : VCM_OK, on success | 86 // Return value : VCM_OK, on success |
103 // VCM_PARAMETER_ERROR if codec not supported | 87 // VCM_PARAMETER_ERROR if codec not supported |
104 static int32_t Codec(VideoCodecType codecType, VideoCodec* codec); | 88 static void Codec(VideoCodecType codecType, VideoCodec* codec); |
105 | 89 |
106 /* | 90 /* |
107 * Sender | 91 * Sender |
108 */ | 92 */ |
109 | 93 |
110 // Registers a codec to be used for encoding. Calling this | 94 // Registers a codec to be used for encoding. Calling this |
111 // API multiple times overwrites any previously registered codecs. | 95 // API multiple times overwrites any previously registered codecs. |
112 // | 96 // |
113 // NOTE: Must be called on the thread that constructed the VCM instance. | 97 // NOTE: Must be called on the thread that constructed the VCM instance. |
114 // | 98 // |
115 // Input: | 99 // Input: |
116 // - sendCodec : Settings for the codec to be registered. | 100 // - sendCodec : Settings for the codec to be registered. |
117 // - numberOfCores : The number of cores the codec is allowed | 101 // - numberOfCores : The number of cores the codec is allowed |
118 // to use. | 102 // to use. |
119 // - maxPayloadSize : The maximum size each payload is allowed | 103 // - maxPayloadSize : The maximum size each payload is allowed |
120 // to have. Usually MTU - overhead. | 104 // to have. Usually MTU - overhead. |
121 // | 105 // |
122 // Return value : VCM_OK, on success. | 106 // Return value : VCM_OK, on success. |
123 // < 0, on error. | 107 // < 0, on error. |
124 virtual int32_t RegisterSendCodec(const VideoCodec* sendCodec, | 108 virtual int32_t RegisterSendCodec(const VideoCodec* sendCodec, |
125 uint32_t numberOfCores, | 109 uint32_t numberOfCores, |
126 uint32_t maxPayloadSize) = 0; | 110 uint32_t maxPayloadSize) = 0; |
127 | 111 |
128 // Get the current send codec in use. | |
129 // | |
130 // If a codec has not been set yet, the |id| property of the return value | |
131 // will be 0 and |name| empty. | |
132 // | |
133 // NOTE: This method intentionally does not hold locks and minimizes data | |
134 // copying. It must be called on the thread where the VCM was constructed. | |
135 virtual const VideoCodec& GetSendCodec() const = 0; | |
136 | |
137 // DEPRECATED: Use GetSendCodec() instead. | |
138 // | |
139 // API to get the current send codec in use. | |
140 // | |
141 // Input: | |
142 // - currentSendCodec : Address where the sendCodec will be written. | |
143 // | |
144 // Return value : VCM_OK, on success. | |
145 // < 0, on error. | |
146 // | |
147 // NOTE: The returned codec information is not guaranteed to be current when | |
148 // the call returns. This method acquires a lock that is aligned with | |
149 // video encoding, so it should be assumed to be allowed to block for | |
150 // several milliseconds. | |
151 virtual int32_t SendCodec(VideoCodec* currentSendCodec) const = 0; | |
152 | |
153 // DEPRECATED: Use GetSendCodec() instead. | |
154 // | |
155 // API to get the current send codec type | |
156 // | |
157 // Return value : Codec type, on success. | |
158 // kVideoCodecUnknown, on error or if no send codec is set | |
159 // NOTE: Same notes apply as for SendCodec() above. | |
160 virtual VideoCodecType SendCodec() const = 0; | |
161 | |
162 // Register an external encoder object. This can not be used together with | 112 // Register an external encoder object. This can not be used together with |
163 // external decoder callbacks. | 113 // external decoder callbacks. |
164 // | 114 // |
165 // Input: | 115 // Input: |
166 // - externalEncoder : Encoder object to be used for encoding frames | 116 // - externalEncoder : Encoder object to be used for encoding frames |
167 // inserted | 117 // inserted |
168 // with the AddVideoFrame API. | 118 // with the AddVideoFrame API. |
169 // - payloadType : The payload type bound which this encoder is bound | 119 // - payloadType : The payload type bound which this encoder is bound |
170 // to. | 120 // to. |
171 // | 121 // |
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
560 EncodedImageCallback* observer) = 0; | 510 EncodedImageCallback* observer) = 0; |
561 virtual void RegisterPostEncodeImageCallback( | 511 virtual void RegisterPostEncodeImageCallback( |
562 EncodedImageCallback* post_encode_callback) = 0; | 512 EncodedImageCallback* post_encode_callback) = 0; |
563 // Releases pending decode calls, permitting faster thread shutdown. | 513 // Releases pending decode calls, permitting faster thread shutdown. |
564 virtual void TriggerDecoderShutdown() = 0; | 514 virtual void TriggerDecoderShutdown() = 0; |
565 }; | 515 }; |
566 | 516 |
567 } // namespace webrtc | 517 } // namespace webrtc |
568 | 518 |
569 #endif // WEBRTC_MODULES_VIDEO_CODING_INCLUDE_VIDEO_CODING_H_ | 519 #endif // WEBRTC_MODULES_VIDEO_CODING_INCLUDE_VIDEO_CODING_H_ |
OLD | NEW |