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

Unified Diff: media/filters/frame_processor.h

Issue 180153003: Implement core of compliant MediaSource coded frame processing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase to ToT in preparation for dcommit Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/filters/chunk_demuxer_unittest.cc ('k') | media/filters/frame_processor.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/frame_processor.h
diff --git a/media/filters/frame_processor.h b/media/filters/frame_processor.h
new file mode 100644
index 0000000000000000000000000000000000000000..54505e1412c529d8325d9af83901c4ff57e33112
--- /dev/null
+++ b/media/filters/frame_processor.h
@@ -0,0 +1,60 @@
+// Copyright 2014 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_FILTERS_FRAME_PROCESSOR_H_
+#define MEDIA_FILTERS_FRAME_PROCESSOR_H_
+
+#include "base/basictypes.h"
+#include "base/callback_forward.h"
+#include "base/time/time.h"
+#include "media/base/media_export.h"
+#include "media/base/stream_parser.h"
+#include "media/filters/frame_processor_base.h"
+
+namespace media {
+
+// Helper class that implements Media Source Extension's coded frame processing
+// algorithm.
+class MEDIA_EXPORT FrameProcessor : public FrameProcessorBase {
+ public:
+ typedef base::Callback<void(base::TimeDelta)> UpdateDurationCB;
+ explicit FrameProcessor(const UpdateDurationCB& update_duration_cb);
+ virtual ~FrameProcessor();
+
+ // FrameProcessorBase implementation
+ virtual void SetSequenceMode(bool sequence_mode) OVERRIDE;
+ virtual bool ProcessFrames(const StreamParser::BufferQueue& audio_buffers,
+ const StreamParser::BufferQueue& video_buffers,
+ const StreamParser::TextBufferQueueMap& text_map,
+ base::TimeDelta append_window_start,
+ base::TimeDelta append_window_end,
+ bool* new_media_segment,
+ base::TimeDelta* timestamp_offset) OVERRIDE;
+
+ private:
+ // Helper that processes one frame with the coded frame processing algorithm.
+ // Returns false on error or true on success.
+ bool ProcessFrame(scoped_refptr<StreamParserBuffer> frame,
+ base::TimeDelta append_window_start,
+ base::TimeDelta append_window_end,
+ base::TimeDelta* timestamp_offset,
+ bool* new_media_segment);
+
+ // Sets the need random access point flag on all track buffers to true.
+ void SetAllTrackBuffersNeedRandomAccessPoint();
+
+ // Tracks the MSE coded frame processing variable of same name. It stores the
+ // highest coded frame end timestamp across all coded frames in the current
+ // coded frame group. It is set to 0 when the SourceBuffer object is created
+ // and gets updated by ProcessFrames().
+ base::TimeDelta group_end_timestamp_;
+
+ UpdateDurationCB update_duration_cb_;
+
+ DISALLOW_COPY_AND_ASSIGN(FrameProcessor);
+};
+
+} // namespace media
+
+#endif // MEDIA_FILTERS_FRAME_PROCESSOR_H_
« no previous file with comments | « media/filters/chunk_demuxer_unittest.cc ('k') | media/filters/frame_processor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698