Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / remoting / codec / scoped_vpx_codec.cc
blobdd5c73928e2aabaf62e7bd1d261a62a7a26e9561
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "remoting/codec/scoped_vpx_codec.h"
7 #include "base/logging.h"
9 extern "C" {
10 #define VPX_CODEC_DISABLE_COMPAT 1
11 #include "third_party/libvpx_new/source/libvpx/vpx/vpx_codec.h"
13 namespace remoting {
15 void VpxCodecDeleter::operator()(vpx_codec_ctx_t* codec) {
16 if (codec) {
17 vpx_codec_err_t ret = vpx_codec_destroy(codec);
18 CHECK_EQ(ret, VPX_CODEC_OK) << "Failed to destroy codec";
19 delete codec;
23 } // namespace remoting