| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "media/formats/mp2t/es_parser_h264.h" | 5 #include "media/formats/mp2t/es_parser_h264.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "media/base/bit_reader.h" | 9 #include "media/base/bit_reader.h" |
| 10 #include "media/base/buffers.h" | 10 #include "media/base/buffers.h" |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 | 245 |
| 246 // Emit a frame. | 246 // Emit a frame. |
| 247 int raw_es_size; | 247 int raw_es_size; |
| 248 const uint8* raw_es; | 248 const uint8* raw_es; |
| 249 es_byte_queue_.Peek(&raw_es, &raw_es_size); | 249 es_byte_queue_.Peek(&raw_es, &raw_es_size); |
| 250 int access_unit_size = next_aud_pos - current_access_unit_pos_; | 250 int access_unit_size = next_aud_pos - current_access_unit_pos_; |
| 251 scoped_refptr<StreamParserBuffer> stream_parser_buffer = | 251 scoped_refptr<StreamParserBuffer> stream_parser_buffer = |
| 252 StreamParserBuffer::CopyFrom( | 252 StreamParserBuffer::CopyFrom( |
| 253 &raw_es[current_access_unit_pos_], | 253 &raw_es[current_access_unit_pos_], |
| 254 access_unit_size, | 254 access_unit_size, |
| 255 is_key_frame_); | 255 is_key_frame_, |
| 256 StreamParserBuffer::kVideo); |
| 256 stream_parser_buffer->SetDecodeTimestamp(current_timing_desc.dts); | 257 stream_parser_buffer->SetDecodeTimestamp(current_timing_desc.dts); |
| 257 stream_parser_buffer->set_timestamp(current_timing_desc.pts); | 258 stream_parser_buffer->set_timestamp(current_timing_desc.pts); |
| 258 emit_buffer_cb_.Run(stream_parser_buffer); | 259 emit_buffer_cb_.Run(stream_parser_buffer); |
| 259 | 260 |
| 260 // Set the current frame position to the next AUD position. | 261 // Set the current frame position to the next AUD position. |
| 261 StartFrame(next_aud_pos); | 262 StartFrame(next_aud_pos); |
| 262 return true; | 263 return true; |
| 263 } | 264 } |
| 264 | 265 |
| 265 void EsParserH264::StartFrame(int aud_pos) { | 266 void EsParserH264::StartFrame(int aud_pos) { |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 526 last_video_decoder_config_ = video_decoder_config; | 527 last_video_decoder_config_ = video_decoder_config; |
| 527 new_video_config_cb_.Run(video_decoder_config); | 528 new_video_config_cb_.Run(video_decoder_config); |
| 528 } | 529 } |
| 529 | 530 |
| 530 return true; | 531 return true; |
| 531 } | 532 } |
| 532 | 533 |
| 533 } // namespace mp2t | 534 } // namespace mp2t |
| 534 } // namespace media | 535 } // namespace media |
| 535 | 536 |
| OLD | NEW |