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

Side by Side 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, 3 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef MEDIA_BASE_TEXT_BUFFER_H_
6 #define MEDIA_BASE_TEXT_BUFFER_H_
7
8 #include <string>
9
10 #include "base/memory/ref_counted.h"
11 #include "base/time/time.h"
12 #include "media/base/media_export.h"
13
14 namespace media {
15
16 // A text buffer to carry the components of a text track cue.
17 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.
18 : public base::RefCountedThreadSafe<TextBuffer> {
19 public:
20 TextBuffer(const base::TimeDelta& timestamp,
21 const base::TimeDelta& duration);
22
23 // Access to constructor parameters.
24 base::TimeDelta timestamp() const { return timestamp_; }
25 base::TimeDelta duration() const { return duration_; }
26
27 // To manipulate the cue identifier.
28 const std::string& id() const { return id_; }
29 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.
30
31 // To manipulate the cue rendering settings.
32 const std::string& settings() const { return settings_; }
33 void set_settings(const uint8* settings, int settings_size);
34
35 // To manipulate the payload (body text) of the cue.
36 const std::string& text() const { return text_; }
37 void set_text(const uint8* text, int text_size);
38
39 private:
40 friend class base::RefCountedThreadSafe<TextBuffer>;
41 virtual ~TextBuffer();
42
43 // Utility function to set string member variable.
44 static void set_string(const uint8* buf, int buflen, std::string* str);
45
46 base::TimeDelta timestamp_;
47 base::TimeDelta duration_;
48 std::string id_;
49 std::string settings_;
50 std::string text_;
51
52 DISALLOW_COPY_AND_ASSIGN(TextBuffer);
53 };
54
55 } // namespace media
56
57 #endif // MEDIA_BASE_TEXT_BUFFER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698