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

Side by Side Diff: media/filters/ffmpeg_demuxer_unittest.cc

Issue 11993002: Tighten up media::DecoderBuffer API contract for end of stream buffers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « media/filters/ffmpeg_audio_decoder.cc ('k') | media/filters/ffmpeg_video_decoder.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <algorithm> 5 #include <algorithm>
6 #include <deque> 6 #include <deque>
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/file_path.h" 10 #include "base/file_path.h"
(...skipping 27 matching lines...) Expand all
38 38
39 static void EosOnReadDone(bool* got_eos_buffer, 39 static void EosOnReadDone(bool* got_eos_buffer,
40 DemuxerStream::Status status, 40 DemuxerStream::Status status,
41 const scoped_refptr<DecoderBuffer>& buffer) { 41 const scoped_refptr<DecoderBuffer>& buffer) {
42 MessageLoop::current()->PostTask( 42 MessageLoop::current()->PostTask(
43 FROM_HERE, MessageLoop::QuitWhenIdleClosure()); 43 FROM_HERE, MessageLoop::QuitWhenIdleClosure());
44 44
45 EXPECT_EQ(status, DemuxerStream::kOk); 45 EXPECT_EQ(status, DemuxerStream::kOk);
46 if (buffer->IsEndOfStream()) { 46 if (buffer->IsEndOfStream()) {
47 *got_eos_buffer = true; 47 *got_eos_buffer = true;
48 EXPECT_TRUE(!buffer->GetData());
49 EXPECT_EQ(buffer->GetDataSize(), 0);
50 return; 48 return;
51 } 49 }
52 50
53 EXPECT_TRUE(buffer->GetData()); 51 EXPECT_TRUE(buffer->GetData());
54 EXPECT_GT(buffer->GetDataSize(), 0); 52 EXPECT_GT(buffer->GetDataSize(), 0);
55 *got_eos_buffer = false; 53 *got_eos_buffer = false;
56 }; 54 };
57 55
58 56
59 // Fixture class to facilitate writing tests. Takes care of setting up the 57 // Fixture class to facilitate writing tests. Takes care of setting up the
(...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after
623 TEST_F(FFmpegDemuxerTest, MP4_ZeroStszEntry) { 621 TEST_F(FFmpegDemuxerTest, MP4_ZeroStszEntry) {
624 #if !defined(USE_PROPRIETARY_CODECS) 622 #if !defined(USE_PROPRIETARY_CODECS)
625 return; 623 return;
626 #endif 624 #endif
627 CreateDemuxer("bear-1280x720-zero-stsz-entry.mp4"); 625 CreateDemuxer("bear-1280x720-zero-stsz-entry.mp4");
628 InitializeDemuxer(); 626 InitializeDemuxer();
629 ReadUntilEndOfStream(); 627 ReadUntilEndOfStream();
630 } 628 }
631 629
632 } // namespace media 630 } // namespace media
OLDNEW
« no previous file with comments | « media/filters/ffmpeg_audio_decoder.cc ('k') | media/filters/ffmpeg_video_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698