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

Unified Diff: media/base/text_buffer.h

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.h
diff --git a/media/base/text_buffer.h b/media/base/text_buffer.h
new file mode 100644
index 0000000000000000000000000000000000000000..b510d209ed16b5c08defc335a4a5ee4f2dc7bca6
--- /dev/null
+++ b/media/base/text_buffer.h
@@ -0,0 +1,57 @@
+// 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.
+
+#ifndef MEDIA_BASE_TEXT_BUFFER_H_
+#define MEDIA_BASE_TEXT_BUFFER_H_
+
+#include <string>
+
+#include "base/memory/ref_counted.h"
+#include "base/time/time.h"
+#include "media/base/media_export.h"
+
+namespace media {
+
+// A text buffer to carry the components of a text track cue.
+class MEDIA_EXPORT TextBuffer
acolwell GONE FROM CHROMIUM 2013/09/12 00:15:15 nit: s/TextBuffer/TextCue
Matthew Heaney (Chromium) 2013/09/13 19:51:54 Done.
+ : public base::RefCountedThreadSafe<TextBuffer> {
+ public:
+ TextBuffer(const base::TimeDelta& timestamp,
+ const base::TimeDelta& duration);
+
+ // Access to constructor parameters.
+ base::TimeDelta timestamp() const { return timestamp_; }
+ base::TimeDelta duration() const { return duration_; }
+
+ // To manipulate the cue identifier.
+ const std::string& id() const { return id_; }
+ void set_id(const uint8* id, int id_size);
acolwell GONE FROM CHROMIUM 2013/09/12 00:15:15 nit: Any reason id, settings, and text can't be pa
Matthew Heaney (Chromium) 2013/09/13 19:51:54 Done.
+
+ // To manipulate the cue rendering settings.
+ const std::string& settings() const { return settings_; }
+ void set_settings(const uint8* settings, int settings_size);
+
+ // To manipulate the payload (body text) of the cue.
+ const std::string& text() const { return text_; }
+ void set_text(const uint8* text, int text_size);
+
+ private:
+ friend class base::RefCountedThreadSafe<TextBuffer>;
+ virtual ~TextBuffer();
+
+ // Utility function to set string member variable.
+ static void set_string(const uint8* buf, int buflen, std::string* str);
+
+ base::TimeDelta timestamp_;
+ base::TimeDelta duration_;
+ std::string id_;
+ std::string settings_;
+ std::string text_;
+
+ DISALLOW_COPY_AND_ASSIGN(TextBuffer);
+};
+
+} // namespace media
+
+#endif // MEDIA_BASE_TEXT_BUFFER_H_

Powered by Google App Engine
This is Rietveld 408576698