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

Unified Diff: media/base/text_buffer.cc

Issue 23702007: Render inband text tracks in the media pipeline (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
Index: media/base/text_buffer.cc
diff --git a/media/base/text_buffer.cc b/media/base/text_buffer.cc
new file mode 100644
index 0000000000000000000000000000000000000000..7a230a473ea3e5e7a33143ef4ee304a8c167a508
--- /dev/null
+++ b/media/base/text_buffer.cc
@@ -0,0 +1,40 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "media/base/text_buffer.h"
+
+namespace media {
+
+TextBuffer::TextBuffer(const base::TimeDelta& timestamp,
+ const base::TimeDelta& duration)
+ : timestamp_(timestamp),
+ duration_(duration) {
+}
+
+TextBuffer::~TextBuffer() {}
+
+void TextBuffer::set_string(
+ const uint8* buf,
+ int buflen,
+ std::string* str) {
+ if (buf == NULL || buflen <= 0) {
fgalligan1 2013/09/04 22:23:09 Add DCHECK(str)
Matthew Heaney (Chromium) 2013/09/13 19:51:54 OBE
+ str->clear();
+ } else {
+ str->assign(buf, buf + buflen);
+ }
+}
+
+void TextBuffer::set_id(const uint8* id, int id_size) {
+ set_string(id, id_size, &id_);
+}
+
+void TextBuffer::set_settings(const uint8* settings, int settings_size) {
+ set_string(settings, settings_size, &settings_);
+}
+
+void TextBuffer::set_text(const uint8* text, int text_size) {
+ set_string(text, text_size, &text_);
+}
+
+} // namespace media

Powered by Google App Engine
This is Rietveld 408576698