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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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_|. | 58 // Clears only the |buffers_|. |
59 void ClearBufferQueue(); | 59 void ClearBufferQueue(); |
60 | 60 |
61 private: | 61 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. | 62 // Adds the buffer to |buffers_|. |buffer| must have its duration set. |
68 void AddToBufferQueue(const scoped_refptr<StreamParserBuffer>& buffer); | 63 void AddToBufferQueue(const scoped_refptr<StreamParserBuffer>& buffer); |
69 | 64 |
70 int track_num_; | 65 int track_num_; |
71 BufferQueue buffers_; | 66 BufferQueue buffers_; |
72 BufferQueue delayed_buffers_; | |
73 }; | 67 }; |
74 | 68 |
75 // WebMParserClient methods. | 69 // WebMParserClient methods. |
76 virtual WebMParserClient* OnListStart(int id) OVERRIDE; | 70 virtual WebMParserClient* OnListStart(int id) OVERRIDE; |
77 virtual bool OnListEnd(int id) OVERRIDE; | 71 virtual bool OnListEnd(int id) OVERRIDE; |
78 virtual bool OnUInt(int id, int64 val) OVERRIDE; | 72 virtual bool OnUInt(int id, int64 val) OVERRIDE; |
79 virtual bool OnBinary(int id, const uint8* data, int size) OVERRIDE; | 73 virtual bool OnBinary(int id, const uint8* data, int size) OVERRIDE; |
80 | 74 |
81 bool ParseBlock(const uint8* buf, int size, int duration); | 75 bool ParseBlock(const uint8* buf, int size, int duration); |
82 bool OnBlock(int track_num, int timecode, int duration, int flags, | 76 bool OnBlock(int track_num, int timecode, int duration, int flags, |
(...skipping 16 matching lines...) Expand all Loading... |
99 | 93 |
100 Track audio_; | 94 Track audio_; |
101 Track video_; | 95 Track video_; |
102 | 96 |
103 DISALLOW_IMPLICIT_CONSTRUCTORS(WebMClusterParser); | 97 DISALLOW_IMPLICIT_CONSTRUCTORS(WebMClusterParser); |
104 }; | 98 }; |
105 | 99 |
106 } // namespace media | 100 } // namespace media |
107 | 101 |
108 #endif // MEDIA_WEBM_WEBM_CLUSTER_PARSER_H_ | 102 #endif // MEDIA_WEBM_WEBM_CLUSTER_PARSER_H_ |
OLD | NEW |