| 1 | --- /media/FreeAgent GoFlex Drive/src/mythtv/mythtv/libs/libmythtv/mpeg/H264Parser.h 2013-03-05 19:22:37.000000000 +1300
|
|---|
| 2 | +++ mythtv/mythtv/libs/libmythtv/mpeg/H264Parser.h 2013-03-30 17:34:21.818946139 +1300
|
|---|
| 3 | @@ -58,11 +58,11 @@
|
|---|
| 4 | };
|
|---|
| 5 |
|
|---|
| 6 | // ITU-T Rec. H.264 table 7-1
|
|---|
| 7 | enum NAL_unit_type {
|
|---|
| 8 | UNKNOWN = 0,
|
|---|
| 9 | - SLICE = 1,
|
|---|
| 10 | + SLICE = 1, // 1 - 5 are VCL NAL units
|
|---|
| 11 | SLICE_DPA = 2,
|
|---|
| 12 | SLICE_DPB = 3,
|
|---|
| 13 | SLICE_DPC = 4,
|
|---|
| 14 | SLICE_IDR = 5,
|
|---|
| 15 | SEI = 6,
|
|---|
| 16 | @@ -71,15 +71,19 @@
|
|---|
| 17 | AU_DELIMITER = 9,
|
|---|
| 18 | END_SEQUENCE = 10,
|
|---|
| 19 | END_STREAM = 11,
|
|---|
| 20 | FILLER_DATA = 12,
|
|---|
| 21 | SPS_EXT = 13,
|
|---|
| 22 | - AUXILIARY_SLICE = 19
|
|---|
| 23 | + NALU_prefix = 14,
|
|---|
| 24 | + SPS_subset = 15,
|
|---|
| 25 | + AUXILIARY_SLICE = 19,
|
|---|
| 26 | + SLICE_EXTENSION = 20
|
|---|
| 27 | };
|
|---|
| 28 |
|
|---|
| 29 | enum SEI_type {
|
|---|
| 30 | SEI_TYPE_PIC_TIMING = 1,
|
|---|
| 31 | + SEI_FILLER_PAYLOAD = 3,
|
|---|
| 32 | SEI_TYPE_USER_DATA_UNREGISTERED = 5,
|
|---|
| 33 | SEI_TYPE_RECOVERY_POINT = 6
|
|---|
| 34 | };
|
|---|
| 35 |
|
|---|
| 36 | /*
|
|---|
| 37 | @@ -145,11 +149,13 @@
|
|---|
| 38 | double frameRate(void) const;
|
|---|
| 39 | void getFrameRate(FrameRate &result) const;
|
|---|
| 40 |
|
|---|
| 41 | uint64_t frameAUstreamOffset(void) const {return frame_start_offset;}
|
|---|
| 42 | uint64_t keyframeAUstreamOffset(void) const {return keyframe_start_offset;}
|
|---|
| 43 | -
|
|---|
| 44 | + uint64_t SPSstreamOffset(void) const {return SPS_offset;}
|
|---|
| 45 | +
|
|---|
| 46 | +// == NAL_type AU_delimiter: primary_pic_type = 5
|
|---|
| 47 | static int isKeySlice(uint slice_type)
|
|---|
| 48 | {
|
|---|
| 49 | return (slice_type == SLICE_I ||
|
|---|
| 50 | slice_type == SLICE_SI ||
|
|---|
| 51 | slice_type == SLICE_I_a ||
|
|---|
| 52 | @@ -162,18 +168,23 @@
|
|---|
| 53 | nal_type == SLICE_DPA ||
|
|---|
| 54 | nal_type == SLICE_IDR);
|
|---|
| 55 | }
|
|---|
| 56 |
|
|---|
| 57 | void use_I_forKeyframes(bool val) { I_is_keyframe = val; }
|
|---|
| 58 | + bool using_I_forKeyframes(void) const { return I_is_keyframe; }
|
|---|
| 59 |
|
|---|
| 60 | uint32_t GetTimeScale(void) const { return timeScale; }
|
|---|
| 61 |
|
|---|
| 62 | uint32_t GetUnitsInTick(void) const { return unitsInTick; }
|
|---|
| 63 |
|
|---|
| 64 | void parse_SPS(uint8_t *sps, uint32_t sps_size,
|
|---|
| 65 | bool& interlaced, int32_t& max_ref_frames);
|
|---|
| 66 |
|
|---|
| 67 | + bool seen_SPS(void) const { return seen_sps; }
|
|---|
| 68 | +
|
|---|
| 69 | + bool found_AU(void) const { return AU_pending; }
|
|---|
| 70 | +
|
|---|
| 71 | private:
|
|---|
| 72 | enum constants {EXTENDED_SAR = 255};
|
|---|
| 73 |
|
|---|
| 74 | inline void set_AU_pending(void)
|
|---|
| 75 | {
|
|---|
| 76 | @@ -245,9 +256,10 @@
|
|---|
| 77 | uint sar_width, sar_height;
|
|---|
| 78 | uint32_t unitsInTick, timeScale;
|
|---|
| 79 | bool fixedRate;
|
|---|
| 80 |
|
|---|
| 81 | uint64_t pkt_offset, AU_offset, frame_start_offset, keyframe_start_offset;
|
|---|
| 82 | + uint64_t SPS_offset;
|
|---|
| 83 | bool on_frame, on_key_frame;
|
|---|
| 84 | };
|
|---|
| 85 |
|
|---|
| 86 | #endif /* H264PARSER_H */
|
|---|