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

Unified Diff: media/formats/mp4/avc.h

Issue 1289923003: Refactor AnnexB bitstream conversion for AVC/H.264 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@annexb-avc-fix
Patch Set: Added a few comments Created 5 years, 4 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/BUILD.gn ('k') | media/formats/mp4/avc.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « media/BUILD.gn ('k') | media/formats/mp4/avc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698