18bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)// Copyright 2013 The Chromium Authors. All rights reserved. 28bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be 38bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)// found in the LICENSE file. 48bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles) 58bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)#include "remoting/codec/scoped_vpx_codec.h" 68bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles) 78bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)#include "base/logging.h" 88bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles) 98bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)extern "C" { 108bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)#define VPX_CODEC_DISABLE_COMPAT 1 118bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)#include "third_party/libvpx/source/libvpx/vpx/vpx_codec.h" 128bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)} 138bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)namespace remoting { 148bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles) 158bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)void VpxCodecDeleter::operator()(vpx_codec_ctx_t* codec) { 168bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles) if (codec) { 178bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles) vpx_codec_err_t ret = vpx_codec_destroy(codec); 188bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles) CHECK_EQ(ret, VPX_CODEC_OK) << "Failed to destroy codec"; 198bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles) delete codec; 208bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles) } 218bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)} 228bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles) 238bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)} // namespace remoting 24