From 77e9302aa9796f112556a01f6bd64cdf5fefecc9 Mon Sep 17 00:00:00 2001 From: Thomas Inskip Date: Tue, 29 Apr 2014 11:51:28 -0700 Subject: [PATCH] Cleaned up TODOs from MPEG-2 code. --- media/filters/h264_bit_reader.h | 2 -- media/filters/h264_parser.h | 4 +--- media/formats/mp2t/es_parser_h264.cc | 4 +--- media/formats/mp2t/mp2t_media_parser.cc | 5 ++--- media/formats/mp2t/ts_packet.cc | 3 --- media/formats/mp2t/ts_section_pes.cc | 1 - media/formats/mp2t/ts_section_pmt.cc | 7 ------- media/formats/mp2t/ts_section_pmt.h | 1 - 8 files changed, 4 insertions(+), 23 deletions(-) diff --git a/media/filters/h264_bit_reader.h b/media/filters/h264_bit_reader.h index de65886a1b..14c03240fa 100644 --- a/media/filters/h264_bit_reader.h +++ b/media/filters/h264_bit_reader.h @@ -25,8 +25,6 @@ class H264BitReader { // Initialize the reader to start reading at |data|, |size| being size // of |data| in bytes. // Return false on insufficient size of stream.. - // TODO(posciak,fischman): consider replacing Initialize() with - // heap-allocating and creating bit readers on demand instead. bool Initialize(const uint8* data, off_t size); // Read |num_bits| next bits from stream and return in |*out|, first bit diff --git a/media/filters/h264_parser.h b/media/filters/h264_parser.h index d9d5223f6a..37d3a99229 100644 --- a/media/filters/h264_parser.h +++ b/media/filters/h264_parser.h @@ -111,7 +111,6 @@ struct H264PPS { bool entropy_coding_mode_flag; bool bottom_field_pic_order_in_frame_present_flag; int num_slice_groups_minus1; - // TODO(posciak): Slice groups not implemented, could be added at some point. int num_ref_idx_l0_default_active_minus1; int num_ref_idx_l1_default_active_minus1; bool weighted_pred_flag; @@ -187,7 +186,7 @@ struct H264SliceHeader { int first_mb_in_slice; int slice_type; int pic_parameter_set_id; - int colour_plane_id; // TODO(posciak): use this! http://crbug.com/139878 + int colour_plane_id; int frame_num; bool field_pic_flag; bool bottom_field_flag; @@ -307,7 +306,6 @@ class H264Parser { // of the parsed structure in |*pps_id|/|*sps_id|. // To get a pointer to a given SPS/PPS structure, use GetSPS()/GetPPS(), // passing the returned |*sps_id|/|*pps_id| as parameter. - // TODO(posciak,fischman): consider replacing returning Result from Parse*() // methods with a scoped_ptr and adding an AtEOS() function to check for EOS // if Parse*() return NULL. Result ParseSPS(int* sps_id); diff --git a/media/formats/mp2t/es_parser_h264.cc b/media/formats/mp2t/es_parser_h264.cc index b4380b573a..c3482fb32a 100644 --- a/media/formats/mp2t/es_parser_h264.cc +++ b/media/formats/mp2t/es_parser_h264.cc @@ -223,8 +223,6 @@ bool EsParserH264::ParseInternal() { if (h264_parser_->ParseSliceHeader(nalu, &shdr) != H264Parser::kOk) { // Only accept an invalid SPS/PPS at the beginning when the stream // does not necessarily start with an SPS/PPS/IDR. - // TODO(damienv): Should be able to differentiate a missing SPS/PPS - // from a slice header parsing error. if (last_video_decoder_config_) return false; } else { @@ -330,7 +328,7 @@ bool EsParserH264::UpdateVideoDecoderConfig(const H264SPS* sps) { return false; } - // TODO(damienv): a MAP unit can be either 16 or 32 pixels. + // TODO: a MAP unit can be either 16 or 32 pixels. // although it's 16 pixels for progressive non MBAFF frames. uint16 width = (sps->pic_width_in_mbs_minus1 + 1) * 16; uint16 height = (sps->pic_height_in_map_units_minus1 + 1) * 16; diff --git a/media/formats/mp2t/mp2t_media_parser.cc b/media/formats/mp2t/mp2t_media_parser.cc index 100ef35080..97dc372633 100644 --- a/media/formats/mp2t/mp2t_media_parser.cc +++ b/media/formats/mp2t/mp2t_media_parser.cc @@ -280,9 +280,8 @@ void Mp2tMediaParser::RegisterPmt(int program_number, int pmt_pid) { } void Mp2tMediaParser::RegisterPes(int pmt_pid, - int pes_pid, - int stream_type) { - // TODO(damienv): check there is no mismatch if the entry already exists. + int pes_pid, + int stream_type) { DVLOG(1) << "RegisterPes:" << " pes_pid=" << pes_pid << " stream_type=" << std::hex << stream_type << std::dec; diff --git a/media/formats/mp2t/ts_packet.cc b/media/formats/mp2t/ts_packet.cc index 8463c11e33..91b254f593 100644 --- a/media/formats/mp2t/ts_packet.cc +++ b/media/formats/mp2t/ts_packet.cc @@ -19,8 +19,6 @@ int TsPacket::Sync(const uint8* buf, int size) { for (; k < size; k++) { // Verify that we have 4 syncwords in a row when possible, // this should improve synchronization robustness. - // TODO(damienv): Consider the case where there is garbage - // between TS packets. bool is_header = true; for (int i = 0; i < 4; i++) { int idx = k + i * kPacketSize; @@ -212,4 +210,3 @@ bool TsPacket::ParseAdaptationField(BitReader* bit_reader, } // namespace mp2t } // namespace media - diff --git a/media/formats/mp2t/ts_section_pes.cc b/media/formats/mp2t/ts_section_pes.cc index 11d06450fa..79481731f1 100644 --- a/media/formats/mp2t/ts_section_pes.cc +++ b/media/formats/mp2t/ts_section_pes.cc @@ -286,7 +286,6 @@ bool TsSectionPes::ParseInternal(const uint8* raw_pes, int raw_pes_size) { } // Discard the rest of the PES packet header. - // TODO(damienv): check if some info of the PES packet header are useful. DCHECK_EQ(bit_reader.bits_available() % 8, 0); int pes_header_remaining_size = pes_header_data_length - (pes_header_start_size - bit_reader.bits_available() / 8); diff --git a/media/formats/mp2t/ts_section_pmt.cc b/media/formats/mp2t/ts_section_pmt.cc index 72b492aaa4..a5e7b0ec11 100644 --- a/media/formats/mp2t/ts_section_pmt.cc +++ b/media/formats/mp2t/ts_section_pmt.cc @@ -57,10 +57,6 @@ bool TsSectionPmt::ParsePsiSection(BitReader* bit_reader) { RCHECK(section_number == 0); RCHECK(last_section_number == 0); - // TODO(damienv): - // Verify that there is no mismatch between the program number - // and the program number that was provided in a PAT for the current PMT. - // Read the end of the fixed length section. int pcr_pid; int program_info_length; @@ -71,7 +67,6 @@ bool TsSectionPmt::ParsePsiSection(BitReader* bit_reader) { RCHECK(program_info_length < 1024); // Read the program info descriptor. - // TODO(damienv): check wether any of the descriptors could be useful. // Defined in section 2.6 of ISO-13818. RCHECK(bit_reader->SkipBits(8 * program_info_length)); @@ -97,7 +92,6 @@ bool TsSectionPmt::ParsePsiSection(BitReader* bit_reader) { pid_map.insert(std::pair(pid_es, stream_type)); // Read the ES info descriptors. - // TODO(damienv): check wether any of the descriptors could be useful. // Defined in section 2.6 of ISO-13818. RCHECK(bit_reader->SkipBits(8 * es_info_length)); } @@ -119,4 +113,3 @@ void TsSectionPmt::ResetPsiSection() { } // namespace mp2t } // namespace media - diff --git a/media/formats/mp2t/ts_section_pmt.h b/media/formats/mp2t/ts_section_pmt.h index 86bbdd4124..7434699d63 100644 --- a/media/formats/mp2t/ts_section_pmt.h +++ b/media/formats/mp2t/ts_section_pmt.h @@ -17,7 +17,6 @@ class TsSectionPmt : public TsSectionPsi { // RegisterPesCb::Run(int pes_pid, int stream_type); // Stream type is defined in // "Table 2-34 – Stream type assignments" in H.222 - // TODO(damienv): add the program number. typedef base::Callback RegisterPesCb; explicit TsSectionPmt(const RegisterPesCb& register_pes_cb);