Home | History | Annotate | Download | only in base
      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_CUE_H_
      6 #define MEDIA_BASE_TEXT_CUE_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 TextCue
     18     : public base::RefCountedThreadSafe<TextCue> {
     19  public:
     20   TextCue(const base::TimeDelta& timestamp,
     21           const base::TimeDelta& duration,
     22           const std::string& id,
     23           const std::string& settings,
     24           const std::string& text);
     25 
     26   // Access to constructor parameters.
     27   base::TimeDelta timestamp() const { return timestamp_; }
     28   base::TimeDelta duration() const { return duration_; }
     29   const std::string& id() const { return id_; }
     30   const std::string& settings() const { return settings_; }
     31   const std::string& text() const { return text_; }
     32 
     33  private:
     34   friend class base::RefCountedThreadSafe<TextCue>;
     35   ~TextCue();
     36 
     37   base::TimeDelta timestamp_;
     38   base::TimeDelta duration_;
     39   std::string id_;
     40   std::string settings_;
     41   std::string text_;
     42 
     43   DISALLOW_IMPLICIT_CONSTRUCTORS(TextCue);
     44 };
     45 
     46 }  // namespace media
     47 
     48 #endif  // MEDIA_BASE_TEXT_CUE_H_
     49