| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef SERVICES_MEDIA_FRAMEWORK_FFMPEG_AV_FRAME_H_ | 5 #ifndef SERVICES_MEDIA_FRAMEWORK_FFMPEG_AV_FRAME_H_ |
| 6 #define SERVICES_MEDIA_FRAMEWORK_FFMPEG_AV_FRAME_H_ | 6 #define SERVICES_MEDIA_FRAMEWORK_FFMPEG_AV_FRAME_H_ |
| 7 | 7 |
| 8 extern "C" { | 8 extern "C" { |
| 9 #include "third_party/ffmpeg/libavutil/frame.h" | 9 #include "third_party/ffmpeg/libavutil/frame.h" |
| 10 } | 10 } |
| 11 | 11 |
| 12 namespace mojo { | 12 namespace mojo { |
| 13 namespace media { | 13 namespace media { |
| 14 namespace ffmpeg { | 14 namespace ffmpeg { |
| 15 | 15 |
| 16 struct AVFrameDeleter { | 16 struct AVFrameDeleter { |
| 17 inline void operator()(AVFrame* ptr) const { | 17 inline void operator()(AVFrame* ptr) const { av_frame_free(&ptr); } |
| 18 av_frame_free(&ptr); | |
| 19 } | |
| 20 }; | 18 }; |
| 21 | 19 |
| 22 using AvFramePtr = std::unique_ptr<AVFrame, AVFrameDeleter>; | 20 using AvFramePtr = std::unique_ptr<AVFrame, AVFrameDeleter>; |
| 23 | 21 |
| 24 struct AvFrame{ | 22 struct AvFrame { |
| 25 static AvFramePtr Create() { | 23 static AvFramePtr Create() { return AvFramePtr(av_frame_alloc()); } |
| 26 return AvFramePtr(av_frame_alloc()); | |
| 27 } | |
| 28 }; | 24 }; |
| 29 | 25 |
| 30 } // namespace ffmpeg | 26 } // namespace ffmpeg |
| 31 } // namespace media | 27 } // namespace media |
| 32 } // namespace mojo | 28 } // namespace mojo |
| 33 | 29 |
| 34 #endif // SERVICES_MEDIA_FRAMEWORK_FFMPEG_AV_FRAME_H_ | 30 #endif // SERVICES_MEDIA_FRAMEWORK_FFMPEG_AV_FRAME_H_ |
| OLD | NEW |