// Copyright (c) 2010 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. #ifndef MEDIA_FFMPEG_FFMPEG_COMMON_H_ #define MEDIA_FFMPEG_FFMPEG_COMMON_H_ // Used for FFmpeg error codes. #include #include "base/compiler_specific.h" #include "base/singleton.h" // Include FFmpeg header files. extern "C" { // Temporarily disable possible loss of data warning. // TODO(scherkus): fix and upstream the compiler warnings. MSVC_PUSH_DISABLE_WARNING(4244); #include #include #include #include #include #include MSVC_POP_WARNING(); } // extern "C" namespace media { // Wraps FFmpeg's av_free() in a class that can be passed as a template argument // to scoped_ptr_malloc. class ScopedPtrAVFree { public: inline void operator()(void* x) const { av_free(x); } }; // This assumes that the AVPacket being captured was allocated outside of // FFmpeg via the new operator. Do not use this with AVPacket instances that // are allocated via malloc() or av_malloc(). class ScopedPtrAVFreePacket { public: inline void operator()(void* x) const { AVPacket* packet = static_cast(x); av_free_packet(packet); delete packet; } }; // FFmpeg MIME types. namespace mime_type { extern const char kFFmpegAudio[]; extern const char kFFmpegVideo[]; } // namespace mime_type } // namespace media #endif // MEDIA_FFMPEG_FFMPEG_COMMON_H_