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

Side by Side Diff: Source/WebCore/Modules/mediasource/SourceBuffer.cpp

Issue 10834324: Revert 124780 - Create a MediaSource object. (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1229/
Patch Set: Created 8 years, 4 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
OLDNEW
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 20 matching lines...) Expand all
31 #include "config.h" 31 #include "config.h"
32 #include "SourceBuffer.h" 32 #include "SourceBuffer.h"
33 33
34 #if ENABLE(MEDIA_SOURCE) 34 #if ENABLE(MEDIA_SOURCE)
35 35
36 #include "TimeRanges.h" 36 #include "TimeRanges.h"
37 #include <wtf/Uint8Array.h> 37 #include <wtf/Uint8Array.h>
38 38
39 namespace WebCore { 39 namespace WebCore {
40 40
41 SourceBuffer::SourceBuffer(const String& id, PassRefPtr<MediaSource> source) 41 SourceBuffer::SourceBuffer(const String& id)
42 : m_id(id) 42 : m_id(id)
43 , m_source(source)
44 { 43 {
45 } 44 }
46 45
47 SourceBuffer::~SourceBuffer() 46 SourceBuffer::~SourceBuffer()
48 { 47 {
49 } 48 }
50 49
51 PassRefPtr<TimeRanges> SourceBuffer::buffered(ExceptionCode& ec) const 50 PassRefPtr<TimeRanges> SourceBuffer::buffered(ExceptionCode&) const
52 { 51 {
53 if (!m_source) { 52 // FIXME(91773): return buffered data from media source.
54 ec = INVALID_STATE_ERR; 53 return 0;
55 return 0;
56 }
57
58 return m_source->buffered(id(), ec);
59 } 54 }
60 55
61 void SourceBuffer::append(PassRefPtr<Uint8Array> data, ExceptionCode& ec) 56 void SourceBuffer::append(PassRefPtr<Uint8Array>, ExceptionCode&)
62 { 57 {
63 if (!m_source) { 58 // FIXME(91773): append the data to the media source.
64 ec = INVALID_STATE_ERR;
65 return;
66 }
67
68 m_source->append(id(), data, ec);
69 } 59 }
70 60
71 void SourceBuffer::abort(ExceptionCode& ec) 61 void SourceBuffer::abort(ExceptionCode&)
72 { 62 {
73 if (!m_source) { 63 // FIXME(91773): signal the media source to abort this source buffer.
74 ec = INVALID_STATE_ERR;
75 return;
76 }
77
78 m_source->abort(id(), ec);
79 } 64 }
80 65
81 } // namespace WebCore 66 } // namespace WebCore
82 67
83 #endif 68 #endif
OLDNEW
« no previous file with comments | « Source/WebCore/Modules/mediasource/SourceBuffer.h ('k') | Source/WebCore/Modules/mediasource/SourceBufferList.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698