blob: 0c508b7739ab83f045f8d9a735de03310f13f7af [file] [log] [blame]
Henrik Kjellander2557b862015-11-18 22:00:21 +01001/*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3 *
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
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11#ifndef WEBRTC_MODULES_VIDEO_CODING_INCLUDE_VIDEO_CODING_H_
12#define WEBRTC_MODULES_VIDEO_CODING_INCLUDE_VIDEO_CODING_H_
13
14#if defined(WEBRTC_WIN)
15// This is a workaround on Windows due to the fact that some Windows
16// headers define CreateEvent as a macro to either CreateEventW or CreateEventA.
17// This can cause problems since we use that name as well and could
18// declare them as one thing here whereas in another place a windows header
19// may have been included and then implementing CreateEvent() causes compilation
20// errors. So for consistency, we include the main windows header here.
21#include <windows.h>
22#endif
23
24#include "webrtc/modules/include/module.h"
25#include "webrtc/modules/include/module_common_types.h"
26#include "webrtc/modules/video_coding/include/video_coding_defines.h"
27#include "webrtc/system_wrappers/include/event_wrapper.h"
28#include "webrtc/video_frame.h"
29
philipel9d3ab612015-12-21 04:12:39 -080030namespace webrtc {
Henrik Kjellander2557b862015-11-18 22:00:21 +010031
32class Clock;
33class EncodedImageCallback;
34class VideoEncoder;
35class VideoDecoder;
36struct CodecSpecificInfo;
37
38class EventFactory {
39 public:
40 virtual ~EventFactory() {}
41
42 virtual EventWrapper* CreateEvent() = 0;
43};
44
45class EventFactoryImpl : public EventFactory {
46 public:
47 virtual ~EventFactoryImpl() {}
48
philipel9d3ab612015-12-21 04:12:39 -080049 virtual EventWrapper* CreateEvent() { return EventWrapper::Create(); }
Henrik Kjellander2557b862015-11-18 22:00:21 +010050};
51
52// Used to indicate which decode with errors mode should be used.
53enum VCMDecodeErrorMode {
philipel9d3ab612015-12-21 04:12:39 -080054 kNoErrors, // Never decode with errors. Video will freeze
55 // if nack is disabled.
56 kSelectiveErrors, // Frames that are determined decodable in
57 // VCMSessionInfo may be decoded with missing
58 // packets. As not all incomplete frames will be
59 // decodable, video will freeze if nack is disabled.
60 kWithErrors // Release frames as needed. Errors may be
61 // introduced as some encoded frames may not be
62 // complete.
Henrik Kjellander2557b862015-11-18 22:00:21 +010063};
64
philipel9d3ab612015-12-21 04:12:39 -080065class VideoCodingModule : public Module {
66 public:
67 enum SenderNackMode { kNackNone, kNackAll, kNackSelective };
Henrik Kjellander2557b862015-11-18 22:00:21 +010068
philipel9d3ab612015-12-21 04:12:39 -080069 enum ReceiverRobustness { kNone, kHardNack, kSoftNack, kReferenceSelection };
Henrik Kjellander2557b862015-11-18 22:00:21 +010070
philipel9d3ab612015-12-21 04:12:39 -080071 static VideoCodingModule* Create(
72 Clock* clock,
73 VideoEncoderRateObserver* encoder_rate_observer,
74 VCMQMSettingsCallback* qm_settings_callback);
Henrik Kjellander2557b862015-11-18 22:00:21 +010075
philipel83f831a2016-03-12 03:30:23 -080076 static VideoCodingModule* Create(
77 Clock* clock,
78 VideoEncoderRateObserver* encoder_rate_observer,
79 VCMQMSettingsCallback* qm_settings_callback,
80 NackSender* nack_sender,
81 KeyFrameRequestSender* keyframe_request_sender);
82
philipel9d3ab612015-12-21 04:12:39 -080083 static VideoCodingModule* Create(Clock* clock, EventFactory* event_factory);
Henrik Kjellander2557b862015-11-18 22:00:21 +010084
philipel83f831a2016-03-12 03:30:23 -080085 static VideoCodingModule* Create(
86 Clock* clock,
87 EventFactory* event_factory,
88 NackSender* nack_sender,
89 KeyFrameRequestSender* keyframe_request_sender);
90
philipel9d3ab612015-12-21 04:12:39 -080091 // Get supported codec settings using codec type
92 //
93 // Input:
94 // - codecType : The codec type to get settings for
95 // - codec : Memory where the codec settings will be stored
96 //
97 // Return value : VCM_OK, on success
98 // VCM_PARAMETER_ERROR if codec not supported
Peter Boström7776e782016-01-07 15:42:47 +010099 static void Codec(VideoCodecType codecType, VideoCodec* codec);
Henrik Kjellander2557b862015-11-18 22:00:21 +0100100
philipel9d3ab612015-12-21 04:12:39 -0800101 /*
102 * Sender
103 */
Henrik Kjellander2557b862015-11-18 22:00:21 +0100104
philipel9d3ab612015-12-21 04:12:39 -0800105 // Registers a codec to be used for encoding. Calling this
106 // API multiple times overwrites any previously registered codecs.
107 //
108 // NOTE: Must be called on the thread that constructed the VCM instance.
109 //
110 // Input:
111 // - sendCodec : Settings for the codec to be registered.
112 // - numberOfCores : The number of cores the codec is allowed
113 // to use.
114 // - maxPayloadSize : The maximum size each payload is allowed
115 // to have. Usually MTU - overhead.
116 //
117 // Return value : VCM_OK, on success.
118 // < 0, on error.
119 virtual int32_t RegisterSendCodec(const VideoCodec* sendCodec,
120 uint32_t numberOfCores,
121 uint32_t maxPayloadSize) = 0;
Henrik Kjellander2557b862015-11-18 22:00:21 +0100122
philipel9d3ab612015-12-21 04:12:39 -0800123 // Register an external encoder object. This can not be used together with
124 // external decoder callbacks.
125 //
126 // Input:
127 // - externalEncoder : Encoder object to be used for encoding frames
128 // inserted
129 // with the AddVideoFrame API.
130 // - payloadType : The payload type bound which this encoder is bound
131 // to.
132 //
133 // Return value : VCM_OK, on success.
134 // < 0, on error.
135 // TODO(pbos): Remove return type when unused elsewhere.
136 virtual int32_t RegisterExternalEncoder(VideoEncoder* externalEncoder,
137 uint8_t payloadType,
138 bool internalSource = false) = 0;
Henrik Kjellander2557b862015-11-18 22:00:21 +0100139
philipel9d3ab612015-12-21 04:12:39 -0800140 // API to get currently configured encoder target bitrate in bits/s.
141 //
142 // Return value : 0, on success.
143 // < 0, on error.
144 virtual int Bitrate(unsigned int* bitrate) const = 0;
Henrik Kjellander2557b862015-11-18 22:00:21 +0100145
philipel9d3ab612015-12-21 04:12:39 -0800146 // API to get currently configured encoder target frame rate.
147 //
148 // Return value : 0, on success.
149 // < 0, on error.
150 virtual int FrameRate(unsigned int* framerate) const = 0;
Henrik Kjellander2557b862015-11-18 22:00:21 +0100151
philipel9d3ab612015-12-21 04:12:39 -0800152 // Sets the parameters describing the send channel. These parameters are
153 // inputs to the
154 // Media Optimization inside the VCM and also specifies the target bit rate
155 // for the
156 // encoder. Bit rate used by NACK should already be compensated for by the
157 // user.
158 //
159 // Input:
160 // - target_bitrate : The target bitrate for VCM in bits/s.
161 // - lossRate : Fractions of lost packets the past second.
162 // (loss rate in percent = 100 * packetLoss /
163 // 255)
164 // - rtt : Current round-trip time in ms.
165 //
166 // Return value : VCM_OK, on success.
167 // < 0, on error.
168 virtual int32_t SetChannelParameters(uint32_t target_bitrate,
169 uint8_t lossRate,
170 int64_t rtt) = 0;
Henrik Kjellander2557b862015-11-18 22:00:21 +0100171
philipel9d3ab612015-12-21 04:12:39 -0800172 // Sets the parameters describing the receive channel. These parameters are
173 // inputs to the
174 // Media Optimization inside the VCM.
175 //
176 // Input:
177 // - rtt : Current round-trip time in ms.
178 // with the most amount available bandwidth in
179 // a conference
180 // scenario
181 //
182 // Return value : VCM_OK, on success.
183 // < 0, on error.
184 virtual int32_t SetReceiveChannelParameters(int64_t rtt) = 0;
Henrik Kjellander2557b862015-11-18 22:00:21 +0100185
philipel9d3ab612015-12-21 04:12:39 -0800186 // Register a transport callback which will be called to deliver the encoded
187 // data and
188 // side information.
189 //
190 // Input:
191 // - transport : The callback object to register.
192 //
193 // Return value : VCM_OK, on success.
194 // < 0, on error.
195 virtual int32_t RegisterTransportCallback(
196 VCMPacketizationCallback* transport) = 0;
Henrik Kjellander2557b862015-11-18 22:00:21 +0100197
philipel9d3ab612015-12-21 04:12:39 -0800198 // Register video output information callback which will be called to deliver
199 // information
200 // about the video stream produced by the encoder, for instance the average
201 // frame rate and
202 // bit rate.
203 //
204 // Input:
205 // - outputInformation : The callback object to register.
206 //
207 // Return value : VCM_OK, on success.
208 // < 0, on error.
209 virtual int32_t RegisterSendStatisticsCallback(
210 VCMSendStatisticsCallback* sendStats) = 0;
Henrik Kjellander2557b862015-11-18 22:00:21 +0100211
philipel9d3ab612015-12-21 04:12:39 -0800212 // Register a video protection callback which will be called to deliver
213 // the requested FEC rate and NACK status (on/off).
214 //
215 // Input:
216 // - protection : The callback object to register.
217 //
218 // Return value : VCM_OK, on success.
219 // < 0, on error.
220 virtual int32_t RegisterProtectionCallback(
221 VCMProtectionCallback* protection) = 0;
Henrik Kjellander2557b862015-11-18 22:00:21 +0100222
philipel9d3ab612015-12-21 04:12:39 -0800223 // Enable or disable a video protection method.
224 //
225 // Input:
226 // - videoProtection : The method to enable or disable.
227 // - enable : True if the method should be enabled, false if
228 // it should be disabled.
229 //
230 // Return value : VCM_OK, on success.
231 // < 0, on error.
232 virtual int32_t SetVideoProtection(VCMVideoProtection videoProtection,
233 bool enable) = 0;
Henrik Kjellander2557b862015-11-18 22:00:21 +0100234
philipel9d3ab612015-12-21 04:12:39 -0800235 // Add one raw video frame to the encoder. This function does all the
236 // necessary
237 // processing, then decides what frame type to encode, or if the frame should
238 // be
239 // dropped. If the frame should be encoded it passes the frame to the encoder
240 // before it returns.
241 //
242 // Input:
243 // - videoFrame : Video frame to encode.
244 // - codecSpecificInfo : Extra codec information, e.g., pre-parsed
245 // in-band signaling.
246 //
247 // Return value : VCM_OK, on success.
248 // < 0, on error.
249 virtual int32_t AddVideoFrame(
250 const VideoFrame& videoFrame,
251 const VideoContentMetrics* contentMetrics = NULL,
252 const CodecSpecificInfo* codecSpecificInfo = NULL) = 0;
Henrik Kjellander2557b862015-11-18 22:00:21 +0100253
philipel9d3ab612015-12-21 04:12:39 -0800254 // Next frame encoded should be an intra frame (keyframe).
255 //
256 // Return value : VCM_OK, on success.
257 // < 0, on error.
258 virtual int32_t IntraFrameRequest(int stream_index) = 0;
Henrik Kjellander2557b862015-11-18 22:00:21 +0100259
philipel9d3ab612015-12-21 04:12:39 -0800260 // Frame Dropper enable. Can be used to disable the frame dropping when the
261 // encoder
262 // over-uses its bit rate. This API is designed to be used when the encoded
263 // frames
264 // are supposed to be stored to an AVI file, or when the I420 codec is used
265 // and the
266 // target bit rate shouldn't affect the frame rate.
267 //
268 // Input:
269 // - enable : True to enable the setting, false to disable it.
270 //
271 // Return value : VCM_OK, on success.
272 // < 0, on error.
273 virtual int32_t EnableFrameDropper(bool enable) = 0;
Henrik Kjellander2557b862015-11-18 22:00:21 +0100274
philipel9d3ab612015-12-21 04:12:39 -0800275 /*
276 * Receiver
277 */
Henrik Kjellander2557b862015-11-18 22:00:21 +0100278
philipel9d3ab612015-12-21 04:12:39 -0800279 // Register possible receive codecs, can be called multiple times for
280 // different codecs.
281 // The module will automatically switch between registered codecs depending on
282 // the
283 // payload type of incoming frames. The actual decoder will be created when
284 // needed.
285 //
286 // Input:
287 // - receiveCodec : Settings for the codec to be registered.
288 // - numberOfCores : Number of CPU cores that the decoder is allowed
289 // to use.
290 // - requireKeyFrame : Set this to true if you don't want any delta
291 // frames
292 // to be decoded until the first key frame has been
293 // decoded.
294 //
295 // Return value : VCM_OK, on success.
296 // < 0, on error.
297 virtual int32_t RegisterReceiveCodec(const VideoCodec* receiveCodec,
298 int32_t numberOfCores,
299 bool requireKeyFrame = false) = 0;
Henrik Kjellander2557b862015-11-18 22:00:21 +0100300
philipel9d3ab612015-12-21 04:12:39 -0800301 // Register an externally defined decoder/renderer object. Can be a decoder
302 // only or a
303 // decoder coupled with a renderer. Note that RegisterReceiveCodec must be
304 // called to
305 // be used for decoding incoming streams.
306 //
307 // Input:
308 // - externalDecoder : The external decoder/renderer object.
309 // - payloadType : The payload type which this decoder should
310 // be
311 // registered to.
312 //
313 virtual void RegisterExternalDecoder(VideoDecoder* externalDecoder,
314 uint8_t payloadType) = 0;
Henrik Kjellander2557b862015-11-18 22:00:21 +0100315
philipel9d3ab612015-12-21 04:12:39 -0800316 // Register a receive callback. Will be called whenever there is a new frame
317 // ready
318 // for rendering.
319 //
320 // Input:
321 // - receiveCallback : The callback object to be used by the
322 // module when a
323 // frame is ready for rendering.
324 // De-register with a NULL pointer.
325 //
326 // Return value : VCM_OK, on success.
327 // < 0, on error.
328 virtual int32_t RegisterReceiveCallback(
329 VCMReceiveCallback* receiveCallback) = 0;
Henrik Kjellander2557b862015-11-18 22:00:21 +0100330
philipel9d3ab612015-12-21 04:12:39 -0800331 // Register a receive statistics callback which will be called to deliver
332 // information
333 // about the video stream received by the receiving side of the VCM, for
334 // instance the
335 // average frame rate and bit rate.
336 //
337 // Input:
338 // - receiveStats : The callback object to register.
339 //
340 // Return value : VCM_OK, on success.
341 // < 0, on error.
342 virtual int32_t RegisterReceiveStatisticsCallback(
343 VCMReceiveStatisticsCallback* receiveStats) = 0;
Henrik Kjellander2557b862015-11-18 22:00:21 +0100344
philipel9d3ab612015-12-21 04:12:39 -0800345 // Register a decoder timing callback which will be called to deliver
346 // information about the timing of the decoder in the receiving side of the
347 // VCM, for instance the current and maximum frame decode latency.
348 //
349 // Input:
350 // - decoderTiming : The callback object to register.
351 //
352 // Return value : VCM_OK, on success.
353 // < 0, on error.
354 virtual int32_t RegisterDecoderTimingCallback(
355 VCMDecoderTimingCallback* decoderTiming) = 0;
Henrik Kjellander2557b862015-11-18 22:00:21 +0100356
philipel9d3ab612015-12-21 04:12:39 -0800357 // Register a frame type request callback. This callback will be called when
358 // the
359 // module needs to request specific frame types from the send side.
360 //
361 // Input:
362 // - frameTypeCallback : The callback object to be used by the
363 // module when
364 // requesting a specific type of frame from
365 // the send side.
366 // De-register with a NULL pointer.
367 //
368 // Return value : VCM_OK, on success.
369 // < 0, on error.
370 virtual int32_t RegisterFrameTypeCallback(
371 VCMFrameTypeCallback* frameTypeCallback) = 0;
Henrik Kjellander2557b862015-11-18 22:00:21 +0100372
philipel9d3ab612015-12-21 04:12:39 -0800373 // Registers a callback which is called whenever the receive side of the VCM
374 // encounters holes in the packet sequence and needs packets to be
375 // retransmitted.
376 //
377 // Input:
378 // - callback : The callback to be registered in the VCM.
379 //
380 // Return value : VCM_OK, on success.
381 // <0, on error.
382 virtual int32_t RegisterPacketRequestCallback(
383 VCMPacketRequestCallback* callback) = 0;
Henrik Kjellander2557b862015-11-18 22:00:21 +0100384
philipel9d3ab612015-12-21 04:12:39 -0800385 // Waits for the next frame in the jitter buffer to become complete
386 // (waits no longer than maxWaitTimeMs), then passes it to the decoder for
387 // decoding.
388 // Should be called as often as possible to get the most out of the decoder.
389 //
390 // Return value : VCM_OK, on success.
391 // < 0, on error.
392 virtual int32_t Decode(uint16_t maxWaitTimeMs = 200) = 0;
Henrik Kjellander2557b862015-11-18 22:00:21 +0100393
philipel9d3ab612015-12-21 04:12:39 -0800394 // Registers a callback which conveys the size of the render buffer.
395 virtual int RegisterRenderBufferSizeCallback(
396 VCMRenderBufferSizeCallback* callback) = 0;
Henrik Kjellander2557b862015-11-18 22:00:21 +0100397
philipel9d3ab612015-12-21 04:12:39 -0800398 // API to get the codec which is currently used for decoding by the module.
399 //
400 // Input:
401 // - currentReceiveCodec : Settings for the codec to be registered.
402 //
403 // Return value : VCM_OK, on success.
404 // < 0, on error.
405 virtual int32_t ReceiveCodec(VideoCodec* currentReceiveCodec) const = 0;
Henrik Kjellander2557b862015-11-18 22:00:21 +0100406
philipel9d3ab612015-12-21 04:12:39 -0800407 // API to get the codec type currently used for decoding by the module.
408 //
409 // Return value : codecy type, on success.
410 // kVideoCodecUnknown, on error or if no receive codec is
411 // registered
412 virtual VideoCodecType ReceiveCodec() const = 0;
Henrik Kjellander2557b862015-11-18 22:00:21 +0100413
philipel9d3ab612015-12-21 04:12:39 -0800414 // Insert a parsed packet into the receiver side of the module. Will be placed
415 // in the
416 // jitter buffer waiting for the frame to become complete. Returns as soon as
417 // the packet
418 // has been placed in the jitter buffer.
419 //
420 // Input:
421 // - incomingPayload : Payload of the packet.
422 // - payloadLength : Length of the payload.
423 // - rtpInfo : The parsed header.
424 //
425 // Return value : VCM_OK, on success.
426 // < 0, on error.
427 virtual int32_t IncomingPacket(const uint8_t* incomingPayload,
428 size_t payloadLength,
429 const WebRtcRTPHeader& rtpInfo) = 0;
Henrik Kjellander2557b862015-11-18 22:00:21 +0100430
philipel9d3ab612015-12-21 04:12:39 -0800431 // Minimum playout delay (Used for lip-sync). This is the minimum delay
432 // required
433 // to sync with audio. Not included in VideoCodingModule::Delay()
434 // Defaults to 0 ms.
435 //
436 // Input:
437 // - minPlayoutDelayMs : Additional delay in ms.
438 //
439 // Return value : VCM_OK, on success.
440 // < 0, on error.
441 virtual int32_t SetMinimumPlayoutDelay(uint32_t minPlayoutDelayMs) = 0;
Henrik Kjellander2557b862015-11-18 22:00:21 +0100442
philipel9d3ab612015-12-21 04:12:39 -0800443 // Set the time required by the renderer to render a frame.
444 //
445 // Input:
446 // - timeMS : The time in ms required by the renderer to render a
447 // frame.
448 //
449 // Return value : VCM_OK, on success.
450 // < 0, on error.
451 virtual int32_t SetRenderDelay(uint32_t timeMS) = 0;
Henrik Kjellander2557b862015-11-18 22:00:21 +0100452
philipel9d3ab612015-12-21 04:12:39 -0800453 // The total delay desired by the VCM. Can be less than the minimum
454 // delay set with SetMinimumPlayoutDelay.
455 //
456 // Return value : Total delay in ms, on success.
457 // < 0, on error.
458 virtual int32_t Delay() const = 0;
Henrik Kjellander2557b862015-11-18 22:00:21 +0100459
philipel9d3ab612015-12-21 04:12:39 -0800460 // Returns the number of packets discarded by the jitter buffer due to being
461 // too late. This can include duplicated packets which arrived after the
462 // frame was sent to the decoder. Therefore packets which were prematurely
463 // NACKed will be counted.
464 virtual uint32_t DiscardedPackets() const = 0;
Henrik Kjellander2557b862015-11-18 22:00:21 +0100465
philipel9d3ab612015-12-21 04:12:39 -0800466 // Robustness APIs
Henrik Kjellander2557b862015-11-18 22:00:21 +0100467
philipel9d3ab612015-12-21 04:12:39 -0800468 // Set the receiver robustness mode. The mode decides how the receiver
469 // responds to losses in the stream. The type of counter-measure (soft or
470 // hard NACK, dual decoder, RPS, etc.) is selected through the
471 // robustnessMode parameter. The errorMode parameter decides if it is
472 // allowed to display frames corrupted by losses. Note that not all
473 // combinations of the two parameters are feasible. An error will be
474 // returned for invalid combinations.
475 // Input:
476 // - robustnessMode : selected robustness mode.
477 // - errorMode : selected error mode.
478 //
479 // Return value : VCM_OK, on success;
480 // < 0, on error.
481 virtual int SetReceiverRobustnessMode(ReceiverRobustness robustnessMode,
482 VCMDecodeErrorMode errorMode) = 0;
Henrik Kjellander2557b862015-11-18 22:00:21 +0100483
philipel9d3ab612015-12-21 04:12:39 -0800484 // Set the decode error mode. The mode decides which errors (if any) are
485 // allowed in decodable frames. Note that setting decode_error_mode to
486 // anything other than kWithErrors without enabling nack will cause
487 // long-term freezes (resulting from frequent key frame requests) if
488 // packet loss occurs.
489 virtual void SetDecodeErrorMode(VCMDecodeErrorMode decode_error_mode) = 0;
Henrik Kjellander2557b862015-11-18 22:00:21 +0100490
philipel9d3ab612015-12-21 04:12:39 -0800491 // Sets the maximum number of sequence numbers that we are allowed to NACK
492 // and the oldest sequence number that we will consider to NACK. If a
493 // sequence number older than |max_packet_age_to_nack| is missing
494 // a key frame will be requested. A key frame will also be requested if the
495 // time of incomplete or non-continuous frames in the jitter buffer is above
496 // |max_incomplete_time_ms|.
497 virtual void SetNackSettings(size_t max_nack_list_size,
498 int max_packet_age_to_nack,
499 int max_incomplete_time_ms) = 0;
Henrik Kjellander2557b862015-11-18 22:00:21 +0100500
philipel9d3ab612015-12-21 04:12:39 -0800501 // Setting a desired delay to the VCM receiver. Video rendering will be
502 // delayed by at least desired_delay_ms.
503 virtual int SetMinReceiverDelay(int desired_delay_ms) = 0;
Henrik Kjellander2557b862015-11-18 22:00:21 +0100504
philipel9d3ab612015-12-21 04:12:39 -0800505 // Lets the sender suspend video when the rate drops below
506 // |threshold_bps|, and turns back on when the rate goes back up above
507 // |threshold_bps| + |window_bps|.
508 virtual void SuspendBelowMinBitrate() = 0;
Henrik Kjellander2557b862015-11-18 22:00:21 +0100509
philipel9d3ab612015-12-21 04:12:39 -0800510 // Returns true if SuspendBelowMinBitrate is engaged and the video has been
511 // suspended due to bandwidth limitations; otherwise false.
512 virtual bool VideoSuspended() const = 0;
Henrik Kjellander2557b862015-11-18 22:00:21 +0100513
philipel9d3ab612015-12-21 04:12:39 -0800514 virtual void RegisterPreDecodeImageCallback(
515 EncodedImageCallback* observer) = 0;
516 virtual void RegisterPostEncodeImageCallback(
517 EncodedImageCallback* post_encode_callback) = 0;
518 // Releases pending decode calls, permitting faster thread shutdown.
519 virtual void TriggerDecoderShutdown() = 0;
Henrik Kjellander2557b862015-11-18 22:00:21 +0100520};
521
522} // namespace webrtc
523
philipel9d3ab612015-12-21 04:12:39 -0800524#endif // WEBRTC_MODULES_VIDEO_CODING_INCLUDE_VIDEO_CODING_H_