OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 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. |
| 4 |
| 5 #ifndef SERVICES_MEDIA_FRAMEWORK_FFMPEG_AV_FRAME_H_ |
| 6 #define SERVICES_MEDIA_FRAMEWORK_FFMPEG_AV_FRAME_H_ |
| 7 |
| 8 extern "C" { |
| 9 #include "third_party/ffmpeg/libavutil/frame.h" |
| 10 } |
| 11 |
| 12 namespace mojo { |
| 13 namespace media { |
| 14 |
| 15 struct AVFrameDeleter { |
| 16 inline void operator()(AVFrame* ptr) const { |
| 17 av_frame_free(&ptr); |
| 18 } |
| 19 }; |
| 20 |
| 21 using AvFramePtr = std::unique_ptr<AVFrame, AVFrameDeleter>; |
| 22 |
| 23 struct AvFrame{ |
| 24 static AvFramePtr Create() { |
| 25 return AvFramePtr(av_frame_alloc()); |
| 26 } |
| 27 }; |
| 28 |
| 29 } // namespace media |
| 30 } // namespace mojo |
| 31 |
| 32 #endif // SERVICES_MEDIA_FRAMEWORK_FFMPEG_AV_FRAME_H_ |
OLD | NEW |