OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 16 matching lines...) Expand all Loading... |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #ifndef SourceBuffer_h | 31 #ifndef SourceBuffer_h |
32 #define SourceBuffer_h | 32 #define SourceBuffer_h |
33 | 33 |
34 #if ENABLE(MEDIA_SOURCE) | 34 #if ENABLE(MEDIA_SOURCE) |
35 | 35 |
36 #include "ExceptionCode.h" | 36 #include "ExceptionCode.h" |
37 #include "MediaSource.h" | |
38 #include <wtf/PassRefPtr.h> | 37 #include <wtf/PassRefPtr.h> |
39 #include <wtf/RefCounted.h> | 38 #include <wtf/RefCounted.h> |
40 #include <wtf/text/WTFString.h> | 39 #include <wtf/text/WTFString.h> |
41 | 40 |
42 namespace WebCore { | 41 namespace WebCore { |
43 | 42 |
44 class TimeRanges; | 43 class TimeRanges; |
45 | 44 |
46 class SourceBuffer : public RefCounted<SourceBuffer> { | 45 class SourceBuffer : public RefCounted<SourceBuffer> { |
47 public: | 46 public: |
48 static PassRefPtr<SourceBuffer> create(const String& id, PassRefPtr<MediaSou
rce> source) | 47 static PassRefPtr<SourceBuffer> create(const String& id) |
49 { | 48 { |
50 return adoptRef(new SourceBuffer(id, source)); | 49 return adoptRef(new SourceBuffer(id)); |
51 } | 50 } |
52 | 51 |
53 virtual ~SourceBuffer(); | 52 virtual ~SourceBuffer(); |
54 | 53 |
55 PassRefPtr<TimeRanges> buffered(ExceptionCode&) const; | 54 PassRefPtr<TimeRanges> buffered(ExceptionCode&) const; |
56 | 55 |
57 void append(PassRefPtr<Uint8Array> data, ExceptionCode&); | 56 void append(PassRefPtr<Uint8Array> data, ExceptionCode&); |
58 | 57 |
59 void abort(ExceptionCode&); | 58 void abort(ExceptionCode&); |
60 | 59 |
61 const String& id() const { return m_id; } | 60 const String& id() const { return m_id; } |
62 | 61 |
63 void clear() { m_source.clear(); } | 62 void clear() { } |
64 | 63 |
65 private: | 64 private: |
66 explicit SourceBuffer(const String& id, PassRefPtr<MediaSource>); | 65 explicit SourceBuffer(const String& id); |
67 | 66 |
68 String m_id; | 67 String m_id; |
69 RefPtr<MediaSource> m_source; | |
70 }; | 68 }; |
71 | 69 |
72 } // namespace WebCore | 70 } // namespace WebCore |
73 | 71 |
74 #endif | 72 #endif |
75 #endif | 73 #endif |
OLD | NEW |