Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1764)

Unified Diff: media/ffmpeg/ffmpeg_deleters.h

Issue 197793005: Convert scoped_ptr_malloc -> scoped_ptr, part 5. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/ffmpeg/ffmpeg_common.h ('k') | media/filters/ffmpeg_audio_decoder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/ffmpeg/ffmpeg_deleters.h
diff --git a/media/ffmpeg/ffmpeg_deleters.h b/media/ffmpeg/ffmpeg_deleters.h
new file mode 100644
index 0000000000000000000000000000000000000000..3429e05c7a699d172ae4073171f2e30ad35c1035
--- /dev/null
+++ b/media/ffmpeg/ffmpeg_deleters.h
@@ -0,0 +1,42 @@
+// Copyright 2014 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.
+
+// This file contains declarations for deleters for use with |scoped_ptr|. To
+// avoid requiring additional #includes, the (inline) definitions are in
+// ffmpeg_common.h. (Forward declarations of deleters aren't sufficient for
+// |scoped_ptr|.)
+
+#ifndef MEDIA_FFMPEG_FFMPEG_DELETERS_H_
+#define MEDIA_FFMPEG_FFMPEG_DELETERS_H_
+
+namespace media {
+
+// Wraps FFmpeg's av_free() in a class that can be passed as a template argument
+// to scoped_ptr_malloc.
+struct ScopedPtrAVFree {
+ void operator()(void* x) const;
+};
+
+// 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().
+struct ScopedPtrAVFreePacket {
+ void operator()(void* x) const;
+};
+
+// Frees an AVCodecContext object in a class that can be passed as a Deleter
+// argument to scoped_ptr_malloc.
+struct ScopedPtrAVFreeContext {
+ void operator()(void* x) const;
+};
+
+// Frees an AVFrame object in a class that can be passed as a Deleter argument
+// to scoped_ptr_malloc.
+struct ScopedPtrAVFreeFrame {
+ void operator()(void* x) const;
+};
+
+} // namespace media
+
+#endif // MEDIA_FFMPEG_FFMPEG_DELETERS_H_
« no previous file with comments | « media/ffmpeg/ffmpeg_common.h ('k') | media/filters/ffmpeg_audio_decoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698