--- /media/FreeAgent GoFlex Drive/src/mythtv/mythtv/libs/libmythtv/mpeg/H264Parser.h 2013-03-05 19:22:37.000000000 +1300 +++ mythtv/mythtv/libs/libmythtv/mpeg/H264Parser.h 2013-03-30 17:34:21.818946139 +1300 @@ -58,11 +58,11 @@ }; // ITU-T Rec. H.264 table 7-1 enum NAL_unit_type { UNKNOWN = 0, - SLICE = 1, + SLICE = 1, // 1 - 5 are VCL NAL units SLICE_DPA = 2, SLICE_DPB = 3, SLICE_DPC = 4, SLICE_IDR = 5, SEI = 6, @@ -71,15 +71,19 @@ AU_DELIMITER = 9, END_SEQUENCE = 10, END_STREAM = 11, FILLER_DATA = 12, SPS_EXT = 13, - AUXILIARY_SLICE = 19 + NALU_prefix = 14, + SPS_subset = 15, + AUXILIARY_SLICE = 19, + SLICE_EXTENSION = 20 }; enum SEI_type { SEI_TYPE_PIC_TIMING = 1, + SEI_FILLER_PAYLOAD = 3, SEI_TYPE_USER_DATA_UNREGISTERED = 5, SEI_TYPE_RECOVERY_POINT = 6 }; /* @@ -145,11 +149,13 @@ double frameRate(void) const; void getFrameRate(FrameRate &result) const; uint64_t frameAUstreamOffset(void) const {return frame_start_offset;} uint64_t keyframeAUstreamOffset(void) const {return keyframe_start_offset;} - + uint64_t SPSstreamOffset(void) const {return SPS_offset;} + +// == NAL_type AU_delimiter: primary_pic_type = 5 static int isKeySlice(uint slice_type) { return (slice_type == SLICE_I || slice_type == SLICE_SI || slice_type == SLICE_I_a || @@ -162,18 +168,23 @@ nal_type == SLICE_DPA || nal_type == SLICE_IDR); } void use_I_forKeyframes(bool val) { I_is_keyframe = val; } + bool using_I_forKeyframes(void) const { return I_is_keyframe; } uint32_t GetTimeScale(void) const { return timeScale; } uint32_t GetUnitsInTick(void) const { return unitsInTick; } void parse_SPS(uint8_t *sps, uint32_t sps_size, bool& interlaced, int32_t& max_ref_frames); + bool seen_SPS(void) const { return seen_sps; } + + bool found_AU(void) const { return AU_pending; } + private: enum constants {EXTENDED_SAR = 255}; inline void set_AU_pending(void) { @@ -245,9 +256,10 @@ uint sar_width, sar_height; uint32_t unitsInTick, timeScale; bool fixedRate; uint64_t pkt_offset, AU_offset, frame_start_offset, keyframe_start_offset; + uint64_t SPS_offset; bool on_frame, on_key_frame; }; #endif /* H264PARSER_H */