OLD | NEW |
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 #ifndef MEDIA_WEBM_WEBM_CLUSTER_PARSER_H_ | 5 #ifndef MEDIA_WEBM_WEBM_CLUSTER_PARSER_H_ |
6 #define MEDIA_WEBM_WEBM_CLUSTER_PARSER_H_ | 6 #define MEDIA_WEBM_WEBM_CLUSTER_PARSER_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 ~Track(); | 48 ~Track(); |
49 | 49 |
50 int track_num() const { return track_num_; } | 50 int track_num() const { return track_num_; } |
51 const BufferQueue& buffers() const { return buffers_; } | 51 const BufferQueue& buffers() const { return buffers_; } |
52 | 52 |
53 bool AddBuffer(const scoped_refptr<StreamParserBuffer>& buffer); | 53 bool AddBuffer(const scoped_refptr<StreamParserBuffer>& buffer); |
54 | 54 |
55 // Clears all buffer state. | 55 // Clears all buffer state. |
56 void Reset(); | 56 void Reset(); |
57 | 57 |
58 // Clears only the |buffers_|. | |
59 void ClearBufferQueue(); | |
60 | |
61 private: | 58 private: |
62 // Sets the duration of all the buffers in |delayed_buffers_| | |
63 // and then moves these buffers into |buffers_|. |delayed_buffers_| | |
64 // is empty when this call returns. | |
65 void SetDelayedBufferDurations(base::TimeDelta duration); | |
66 | |
67 // Adds the buffer to |buffers_|. |buffer| must have its duration set. | |
68 void AddToBufferQueue(const scoped_refptr<StreamParserBuffer>& buffer); | |
69 | |
70 int track_num_; | 59 int track_num_; |
71 BufferQueue buffers_; | 60 BufferQueue buffers_; |
72 BufferQueue delayed_buffers_; | |
73 }; | 61 }; |
74 | 62 |
75 // WebMParserClient methods. | 63 // WebMParserClient methods. |
76 virtual WebMParserClient* OnListStart(int id) OVERRIDE; | 64 virtual WebMParserClient* OnListStart(int id) OVERRIDE; |
77 virtual bool OnListEnd(int id) OVERRIDE; | 65 virtual bool OnListEnd(int id) OVERRIDE; |
78 virtual bool OnUInt(int id, int64 val) OVERRIDE; | 66 virtual bool OnUInt(int id, int64 val) OVERRIDE; |
79 virtual bool OnBinary(int id, const uint8* data, int size) OVERRIDE; | 67 virtual bool OnBinary(int id, const uint8* data, int size) OVERRIDE; |
80 | 68 |
81 bool ParseBlock(const uint8* buf, int size, int duration); | 69 bool ParseBlock(const uint8* buf, int size, int duration); |
82 bool OnBlock(int track_num, int timecode, int duration, int flags, | 70 bool OnBlock(int track_num, int timecode, int duration, int flags, |
(...skipping 16 matching lines...) Expand all Loading... |
99 | 87 |
100 Track audio_; | 88 Track audio_; |
101 Track video_; | 89 Track video_; |
102 | 90 |
103 DISALLOW_IMPLICIT_CONSTRUCTORS(WebMClusterParser); | 91 DISALLOW_IMPLICIT_CONSTRUCTORS(WebMClusterParser); |
104 }; | 92 }; |
105 | 93 |
106 } // namespace media | 94 } // namespace media |
107 | 95 |
108 #endif // MEDIA_WEBM_WEBM_CLUSTER_PARSER_H_ | 96 #endif // MEDIA_WEBM_WEBM_CLUSTER_PARSER_H_ |
OLD | NEW |