blob: 79f574cb35f61aaefe9d6e4ef15abb0235115de0 [file] [log] [blame]
niklase@google.com470e71d2011-07-07 08:21:25 +00001/*
2 * Copyright (c) 2011 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
mflodman@webrtc.org1bdf1df2011-12-20 11:57:47 +000011#include "video_engine/vie_image_process_impl.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000012
mflodman@webrtc.org1bdf1df2011-12-20 11:57:47 +000013#include "system_wrappers/interface/trace.h"
mflodman@webrtc.orga4863db2011-12-22 08:51:52 +000014#include "video_engine/include/vie_errors.h"
mflodman@webrtc.org1bdf1df2011-12-20 11:57:47 +000015#include "video_engine/vie_capturer.h"
16#include "video_engine/vie_channel.h"
17#include "video_engine/vie_channel_manager.h"
18#include "video_engine/vie_defines.h"
19#include "video_engine/vie_encoder.h"
20#include "video_engine/vie_impl.h"
21#include "video_engine/vie_input_manager.h"
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +000022#include "video_engine/vie_shared_data.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000023
mflodman@webrtc.org1bdf1df2011-12-20 11:57:47 +000024namespace webrtc {
niklase@google.com470e71d2011-07-07 08:21:25 +000025
mflodman@webrtc.org1bdf1df2011-12-20 11:57:47 +000026ViEImageProcess* ViEImageProcess::GetInterface(VideoEngine* video_engine) {
niklase@google.com470e71d2011-07-07 08:21:25 +000027#ifdef WEBRTC_VIDEO_ENGINE_IMAGE_PROCESS_API
mflodman@webrtc.org1bdf1df2011-12-20 11:57:47 +000028 if (!video_engine) {
niklase@google.com470e71d2011-07-07 08:21:25 +000029 return NULL;
mflodman@webrtc.org1bdf1df2011-12-20 11:57:47 +000030 }
31 VideoEngineImpl* vie_impl = reinterpret_cast<VideoEngineImpl*>(video_engine);
32 ViEImageProcessImpl* vie_image_process_impl = vie_impl;
33 // Increase ref count.
34 (*vie_image_process_impl)++;
35 return vie_image_process_impl;
36#else
37 return NULL;
niklase@google.com470e71d2011-07-07 08:21:25 +000038#endif
39}
40
mflodman@webrtc.org1bdf1df2011-12-20 11:57:47 +000041int ViEImageProcessImpl::Release() {
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +000042 WEBRTC_TRACE(kTraceApiCall, kTraceVideo, shared_data_->instance_id(),
niklase@google.com470e71d2011-07-07 08:21:25 +000043 "ViEImageProcess::Release()");
mflodman@webrtc.org1bdf1df2011-12-20 11:57:47 +000044 // Decrease ref count.
45 (*this)--;
niklase@google.com470e71d2011-07-07 08:21:25 +000046
pbos@webrtc.orgb238d122013-04-09 13:41:51 +000047 int32_t ref_count = GetCount();
mflodman@webrtc.org1bdf1df2011-12-20 11:57:47 +000048 if (ref_count < 0) {
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +000049 WEBRTC_TRACE(kTraceWarning, kTraceVideo, shared_data_->instance_id(),
mflodman@webrtc.org1bdf1df2011-12-20 11:57:47 +000050 "ViEImageProcess release too many times");
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +000051 shared_data_->SetLastError(kViEAPIDoesNotExist);
mflodman@webrtc.org1bdf1df2011-12-20 11:57:47 +000052 return -1;
53 }
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +000054 WEBRTC_TRACE(kTraceInfo, kTraceVideo, shared_data_->instance_id(),
mflodman@webrtc.org1bdf1df2011-12-20 11:57:47 +000055 "ViEImageProcess reference count: %d", ref_count);
56 return ref_count;
niklase@google.com470e71d2011-07-07 08:21:25 +000057}
58
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +000059ViEImageProcessImpl::ViEImageProcessImpl(ViESharedData* shared_data)
60 : shared_data_(shared_data) {
61 WEBRTC_TRACE(kTraceMemory, kTraceVideo, shared_data_->instance_id(),
niklase@google.com470e71d2011-07-07 08:21:25 +000062 "ViEImageProcessImpl::ViEImageProcessImpl() Ctor");
63}
64
mflodman@webrtc.org1bdf1df2011-12-20 11:57:47 +000065ViEImageProcessImpl::~ViEImageProcessImpl() {
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +000066 WEBRTC_TRACE(kTraceMemory, kTraceVideo, shared_data_->instance_id(),
niklase@google.com470e71d2011-07-07 08:21:25 +000067 "ViEImageProcessImpl::~ViEImageProcessImpl() Dtor");
68}
69
niklase@google.com470e71d2011-07-07 08:21:25 +000070int ViEImageProcessImpl::RegisterCaptureEffectFilter(
mflodman@webrtc.org1bdf1df2011-12-20 11:57:47 +000071 const int capture_id,
72 ViEEffectFilter& capture_filter) {
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +000073 WEBRTC_TRACE(kTraceApiCall, kTraceVideo, ViEId(shared_data_->instance_id()),
mflodman@webrtc.org1bdf1df2011-12-20 11:57:47 +000074 "%s(capture_id: %d)", __FUNCTION__, capture_id);
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +000075 if (!shared_data_->Initialized()) {
76 shared_data_->SetLastError(kViENotInitialized);
77 WEBRTC_TRACE(kTraceError, kTraceVideo, ViEId(shared_data_->instance_id()),
mflodman@webrtc.org1bdf1df2011-12-20 11:57:47 +000078 "%s - ViE instance %d not initialized", __FUNCTION__,
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +000079 shared_data_->instance_id());
mflodman@webrtc.org1bdf1df2011-12-20 11:57:47 +000080 return -1;
81 }
niklase@google.com470e71d2011-07-07 08:21:25 +000082
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +000083 ViEInputManagerScoped is(*(shared_data_->input_manager()));
mflodman@webrtc.org1bdf1df2011-12-20 11:57:47 +000084 ViECapturer* vie_capture = is.Capture(capture_id);
85 if (!vie_capture) {
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +000086 WEBRTC_TRACE(kTraceError, kTraceVideo, ViEId(shared_data_->instance_id()),
mflodman@webrtc.org1bdf1df2011-12-20 11:57:47 +000087 "%s: Capture device %d doesn't exist", __FUNCTION__,
88 capture_id);
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +000089 shared_data_->SetLastError(kViEImageProcessInvalidCaptureId);
mflodman@webrtc.org1bdf1df2011-12-20 11:57:47 +000090 return -1;
91 }
92 if (vie_capture->RegisterEffectFilter(&capture_filter) != 0) {
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +000093 shared_data_->SetLastError(kViEImageProcessFilterExists);
mflodman@webrtc.org1bdf1df2011-12-20 11:57:47 +000094 return -1;
95 }
96 return 0;
niklase@google.com470e71d2011-07-07 08:21:25 +000097}
98
mflodman@webrtc.org1bdf1df2011-12-20 11:57:47 +000099int ViEImageProcessImpl::DeregisterCaptureEffectFilter(const int capture_id) {
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +0000100 WEBRTC_TRACE(kTraceApiCall, kTraceVideo, ViEId(shared_data_->instance_id()),
mflodman@webrtc.org1bdf1df2011-12-20 11:57:47 +0000101 "%s(capture_id: %d)", __FUNCTION__, capture_id);
niklase@google.com470e71d2011-07-07 08:21:25 +0000102
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +0000103 ViEInputManagerScoped is(*(shared_data_->input_manager()));
mflodman@webrtc.org1bdf1df2011-12-20 11:57:47 +0000104 ViECapturer* vie_capture = is.Capture(capture_id);
105 if (!vie_capture) {
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +0000106 WEBRTC_TRACE(kTraceError, kTraceVideo, ViEId(shared_data_->instance_id()),
mflodman@webrtc.org1bdf1df2011-12-20 11:57:47 +0000107 "%s: Capture device %d doesn't exist", __FUNCTION__,
108 capture_id);
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +0000109 shared_data_->SetLastError(kViEImageProcessInvalidCaptureId);
mflodman@webrtc.org1bdf1df2011-12-20 11:57:47 +0000110 return -1;
111 }
112 if (vie_capture->RegisterEffectFilter(NULL) != 0) {
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +0000113 shared_data_->SetLastError(kViEImageProcessFilterDoesNotExist);
mflodman@webrtc.org1bdf1df2011-12-20 11:57:47 +0000114 return -1;
115 }
116 return 0;
niklase@google.com470e71d2011-07-07 08:21:25 +0000117}
118
mflodman@webrtc.org1bdf1df2011-12-20 11:57:47 +0000119int ViEImageProcessImpl::RegisterSendEffectFilter(
120 const int video_channel,
121 ViEEffectFilter& send_filter) {
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +0000122 WEBRTC_TRACE(kTraceApiCall, kTraceVideo, ViEId(shared_data_->instance_id()),
mflodman@webrtc.org1bdf1df2011-12-20 11:57:47 +0000123 "%s(video_channel: %d)", __FUNCTION__, video_channel);
niklase@google.com470e71d2011-07-07 08:21:25 +0000124
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +0000125 ViEChannelManagerScoped cs(*(shared_data_->channel_manager()));
mflodman@webrtc.org1bdf1df2011-12-20 11:57:47 +0000126 ViEEncoder* vie_encoder = cs.Encoder(video_channel);
127 if (vie_encoder == NULL) {
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +0000128 WEBRTC_TRACE(kTraceError, kTraceVideo, ViEId(shared_data_->instance_id()),
mflodman@webrtc.org1bdf1df2011-12-20 11:57:47 +0000129 "%s: Channel %d doesn't exist", __FUNCTION__, video_channel);
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +0000130 shared_data_->SetLastError(kViEImageProcessInvalidChannelId);
mflodman@webrtc.org1bdf1df2011-12-20 11:57:47 +0000131 return -1;
132 }
niklase@google.com470e71d2011-07-07 08:21:25 +0000133
mflodman@webrtc.org1bdf1df2011-12-20 11:57:47 +0000134 if (vie_encoder->RegisterEffectFilter(&send_filter) != 0) {
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +0000135 shared_data_->SetLastError(kViEImageProcessFilterExists);
mflodman@webrtc.org1bdf1df2011-12-20 11:57:47 +0000136 return -1;
137 }
138 return 0;
niklase@google.com470e71d2011-07-07 08:21:25 +0000139}
140
mflodman@webrtc.org1bdf1df2011-12-20 11:57:47 +0000141int ViEImageProcessImpl::DeregisterSendEffectFilter(const int video_channel) {
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +0000142 WEBRTC_TRACE(kTraceApiCall, kTraceVideo, ViEId(shared_data_->instance_id()),
mflodman@webrtc.org1bdf1df2011-12-20 11:57:47 +0000143 "%s(video_channel: %d)", __FUNCTION__, video_channel);
niklase@google.com470e71d2011-07-07 08:21:25 +0000144
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +0000145 ViEChannelManagerScoped cs(*(shared_data_->channel_manager()));
mflodman@webrtc.org1bdf1df2011-12-20 11:57:47 +0000146 ViEEncoder* vie_encoder = cs.Encoder(video_channel);
147 if (vie_encoder == NULL) {
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +0000148 WEBRTC_TRACE(kTraceError, kTraceVideo, ViEId(shared_data_->instance_id()),
mflodman@webrtc.org1bdf1df2011-12-20 11:57:47 +0000149 "%s: Channel %d doesn't exist", __FUNCTION__, video_channel);
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +0000150 shared_data_->SetLastError(kViEImageProcessInvalidChannelId);
mflodman@webrtc.org1bdf1df2011-12-20 11:57:47 +0000151 return -1;
152 }
153 if (vie_encoder->RegisterEffectFilter(NULL) != 0) {
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +0000154 shared_data_->SetLastError(kViEImageProcessFilterDoesNotExist);
mflodman@webrtc.org1bdf1df2011-12-20 11:57:47 +0000155 return -1;
156 }
157 return 0;
niklase@google.com470e71d2011-07-07 08:21:25 +0000158}
159
niklase@google.com470e71d2011-07-07 08:21:25 +0000160int ViEImageProcessImpl::RegisterRenderEffectFilter(
mflodman@webrtc.org1bdf1df2011-12-20 11:57:47 +0000161 const int video_channel,
162 ViEEffectFilter& render_filter) {
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +0000163 WEBRTC_TRACE(kTraceApiCall, kTraceVideo, ViEId(shared_data_->instance_id()),
mflodman@webrtc.org1bdf1df2011-12-20 11:57:47 +0000164 "%s(video_channel: %d)", __FUNCTION__, video_channel);
niklase@google.com470e71d2011-07-07 08:21:25 +0000165
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +0000166 ViEChannelManagerScoped cs(*(shared_data_->channel_manager()));
mflodman@webrtc.org1bdf1df2011-12-20 11:57:47 +0000167 ViEChannel* vie_channel = cs.Channel(video_channel);
168 if (!vie_channel) {
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +0000169 WEBRTC_TRACE(kTraceError, kTraceVideo, ViEId(shared_data_->instance_id()),
mflodman@webrtc.org1bdf1df2011-12-20 11:57:47 +0000170 "%s: Channel %d doesn't exist", __FUNCTION__, video_channel);
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +0000171 shared_data_->SetLastError(kViEImageProcessInvalidChannelId);
mflodman@webrtc.org1bdf1df2011-12-20 11:57:47 +0000172 return -1;
173 }
174 if (vie_channel->RegisterEffectFilter(&render_filter) != 0) {
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +0000175 shared_data_->SetLastError(kViEImageProcessFilterExists);
mflodman@webrtc.org1bdf1df2011-12-20 11:57:47 +0000176 return -1;
177 }
178 return 0;
niklase@google.com470e71d2011-07-07 08:21:25 +0000179}
180
mflodman@webrtc.org1bdf1df2011-12-20 11:57:47 +0000181int ViEImageProcessImpl::DeregisterRenderEffectFilter(const int video_channel) {
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +0000182 WEBRTC_TRACE(kTraceApiCall, kTraceVideo, ViEId(shared_data_->instance_id()),
mflodman@webrtc.org1bdf1df2011-12-20 11:57:47 +0000183 "%s(video_channel: %d)", __FUNCTION__, video_channel);
niklase@google.com470e71d2011-07-07 08:21:25 +0000184
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +0000185 ViEChannelManagerScoped cs(*(shared_data_->channel_manager()));
mflodman@webrtc.org1bdf1df2011-12-20 11:57:47 +0000186 ViEChannel* vie_channel = cs.Channel(video_channel);
187 if (!vie_channel) {
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +0000188 WEBRTC_TRACE(kTraceError, kTraceVideo, ViEId(shared_data_->instance_id()),
mflodman@webrtc.org1bdf1df2011-12-20 11:57:47 +0000189 "%s: Channel %d doesn't exist", __FUNCTION__, video_channel);
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +0000190 shared_data_->SetLastError(kViEImageProcessInvalidChannelId);
mflodman@webrtc.org1bdf1df2011-12-20 11:57:47 +0000191 return -1;
192 }
niklase@google.com470e71d2011-07-07 08:21:25 +0000193
mflodman@webrtc.org1bdf1df2011-12-20 11:57:47 +0000194 if (vie_channel->RegisterEffectFilter(NULL) != 0) {
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +0000195 shared_data_->SetLastError(kViEImageProcessFilterDoesNotExist);
mflodman@webrtc.org1bdf1df2011-12-20 11:57:47 +0000196 return -1;
197 }
198 return 0;
niklase@google.com470e71d2011-07-07 08:21:25 +0000199}
200
mflodman@webrtc.org1bdf1df2011-12-20 11:57:47 +0000201int ViEImageProcessImpl::EnableDeflickering(const int capture_id,
202 const bool enable) {
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +0000203 WEBRTC_TRACE(kTraceApiCall, kTraceVideo, ViEId(shared_data_->instance_id()),
mflodman@webrtc.org1bdf1df2011-12-20 11:57:47 +0000204 "%s(capture_id: %d, enable: %d)", __FUNCTION__, capture_id,
niklase@google.com470e71d2011-07-07 08:21:25 +0000205 enable);
206
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +0000207 ViEInputManagerScoped is(*(shared_data_->input_manager()));
mflodman@webrtc.org1bdf1df2011-12-20 11:57:47 +0000208 ViECapturer* vie_capture = is.Capture(capture_id);
209 if (!vie_capture) {
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +0000210 WEBRTC_TRACE(kTraceError, kTraceVideo, ViEId(shared_data_->instance_id()),
mflodman@webrtc.org1bdf1df2011-12-20 11:57:47 +0000211 "%s: Capture device %d doesn't exist", __FUNCTION__,
212 capture_id);
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +0000213 shared_data_->SetLastError(kViEImageProcessInvalidChannelId);
mflodman@webrtc.org1bdf1df2011-12-20 11:57:47 +0000214 return -1;
215 }
216
217 if (vie_capture->EnableDeflickering(enable) != 0) {
218 if (enable) {
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +0000219 shared_data_->SetLastError(kViEImageProcessAlreadyEnabled);
mflodman@webrtc.org1bdf1df2011-12-20 11:57:47 +0000220 } else {
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +0000221 shared_data_->SetLastError(kViEImageProcessAlreadyDisabled);
niklase@google.com470e71d2011-07-07 08:21:25 +0000222 }
mflodman@webrtc.org1bdf1df2011-12-20 11:57:47 +0000223 return -1;
224 }
225 return 0;
niklase@google.com470e71d2011-07-07 08:21:25 +0000226}
mflodman@webrtc.org1bdf1df2011-12-20 11:57:47 +0000227
228int ViEImageProcessImpl::EnableDenoising(const int capture_id,
229 const bool enable) {
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +0000230 WEBRTC_TRACE(kTraceApiCall, kTraceVideo, ViEId(shared_data_->instance_id()),
mflodman@webrtc.org1bdf1df2011-12-20 11:57:47 +0000231 "%s(capture_id: %d, enable: %d)", __FUNCTION__, capture_id,
232 enable);
233
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +0000234 ViEInputManagerScoped is(*(shared_data_->input_manager()));
mflodman@webrtc.org1bdf1df2011-12-20 11:57:47 +0000235 ViECapturer* vie_capture = is.Capture(capture_id);
236 if (!vie_capture) {
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +0000237 WEBRTC_TRACE(kTraceError, kTraceVideo, ViEId(shared_data_->instance_id()),
mflodman@webrtc.org1bdf1df2011-12-20 11:57:47 +0000238 "%s: Capture device %d doesn't exist", __FUNCTION__,
239 capture_id);
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +0000240 shared_data_->SetLastError(kViEImageProcessInvalidCaptureId);
mflodman@webrtc.org1bdf1df2011-12-20 11:57:47 +0000241 return -1;
242 }
243
244 if (vie_capture->EnableDenoising(enable) != 0) {
245 if (enable) {
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +0000246 shared_data_->SetLastError(kViEImageProcessAlreadyEnabled);
mflodman@webrtc.org1bdf1df2011-12-20 11:57:47 +0000247 } else {
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +0000248 shared_data_->SetLastError(kViEImageProcessAlreadyDisabled);
mflodman@webrtc.org1bdf1df2011-12-20 11:57:47 +0000249 }
250 return -1;
251 }
252 return 0;
253}
254
255int ViEImageProcessImpl::EnableColorEnhancement(const int video_channel,
256 const bool enable) {
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +0000257 WEBRTC_TRACE(kTraceApiCall, kTraceVideo, ViEId(shared_data_->instance_id()),
mflodman@webrtc.org1bdf1df2011-12-20 11:57:47 +0000258 "%s(video_channel: %d, enable: %d)", __FUNCTION__, video_channel,
259 enable);
260
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +0000261 ViEChannelManagerScoped cs(*(shared_data_->channel_manager()));
mflodman@webrtc.org1bdf1df2011-12-20 11:57:47 +0000262 ViEChannel* vie_channel = cs.Channel(video_channel);
263 if (!vie_channel) {
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +0000264 WEBRTC_TRACE(kTraceError, kTraceVideo, ViEId(shared_data_->instance_id()),
mflodman@webrtc.org1bdf1df2011-12-20 11:57:47 +0000265 "%s: Channel %d doesn't exist", __FUNCTION__, video_channel);
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +0000266 shared_data_->SetLastError(kViEImageProcessInvalidChannelId);
mflodman@webrtc.org1bdf1df2011-12-20 11:57:47 +0000267 return -1;
268 }
269 if (vie_channel->EnableColorEnhancement(enable) != 0) {
270 if (enable) {
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +0000271 shared_data_->SetLastError(kViEImageProcessAlreadyEnabled);
mflodman@webrtc.org1bdf1df2011-12-20 11:57:47 +0000272 } else {
mflodman@webrtc.orgb11424b2012-01-25 13:42:03 +0000273 shared_data_->SetLastError(kViEImageProcessAlreadyDisabled);
mflodman@webrtc.org1bdf1df2011-12-20 11:57:47 +0000274 }
275 return -1;
276 }
277 return 0;
278}
279
280} // namespace webrtc