Index: media/formats/mp4/avc.h |
diff --git a/media/formats/mp4/avc.h b/media/formats/mp4/avc.h |
index add88bbcfa116594206fcee91f55ec9b14986a30..a774ddd1b7320aaae000bfa885a2b56dadb23420 100644 |
--- a/media/formats/mp4/avc.h |
+++ b/media/formats/mp4/avc.h |
@@ -8,7 +8,9 @@ |
#include <vector> |
#include "base/basictypes.h" |
+#include "base/memory/scoped_ptr.h" |
#include "media/base/media_export.h" |
+#include "media/formats/mp4/bitstream_converter.h" |
namespace media { |
@@ -57,6 +59,24 @@ class MEDIA_EXPORT AVC { |
const uint8* ptr); |
}; |
+// AVCBitstreamConverter converts AVC/H.264 bitstream from MP4 container format |
+// with embedded NALU lengths into AnnexB bitstream format (described in ISO/IEC |
+// 14496-10) with 4-byte start codes. It also knows how to handle CENC-encrypted |
+// streams and adjusts subsample data for those streams while converting. |
+class AVCBitstreamConverter : public BitstreamConverter { |
+ public: |
+ explicit AVCBitstreamConverter( |
+ scoped_ptr<AVCDecoderConfigurationRecord> avc_config); |
+ |
+ // BitstreamConverter interface |
+ bool ConvertFrame(std::vector<uint8>* frame_buf, |
+ bool is_keyframe, |
+ std::vector<SubsampleEntry>* subsamples) const override; |
+ private: |
+ ~AVCBitstreamConverter() override; |
+ scoped_ptr<AVCDecoderConfigurationRecord> avc_config_; |
+}; |
+ |
} // namespace mp4 |
} // namespace media |