Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / media / base / stream_parser.h
index c5410e3..398e8e0 100644 (file)
@@ -46,19 +46,30 @@ class MEDIA_EXPORT StreamParser {
   // Map of text track ID to decode-timestamp-ordered buffers for the track.
   typedef std::map<TrackId, const BufferQueue> TextBufferQueueMap;
 
-  StreamParser();
-  virtual ~StreamParser();
+  // Stream parameters passed in InitCB.
+  struct InitParameters {
+    InitParameters(base::TimeDelta duration);
+
+    // Stream duration.
+    base::TimeDelta duration;
+
+    // Indicates the source time associated with presentation timestamp 0. A
+    // null Time is returned if no mapping to Time exists.
+    base::Time timeline_offset;
+
+    // Indicates that timestampOffset should be updated based on the earliest
+    // end timestamp (audio or video) provided during each NewBuffersCB.
+    bool auto_update_timestamp_offset;
+
+    // Indicates live stream.
+    Demuxer::Liveness liveness;
+  };
 
   // Indicates completion of parser initialization.
-  // First parameter - Indicates initialization success. Set to true if
-  //                   initialization was successful. False if an error
-  //                   occurred.
-  // Second parameter - Indicates the stream duration. Only contains a valid
-  //                    value if the first parameter is true.
-  // Third parameters - Indicates that timestampOffset should be updated based
-  //                    on the earliest end timestamp (audio or video) provided
-  //                    during each NewBuffersCB.
-  typedef base::Callback<void(bool, base::TimeDelta, bool)> InitCB;
+  //   success - True if initialization was successful.
+  //   params - Stream parameters, in case of successful initialization.
+  typedef base::Callback<void(bool success,
+                              const InitParameters& params)> InitCB;
 
   // Indicates when new stream configurations have been parsed.
   // First parameter - The new audio configuration. If the config is not valid
@@ -98,6 +109,9 @@ class MEDIA_EXPORT StreamParser {
   typedef base::Callback<void(const std::string&,
                               const std::vector<uint8>&)> NeedKeyCB;
 
+  StreamParser();
+  virtual ~StreamParser();
+
   // Initializes the parser with necessary callbacks. Must be called before any
   // data is passed to Parse(). |init_cb| will be called once enough data has
   // been parsed to determine the initial stream configurations, presentation