Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(155)

Side by Side Diff: media/formats/mp4/mp4_stream_parser.cc

Issue 1564983003: MSE: Log a warning if muxed AV media segment has no A or has no V block (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/mp4/mp4_stream_parser.h" 5 #include "media/formats/mp4/mp4_stream_parser.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <limits> 8 #include <limits>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 47
48 MP4StreamParser::~MP4StreamParser() {} 48 MP4StreamParser::~MP4StreamParser() {}
49 49
50 void MP4StreamParser::Init( 50 void MP4StreamParser::Init(
51 const InitCB& init_cb, 51 const InitCB& init_cb,
52 const NewConfigCB& config_cb, 52 const NewConfigCB& config_cb,
53 const NewBuffersCB& new_buffers_cb, 53 const NewBuffersCB& new_buffers_cb,
54 bool /* ignore_text_tracks */, 54 bool /* ignore_text_tracks */,
55 const EncryptedMediaInitDataCB& encrypted_media_init_data_cb, 55 const EncryptedMediaInitDataCB& encrypted_media_init_data_cb,
56 const NewMediaSegmentCB& new_segment_cb, 56 const NewMediaSegmentCB& new_segment_cb,
57 const base::Closure& end_of_segment_cb, 57 const EndMediaSegmentCB& end_of_segment_cb,
58 const scoped_refptr<MediaLog>& media_log) { 58 const scoped_refptr<MediaLog>& media_log) {
59 DCHECK_EQ(state_, kWaitingForInit); 59 DCHECK_EQ(state_, kWaitingForInit);
60 DCHECK(init_cb_.is_null()); 60 DCHECK(init_cb_.is_null());
61 DCHECK(!init_cb.is_null()); 61 DCHECK(!init_cb.is_null());
62 DCHECK(!config_cb.is_null()); 62 DCHECK(!config_cb.is_null());
63 DCHECK(!new_buffers_cb.is_null()); 63 DCHECK(!new_buffers_cb.is_null());
64 DCHECK(!encrypted_media_init_data_cb.is_null()); 64 DCHECK(!encrypted_media_init_data_cb.is_null());
65 DCHECK(!end_of_segment_cb.is_null()); 65 DCHECK(!end_of_segment_cb.is_null());
66 66
67 ChangeState(kParsingBoxes); 67 ChangeState(kParsingBoxes);
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 *err = !SendAndFlushSamples(audio_buffers, video_buffers); 419 *err = !SendAndFlushSamples(audio_buffers, video_buffers);
420 if (*err) 420 if (*err)
421 return false; 421 return false;
422 422
423 // Remain in kEmittingSamples state, discarding data, until the end of 423 // Remain in kEmittingSamples state, discarding data, until the end of
424 // the current 'mdat' box has been appended to the queue. 424 // the current 'mdat' box has been appended to the queue.
425 if (!queue_.Trim(mdat_tail_)) 425 if (!queue_.Trim(mdat_tail_))
426 return false; 426 return false;
427 427
428 ChangeState(kParsingBoxes); 428 ChangeState(kParsingBoxes);
429 end_of_segment_cb_.Run(); 429 *err = !end_of_segment_cb_.Run();
430 if (*err)
431 return false;
432
430 return true; 433 return true;
431 } 434 }
432 435
433 if (!runs_->IsSampleValid()) { 436 if (!runs_->IsSampleValid()) {
434 runs_->AdvanceRun(); 437 runs_->AdvanceRun();
435 return true; 438 return true;
436 } 439 }
437 440
438 DCHECK(!(*err)); 441 DCHECK(!(*err));
439 442
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
627 runs.AdvanceSample(); 630 runs.AdvanceSample();
628 } 631 }
629 runs.AdvanceRun(); 632 runs.AdvanceRun();
630 } 633 }
631 634
632 return true; 635 return true;
633 } 636 }
634 637
635 } // namespace mp4 638 } // namespace mp4
636 } // namespace media 639 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698