Chromium Code Reviews| 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_PACKET_H_ | |
| 6 #define SERVICES_MEDIA_FRAMEWORK_FFMPEG_AV_PACKET_H_ | |
| 7 | |
| 8 extern "C" { | |
| 9 #include "third_party/ffmpeg/libavcodec/avcodec.h" | |
| 10 #include "third_party/ffmpeg/libavformat/avformat.h" | |
| 11 } | |
| 12 | |
| 13 namespace mojo { | |
| 14 namespace media { | |
|
johngro
2016/03/21 19:47:56
just a suggestion (take it or leave it); As these
dalesat
2016/03/21 22:30:59
Done.
| |
| 15 | |
| 16 struct AVPacketDeleter { | |
| 17 inline void operator()(AVPacket* ptr) const { | |
| 18 av_free_packet(ptr); | |
| 19 } | |
| 20 }; | |
| 21 | |
| 22 using AvPacketPtr = std::unique_ptr<AVPacket, AVPacketDeleter>; | |
| 23 | |
| 24 struct AvPacket{ | |
| 25 static AvPacketPtr Create() { | |
| 26 AVPacket* av_packet = new AVPacket(); | |
| 27 av_init_packet(av_packet); | |
| 28 return AvPacketPtr(av_packet); | |
| 29 } | |
| 30 }; | |
| 31 | |
| 32 } // namespace media | |
| 33 } // namespace mojo | |
| 34 | |
| 35 #endif // SERVICES_MEDIA_FRAMEWORK_FFMPEG_AV_PACKET_H_ | |
| OLD | NEW |