summaryrefslogtreecommitdiffstats
path: root/media/base/text_cue.h
blob: 2afae8d5a4f3976ae296c3a80a0f3618d7b6b017 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// 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_CUE_H_
#define MEDIA_BASE_TEXT_CUE_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 TextCue
    : public base::RefCountedThreadSafe<TextCue> {
 public:
  TextCue(const base::TimeDelta& timestamp,
          const base::TimeDelta& duration,
          const std::string& id,
          const std::string& settings,
          const std::string& text);

  // Access to constructor parameters.
  base::TimeDelta timestamp() const { return timestamp_; }
  base::TimeDelta duration() const { return duration_; }
  const std::string& id() const { return id_; }
  const std::string& settings() const { return settings_; }
  const std::string& text() const { return text_; }

 private:
  friend class base::RefCountedThreadSafe<TextCue>;
  ~TextCue();

  base::TimeDelta timestamp_;
  base::TimeDelta duration_;
  std::string id_;
  std::string settings_;
  std::string text_;

  DISALLOW_IMPLICIT_CONSTRUCTORS(TextCue);
};

}  // namespace media

#endif  // MEDIA_BASE_TEXT_CUE_H_