summaryrefslogtreecommitdiffstats
path: root/remoting/codec/scoped_vpx_codec.cc
blob: dda986e75d272aa0e165398b3135ada6fa442c58 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "remoting/codec/scoped_vpx_codec.h"

#include "base/logging.h"

extern "C" {
#define VPX_CODEC_DISABLE_COMPAT 1
#include "third_party/libvpx/source/libvpx/vpx/vpx_codec.h"
}
namespace remoting {

void VpxCodecDeleter::operator()(vpx_codec_ctx_t* codec) {
  if (codec) {
    vpx_codec_err_t ret = vpx_codec_destroy(codec);
    CHECK_EQ(ret, VPX_CODEC_OK) << "Failed to destroy codec";
    delete codec;
  }
}

}  // namespace remoting