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

Side by Side Diff: media/base/pts_stream.h

Issue 7601002: Revert r95841 due to failing media_unittests on linux_shared bot. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « media/base/pts_heap.h ('k') | media/base/seekable_buffer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MEDIA_BASE_PTS_STREAM_H_ 5 #ifndef MEDIA_BASE_PTS_STREAM_H_
6 #define MEDIA_BASE_PTS_STREAM_H_ 6 #define MEDIA_BASE_PTS_STREAM_H_
7 7
8 // Under some conditions the decoded frames can get invalid or wrong timestamps: 8 // Under some conditions the decoded frames can get invalid or wrong timestamps:
9 // - compressed frames are often in decode timestamp (dts) order, which 9 // - compressed frames are often in decode timestamp (dts) order, which
10 // may not always be in presentation timestamp (pts) order; 10 // may not always be in presentation timestamp (pts) order;
11 // - decoder may report invalid timestamps for the decoded frames; 11 // - decoder may report invalid timestamps for the decoded frames;
12 // - parser may report invalid timestamps for the compressed frames. 12 // - parser may report invalid timestamps for the compressed frames.
13 // 13 //
14 // To ensure that the decoded frames are displayed in the proper order, the 14 // To ensure that the decoded frames are displayed in the proper order, the
15 // PtsStream class assembles the time information from different sources and 15 // PtsStream class assembles the time information from different sources and
16 // combines it into the "best guess" timestamp and duration for the current 16 // combines it into the "best guess" timestamp and duration for the current
17 // frame. Data inside the decoded frame (if provided) is trusted the most, 17 // frame. Data inside the decoded frame (if provided) is trusted the most,
18 // followed by data from the packet stream. Estimation based on the last known 18 // followed by data from the packet stream. Estimation based on the last known
19 // PTS and frame rate is reserved as a last-ditch effort. 19 // PTS and frame rate is reserved as a last-ditch effort.
20 20
21 #include "base/time.h" 21 #include "base/time.h"
22 #include "media/base/pts_heap.h" 22 #include "media/base/pts_heap.h"
23 23
24 namespace media { 24 namespace media {
25 25
26 class StreamSample; 26 class StreamSample;
27 27
28 class MEDIA_EXPORT PtsStream { 28 class PtsStream {
29 public: 29 public:
30 PtsStream(); 30 PtsStream();
31 ~PtsStream(); 31 ~PtsStream();
32 32
33 // Initializes an instance using |frame_duration| as default. In absence of 33 // Initializes an instance using |frame_duration| as default. In absence of
34 // other PTS information PtsStream will produce timestamps separated in time 34 // other PTS information PtsStream will produce timestamps separated in time
35 // by this duration. 35 // by this duration.
36 void Initialize(const base::TimeDelta& frame_duration); 36 void Initialize(const base::TimeDelta& frame_duration);
37 37
38 // Sets the |current_pts_| to specified |timestamp| and flushes all enqueued 38 // Sets the |current_pts_| to specified |timestamp| and flushes all enqueued
(...skipping 22 matching lines...) Expand all
61 61
62 base::TimeDelta current_pts_; 62 base::TimeDelta current_pts_;
63 base::TimeDelta current_duration_; 63 base::TimeDelta current_duration_;
64 64
65 DISALLOW_COPY_AND_ASSIGN(PtsStream); 65 DISALLOW_COPY_AND_ASSIGN(PtsStream);
66 }; 66 };
67 67
68 } // namespace media 68 } // namespace media
69 69
70 #endif // MEDIA_BASE_PTS_STREAM_H_ 70 #endif // MEDIA_BASE_PTS_STREAM_H_
OLDNEW
« no previous file with comments | « media/base/pts_heap.h ('k') | media/base/seekable_buffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698