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 21 matching lines...) Expand all Loading... | |
32 // Parses a WebM cluster element in |buf|. | 32 // Parses a WebM cluster element in |buf|. |
33 // | 33 // |
34 // Returns -1 if the parse fails. | 34 // Returns -1 if the parse fails. |
35 // Returns 0 if more data is needed. | 35 // Returns 0 if more data is needed. |
36 // Returns the number of bytes parsed on success. | 36 // Returns the number of bytes parsed on success. |
37 int Parse(const uint8* buf, int size); | 37 int Parse(const uint8* buf, int size); |
38 | 38 |
39 base::TimeDelta cluster_start_time() const { return cluster_start_time_; } | 39 base::TimeDelta cluster_start_time() const { return cluster_start_time_; } |
40 const BufferQueue& audio_buffers() const { return audio_.buffers(); } | 40 const BufferQueue& audio_buffers() const { return audio_.buffers(); } |
41 const BufferQueue& video_buffers() const { return video_.buffers(); } | 41 const BufferQueue& video_buffers() const { return video_.buffers(); } |
42 bool cluster_ended() const { return cluster_ended_; } | |
acolwell GONE FROM CHROMIUM
2012/07/20 18:21:01
Add a comment indicating this returns true if the
vrk (LEFT CHROMIUM)
2012/07/25 17:16:48
Done.
| |
42 | 43 |
43 private: | 44 private: |
44 // Helper class that manages per-track state. | 45 // Helper class that manages per-track state. |
45 class Track { | 46 class Track { |
46 public: | 47 public: |
47 explicit Track(int track_num); | 48 explicit Track(int track_num); |
48 ~Track(); | 49 ~Track(); |
49 | 50 |
50 int track_num() const { return track_num_; } | 51 int track_num() const { return track_num_; } |
51 const BufferQueue& buffers() const { return buffers_; } | 52 const BufferQueue& buffers() const { return buffers_; } |
(...skipping 25 matching lines...) Expand all Loading... | |
77 | 78 |
78 WebMListParser parser_; | 79 WebMListParser parser_; |
79 | 80 |
80 int64 last_block_timecode_; | 81 int64 last_block_timecode_; |
81 scoped_array<uint8> block_data_; | 82 scoped_array<uint8> block_data_; |
82 int block_data_size_; | 83 int block_data_size_; |
83 int64 block_duration_; | 84 int64 block_duration_; |
84 | 85 |
85 int64 cluster_timecode_; | 86 int64 cluster_timecode_; |
86 base::TimeDelta cluster_start_time_; | 87 base::TimeDelta cluster_start_time_; |
88 bool cluster_ended_; | |
87 | 89 |
88 Track audio_; | 90 Track audio_; |
89 Track video_; | 91 Track video_; |
90 | 92 |
91 DISALLOW_IMPLICIT_CONSTRUCTORS(WebMClusterParser); | 93 DISALLOW_IMPLICIT_CONSTRUCTORS(WebMClusterParser); |
92 }; | 94 }; |
93 | 95 |
94 } // namespace media | 96 } // namespace media |
95 | 97 |
96 #endif // MEDIA_WEBM_WEBM_CLUSTER_PARSER_H_ | 98 #endif // MEDIA_WEBM_WEBM_CLUSTER_PARSER_H_ |
OLD | NEW |