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

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

Issue 816353010: Implemented HEVC video demuxing and parsing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase to ToT Created 5 years, 7 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
Index: media/formats/mp4/box_definitions.h
diff --git a/media/formats/mp4/box_definitions.h b/media/formats/mp4/box_definitions.h
index 026effe6b5fbd3fe036e63426400c03f288802a5..8a1f1395edfa38955134d43a08a2b0b7922f5a2e 100644
--- a/media/formats/mp4/box_definitions.h
+++ b/media/formats/mp4/box_definitions.h
@@ -12,6 +12,7 @@
#include "base/compiler_specific.h"
#include "media/base/media_export.h"
#include "media/base/media_log.h"
+#include "media/base/video_decoder_config.h"
#include "media/formats/mp4/aac.h"
#include "media/formats/mp4/avc.h"
#include "media/formats/mp4/box_reader.h"
@@ -178,6 +179,52 @@ struct MEDIA_EXPORT AVCDecoderConfigurationRecord : Box {
bool ParseInternal(BufferReader* reader, const LogCB& log_cb);
};
+#if defined(ENABLE_HEVC_DEMUXING)
+struct MEDIA_EXPORT HEVCDecoderConfigurationRecord : Box {
+ DECLARE_BOX_METHODS(HEVCDecoderConfigurationRecord);
+
+ // Parses HEVCDecoderConfigurationRecord data encoded in |data|.
+ // Note: This method is intended to parse data outside the MP4StreamParser
+ // context and therefore the box header is not expected to be present
+ // in |data|.
+ // Returns true if |data| was successfully parsed.
+ bool Parse(const uint8* data, int data_size);
+
+ uint8 configurationVersion;
+ uint8 general_profile_space;
+ uint8 general_tier_flag;
+ uint8 general_profile_idc;
+ uint32 general_profile_compatibility_flags;
+ uint64 general_constraint_indicator_flags;
+ uint8 general_level_idc;
+ uint16 min_spatial_segmentation_idc;
+ uint8 parallelismType;
+ uint8 chromaFormat;
+ uint8 bitDepthLumaMinus8;
+ uint8 bitDepthChromaMinus8;
+ uint16 avgFrameRate;
+ uint8 constantFrameRate;
+ uint8 numTemporalLayers;
+ uint8 temporalIdNested;
+ uint8 lengthSizeMinusOne;
+ uint8 numOfArrays;
+
+ uint8 length_size;
+
+ typedef std::vector<uint8> HVCCNALUnit;
+ struct HVCCNALArray {
+ HVCCNALArray();
+ ~HVCCNALArray();
+ uint8 first_byte;
+ std::vector<HVCCNALUnit> units;
+ };
+ std::vector<HVCCNALArray> arrays;
+
+ private:
+ bool ParseInternal(BufferReader* reader, const LogCB& log_cb);
+};
+#endif
+
struct MEDIA_EXPORT PixelAspectRatioBox : Box {
DECLARE_BOX_METHODS(PixelAspectRatioBox);
@@ -196,10 +243,15 @@ struct MEDIA_EXPORT VideoSampleEntry : Box {
PixelAspectRatioBox pixel_aspect;
ProtectionSchemeInfo sinf;
- // Currently expected to be present regardless of format.
- AVCDecoderConfigurationRecord avcc;
+ // avcConfig is used for H.264/avc video
+ AVCDecoderConfigurationRecord avcConfig;
+#if defined(ENABLE_HEVC_DEMUXING)
+ // hevcConfig is used for H.265/hevc video
+ HEVCDecoderConfigurationRecord hevcConfig;
+#endif
- bool IsFormatValid() const;
+ VideoDecoderConfig video_decoder_config_;
+ VideoDecoderConfig GetVideoDecoderConfig() const;
};
struct MEDIA_EXPORT ElementaryStreamDescriptor : Box {

Powered by Google App Engine
This is Rietveld 408576698