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

Side by Side Diff: media/base/stream_parser_buffer.cc

Issue 125543002: Add plumbing and support for crossfading StreamParserBuffers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 6 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « media/base/stream_parser_buffer.h ('k') | media/filters/chunk_demuxer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "media/base/stream_parser_buffer.h" 5 #include "media/base/stream_parser_buffer.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "media/base/buffers.h" 8 #include "media/base/buffers.h"
9 9
10 namespace media { 10 namespace media {
11 11
12 static bool HasNestedFadeOutPreroll(
13 const std::vector<scoped_refptr<StreamParserBuffer> >& fade_out_preroll) {
14 for (size_t i = 0; i < fade_out_preroll.size(); ++i) {
15 if (!fade_out_preroll[i]->GetFadeOutPreroll().empty())
16 return true;
17 }
18 return false;
19 }
20
12 scoped_refptr<StreamParserBuffer> StreamParserBuffer::CreateEOSBuffer() { 21 scoped_refptr<StreamParserBuffer> StreamParserBuffer::CreateEOSBuffer() {
13 return make_scoped_refptr(new StreamParserBuffer(NULL, 0, NULL, 0, false)); 22 return make_scoped_refptr(new StreamParserBuffer(NULL, 0, NULL, 0, false));
14 } 23 }
15 24
16 scoped_refptr<StreamParserBuffer> StreamParserBuffer::CopyFrom( 25 scoped_refptr<StreamParserBuffer> StreamParserBuffer::CopyFrom(
17 const uint8* data, int data_size, bool is_keyframe) { 26 const uint8* data, int data_size, bool is_keyframe) {
18 return make_scoped_refptr( 27 return make_scoped_refptr(
19 new StreamParserBuffer(data, data_size, NULL, 0, is_keyframe)); 28 new StreamParserBuffer(data, data_size, NULL, 0, is_keyframe));
20 } 29 }
21 30
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 } 65 }
57 66
58 int StreamParserBuffer::GetConfigId() const { 67 int StreamParserBuffer::GetConfigId() const {
59 return config_id_; 68 return config_id_;
60 } 69 }
61 70
62 void StreamParserBuffer::SetConfigId(int config_id) { 71 void StreamParserBuffer::SetConfigId(int config_id) {
63 config_id_ = config_id; 72 config_id_ = config_id;
64 } 73 }
65 74
75 const std::vector<scoped_refptr<StreamParserBuffer> >&
76 StreamParserBuffer::GetFadeOutPreroll() const {
77 return fade_out_preroll_;
78 }
79
80 void StreamParserBuffer::SetFadeOutPreroll(
81 const std::vector<scoped_refptr<StreamParserBuffer> >& fade_out_preroll) {
82 DCHECK(!HasNestedFadeOutPreroll(fade_out_preroll));
83 fade_out_preroll_ = fade_out_preroll;
84 }
85
66 } // namespace media 86 } // namespace media
OLDNEW
« no previous file with comments | « media/base/stream_parser_buffer.h ('k') | media/filters/chunk_demuxer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698