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

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

Issue 712593003: Move key frame flag from StreamParserBuffer to DecoderBuffer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix nits Created 6 years, 1 month 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
« no previous file with comments | « media/base/decryptor.h ('k') | media/base/stream_parser_buffer.h » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/fake_text_track_stream.h" 5 #include "media/base/fake_text_track_stream.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback_helpers.h" 8 #include "base/callback_helpers.h"
9 #include "media/base/decoder_buffer.h" 9 #include "media/base/decoder_buffer.h"
10 #include "media/filters/webvtt_util.h" 10 #include "media/filters/webvtt_util.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 60
61 const uint8* const sd_buf = &side_data[0]; 61 const uint8* const sd_buf = &side_data[0];
62 const int sd_len = static_cast<int>(side_data.size()); 62 const int sd_len = static_cast<int>(side_data.size());
63 63
64 scoped_refptr<DecoderBuffer> buffer; 64 scoped_refptr<DecoderBuffer> buffer;
65 buffer = DecoderBuffer::CopyFrom(data_buf, data_len, sd_buf, sd_len); 65 buffer = DecoderBuffer::CopyFrom(data_buf, data_len, sd_buf, sd_len);
66 66
67 buffer->set_timestamp(start); 67 buffer->set_timestamp(start);
68 buffer->set_duration(duration); 68 buffer->set_duration(duration);
69 69
70 // Assume all fake text buffers are keyframes.
71 buffer->set_is_key_frame(true);
72
70 base::ResetAndReturn(&read_cb_).Run(kOk, buffer); 73 base::ResetAndReturn(&read_cb_).Run(kOk, buffer);
71 } 74 }
72 75
73 void FakeTextTrackStream::AbortPendingRead() { 76 void FakeTextTrackStream::AbortPendingRead() {
74 DCHECK(!read_cb_.is_null()); 77 DCHECK(!read_cb_.is_null());
75 base::ResetAndReturn(&read_cb_).Run(kAborted, NULL); 78 base::ResetAndReturn(&read_cb_).Run(kAborted, NULL);
76 } 79 }
77 80
78 void FakeTextTrackStream::SendEosNotification() { 81 void FakeTextTrackStream::SendEosNotification() {
79 DCHECK(!read_cb_.is_null()); 82 DCHECK(!read_cb_.is_null());
80 base::ResetAndReturn(&read_cb_).Run(kOk, DecoderBuffer::CreateEOSBuffer()); 83 base::ResetAndReturn(&read_cb_).Run(kOk, DecoderBuffer::CreateEOSBuffer());
81 } 84 }
82 85
83 void FakeTextTrackStream::Stop() { 86 void FakeTextTrackStream::Stop() {
84 stopping_ = true; 87 stopping_ = true;
85 if (!read_cb_.is_null()) 88 if (!read_cb_.is_null())
86 AbortPendingRead(); 89 AbortPendingRead();
87 } 90 }
88 91
89 } // namespace media 92 } // namespace media
OLDNEW
« no previous file with comments | « media/base/decryptor.h ('k') | media/base/stream_parser_buffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698