| 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/filters/frame_processor.h" | 5 #include "media/filters/frame_processor.h" |
| 6 | 6 |
| 7 #include "base/stl_util.h" | 7 #include "base/stl_util.h" |
| 8 #include "media/base/buffers.h" | 8 #include "media/base/buffers.h" |
| 9 #include "media/base/stream_parser_buffer.h" | 9 #include "media/base/stream_parser_buffer.h" |
| 10 | 10 |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 DVLOG(3) << __FUNCTION__ << ": Sending processed frame to stream, " | 332 DVLOG(3) << __FUNCTION__ << ": Sending processed frame to stream, " |
| 333 << "PTS=" << presentation_timestamp.InSecondsF() | 333 << "PTS=" << presentation_timestamp.InSecondsF() |
| 334 << ", DTS=" << decode_timestamp.InSecondsF(); | 334 << ", DTS=" << decode_timestamp.InSecondsF(); |
| 335 | 335 |
| 336 // Steps 13-18: | 336 // Steps 13-18: |
| 337 // TODO(wolenetz): Collect and emit more than one buffer at a time, if | 337 // TODO(wolenetz): Collect and emit more than one buffer at a time, if |
| 338 // possible. Also refactor SourceBufferStream to conform to spec GC timing. | 338 // possible. Also refactor SourceBufferStream to conform to spec GC timing. |
| 339 // See http://crbug.com/371197. | 339 // See http://crbug.com/371197. |
| 340 StreamParser::BufferQueue buffer_to_append; | 340 StreamParser::BufferQueue buffer_to_append; |
| 341 buffer_to_append.push_back(frame); | 341 buffer_to_append.push_back(frame); |
| 342 track_buffer->stream()->Append(buffer_to_append); | 342 if (!track_buffer->stream()->Append(buffer_to_append)) { |
| 343 DVLOG(3) << __FUNCTION__ << ": Failure appending frame to stream"; |
| 344 return false; |
| 345 } |
| 343 | 346 |
| 344 // 19. Set last decode timestamp for track buffer to decode timestamp. | 347 // 19. Set last decode timestamp for track buffer to decode timestamp. |
| 345 track_buffer->set_last_decode_timestamp(decode_timestamp); | 348 track_buffer->set_last_decode_timestamp(decode_timestamp); |
| 346 | 349 |
| 347 // 20. Set last frame duration for track buffer to frame duration. | 350 // 20. Set last frame duration for track buffer to frame duration. |
| 348 track_buffer->set_last_frame_duration(frame_duration); | 351 track_buffer->set_last_frame_duration(frame_duration); |
| 349 | 352 |
| 350 // 21. If highest presentation timestamp for track buffer is unset or frame | 353 // 21. If highest presentation timestamp for track buffer is unset or frame |
| 351 // end timestamp is greater than highest presentation timestamp, then | 354 // end timestamp is greater than highest presentation timestamp, then |
| 352 // set highest presentation timestamp for track buffer to frame end | 355 // set highest presentation timestamp for track buffer to frame end |
| (...skipping 15 matching lines...) Expand all Loading... |
| 368 } | 371 } |
| 369 | 372 |
| 370 void FrameProcessor::SetAllTrackBuffersNeedRandomAccessPoint() { | 373 void FrameProcessor::SetAllTrackBuffersNeedRandomAccessPoint() { |
| 371 for (TrackBufferMap::iterator itr = track_buffers_.begin(); | 374 for (TrackBufferMap::iterator itr = track_buffers_.begin(); |
| 372 itr != track_buffers_.end(); ++itr) { | 375 itr != track_buffers_.end(); ++itr) { |
| 373 itr->second->set_needs_random_access_point(true); | 376 itr->second->set_needs_random_access_point(true); |
| 374 } | 377 } |
| 375 } | 378 } |
| 376 | 379 |
| 377 } // namespace media | 380 } // namespace media |
| OLD | NEW |