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

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

Issue 10067035: RefCounted types should not have public destructors, media/ and gpu/ edition (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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
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 "media/filters/chunk_demuxer.h" 5 #include "media/filters/chunk_demuxer.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "media/base/audio_decoder_config.h" 10 #include "media/base/audio_decoder_config.h"
(...skipping 10 matching lines...) Expand all
21 } 21 }
22 22
23 class ChunkDemuxerStream : public DemuxerStream { 23 class ChunkDemuxerStream : public DemuxerStream {
24 public: 24 public:
25 typedef std::deque<scoped_refptr<Buffer> > BufferQueue; 25 typedef std::deque<scoped_refptr<Buffer> > BufferQueue;
26 typedef std::deque<ReadCB> ReadCBQueue; 26 typedef std::deque<ReadCB> ReadCBQueue;
27 typedef std::deque<base::Closure> ClosureQueue; 27 typedef std::deque<base::Closure> ClosureQueue;
28 28
29 explicit ChunkDemuxerStream(const AudioDecoderConfig& audio_config); 29 explicit ChunkDemuxerStream(const AudioDecoderConfig& audio_config);
30 explicit ChunkDemuxerStream(const VideoDecoderConfig& video_config); 30 explicit ChunkDemuxerStream(const VideoDecoderConfig& video_config);
31 virtual ~ChunkDemuxerStream();
32 31
33 void Flush(); 32 void Flush();
34 void Seek(base::TimeDelta time); 33 void Seek(base::TimeDelta time);
35 34
36 // Checks if it is ok to add the |buffers| to the stream. 35 // Checks if it is ok to add the |buffers| to the stream.
37 bool CanAddBuffers(const BufferQueue& buffers) const; 36 bool CanAddBuffers(const BufferQueue& buffers) const;
38 37
39 void AddBuffers(const BufferQueue& buffers); 38 void AddBuffers(const BufferQueue& buffers);
40 void Shutdown(); 39 void Shutdown();
41 40
42 bool GetLastBufferTimestamp(base::TimeDelta* timestamp) const; 41 bool GetLastBufferTimestamp(base::TimeDelta* timestamp) const;
43 42
44 // DemuxerStream methods. 43 // DemuxerStream methods.
45 virtual void Read(const ReadCB& read_cb) OVERRIDE; 44 virtual void Read(const ReadCB& read_cb) OVERRIDE;
46 virtual Type type() OVERRIDE; 45 virtual Type type() OVERRIDE;
47 virtual void EnableBitstreamConverter() OVERRIDE; 46 virtual void EnableBitstreamConverter() OVERRIDE;
48 virtual const AudioDecoderConfig& audio_decoder_config() OVERRIDE; 47 virtual const AudioDecoderConfig& audio_decoder_config() OVERRIDE;
49 virtual const VideoDecoderConfig& video_decoder_config() OVERRIDE; 48 virtual const VideoDecoderConfig& video_decoder_config() OVERRIDE;
50 49
51 private: 50 private:
51 virtual ~ChunkDemuxerStream();
52
52 enum State { 53 enum State {
53 RETURNING_DATA_FOR_READS, 54 RETURNING_DATA_FOR_READS,
54 WAITING_FOR_SEEK, 55 WAITING_FOR_SEEK,
55 RECEIVED_EOS_WHILE_WAITING_FOR_SEEK, // EOS = End of stream. 56 RECEIVED_EOS_WHILE_WAITING_FOR_SEEK, // EOS = End of stream.
56 RECEIVED_EOS, 57 RECEIVED_EOS,
57 RETURNING_EOS_FOR_READS, 58 RETURNING_EOS_FOR_READS,
58 SHUTDOWN, 59 SHUTDOWN,
59 }; 60 };
60 61
61 // Assigns |state_| to |state| 62 // Assigns |state_| to |state|
(...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after
714 if (!video_->CanAddBuffers(buffers)) 715 if (!video_->CanAddBuffers(buffers))
715 return false; 716 return false;
716 717
717 video_->AddBuffers(buffers); 718 video_->AddBuffers(buffers);
718 seek_waits_for_data_ = false; 719 seek_waits_for_data_ = false;
719 720
720 return true; 721 return true;
721 } 722 }
722 723
723 } // namespace media 724 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698