summaryrefslogtreecommitdiff
path: root/command/streaminfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'command/streaminfo.cpp')
-rw-r--r--command/streaminfo.cpp67
1 files changed, 41 insertions, 26 deletions
diff --git a/command/streaminfo.cpp b/command/streaminfo.cpp
index 62beb6f..8657bb2 100644
--- a/command/streaminfo.cpp
+++ b/command/streaminfo.cpp
@@ -121,7 +121,7 @@ bool cMarkAdStreamInfo::FindVideoInfos(MarkAdContext *maContext, uchar *pkt, int
}
return false;
}
-
+#include <stdio.h>
bool cMarkAdStreamInfo::FindH264VideoInfos(MarkAdContext *maContext, uchar *pkt, int len)
{
if ((!maContext) || (!pkt) || (!len)) return false;
@@ -134,45 +134,60 @@ bool cMarkAdStreamInfo::FindH264VideoInfos(MarkAdContext *maContext, uchar *pkt,
if (pkt[5]==0x10)
{
maContext->Video.Info.Pict_Type=MA_I_TYPE;
+ H264.use_field=false;
return true;
}
else
{
- if (maContext->Video.Info.Interlaced) {
- if (H264.use_field) return true;
+ if (maContext->Video.Info.Interlaced)
+ {
+ if (H264.use_field) {
+ H264.use_field=false;
+ return true;
+ } else {
+ H264.use_field=true;
+ }
} else {
return true;
}
+
+ /*
+ if (maContext->Video.Info.Interlaced) {
+ if (H264.use_field) return true;
+ } else {
+ return true;
+ }
+ */
}
}
-
- if ((nalu==NAL_SLICE) || (nalu==NAL_IDR_SLICE))
- {
- uint8_t *nal_data=(uint8_t*) alloca(len);
- if (!nal_data) return false;
- int nal_len = nalUnescape(nal_data, pkt + 5, len - 5);
- cBitStream bs(nal_data, nal_len);
-
- bs.skipUeGolomb(); // first_mb_in_slice
- bs.skipUeGolomb(); // slice_type
- bs.skipUeGolomb(); // pic_parameter_set_id
- if (H264.separate_colour_plane_flag)
+ /*
+ if ((nalu==NAL_SLICE) || (nalu==NAL_IDR_SLICE))
{
- bs.skipBits(2); // colour_plane_id
- }
- bs.skipBits(H264.log2_max_frame_num); // frame_num
+ uint8_t *nal_data=(uint8_t*) alloca(len);
+ if (!nal_data) return false;
+ int nal_len = nalUnescape(nal_data, pkt + 5, len - 5);
+ cBitStream bs(nal_data, nal_len);
+
+ bs.skipUeGolomb(); // first_mb_in_slice
+ bs.skipUeGolomb(); // slice_type
+ bs.skipUeGolomb(); // pic_parameter_set_id
+ if (H264.separate_colour_plane_flag)
+ {
+ bs.skipBits(2); // colour_plane_id
+ }
+ bs.skipBits(H264.log2_max_frame_num); // frame_num
- if (maContext->Video.Info.Interlaced)
- {
- if (bs.getBit()) // field_pic_flag
+ if (maContext->Video.Info.Interlaced)
{
- H264.use_field=bs.getBit(); // bottom_field_flag
- } else {
- H264.use_field=true;
+ if (bs.getBit()) // field_pic_flag
+ {
+ H264.use_field=bs.getBit(); // bottom_field_flag
+ } else {
+ H264.use_field=true;
+ }
}
}
- }
-
+ */
if (nalu==NAL_SPS)
{
uint8_t *nal_data=(uint8_t*) alloca(len);